Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ControllerFaultsMap = map[int]ControllerFault{ 30: ChargeMOSShortCircuit, 29: AntiReverseMOSShort, 28: SolarPanelReverselyConnected, 27: SolarPanelWorkingPointOverVoltage, 26: SolarPanelCounterCurrent, 25: PhotovoltaicInputSideOverVoltage, 24: PhotovoltaicInputSideShortCircuit, 23: PhotovoltaicInputOverPower, 22: AmbientTemperatureTooHigh, 21: ControllerTemperatureTooHigh, 20: LoadOverPowerOrLoadOverCurrent, 19: LoadShortCircuit, 18: BatteryUnderVoltage, 17: BatteryOverVoltage, 16: BatteryOverDischarge, }
Functions ¶
This section is empty.
Types ¶
type ChargingState ¶
type ChargingState int
const ( ChargingDeactivated ChargingState = iota ChargingActivated MPPTChargingMode EqualizingChargingMode BoostChargingMode FloatingChargingMode CurrentLimitingOverPower )
func (ChargingState) String ¶
func (cs ChargingState) String() string
type ControllerFault ¶
type ControllerFault int
const ( NoFault ControllerFault = iota ChargeMOSShortCircuit AntiReverseMOSShort SolarPanelReverselyConnected SolarPanelWorkingPointOverVoltage SolarPanelCounterCurrent PhotovoltaicInputSideOverVoltage PhotovoltaicInputSideShortCircuit PhotovoltaicInputOverPower AmbientTemperatureTooHigh ControllerTemperatureTooHigh LoadOverPowerOrLoadOverCurrent LoadShortCircuit BatteryUnderVoltage BatteryOverVoltage BatteryOverDischarge )
func (ControllerFault) String ¶
func (cf ControllerFault) String() string
type DynamicControllerInformation ¶
type DynamicControllerInformation struct {
BatteryCapacitySOC int `json:"battery_capacity_soc"` // 0x100
BatteryVoltage decimal.Decimal `json:"battery_voltage"` // 0x101
ChargingCurrent decimal.Decimal `json:"charging_current"` // 0x102
ControllerTemperature int `json:"controller_temperature"` // 0x103 ?
BatteryTemperature int `json:"battery_temperature"` // 0x103 ?
StreetLightLoadVoltage decimal.Decimal `json:"street_light_load_voltage"` // 0x104
StreetLightLoadCurrent decimal.Decimal `json:"street_light_load_current"` // 0x105
StreetLightLoadPower decimal.Decimal `json:"street_light_load_power"` // 0x106
SolarPanelVoltage decimal.Decimal `json:"solar_panel_voltage"` // 0x107
SolarPanelCurrent decimal.Decimal `json:"solar_panel_current"` // 0x108
ChargingPower decimal.Decimal `json:"charging_power"` // 0x109
BatteryMinimumVoltageCurrentDay decimal.Decimal `json:"battery_minimum_voltage_current_day"` // 0x10B
BatteryMaximumVoltageCurrentDay decimal.Decimal `json:"battery_maximum_voltage_current_day"` // 0x10C
MaximumChargingCurrentCurrentDay decimal.Decimal `json:"maximum_charging_current_current_day"` // 0x10D
MaximumDischargingCurrentCurrentDay decimal.Decimal `json:"maximum_discharging_current_current_day"` // 0x10E
MaximumChargingPowerCurrentDay decimal.Decimal `json:"maximum_charging_power_current_day"` // 0x10F
MaximumDischargingPowerCurrentDay decimal.Decimal `json:"maximum_discharging_power_current_day"` // 0x110
ChargingAmpHoursCurrentDay decimal.Decimal `json:"charging_amp_hours_current_day"` // 0x111
DischargingAmpHoursCurrentDay decimal.Decimal `json:"discharging_amp_hours_current_day"` // 0x112
PowerGenerationCurrentDay decimal.Decimal `json:"power_generation_current_day"` // 0x113
PowerConsumptionCurrentDay decimal.Decimal `json:"power_consumption_current_day"` // 0x114
TotalOperatingDays int `json:"total_operating_days"` // 0x115
TotalBatteryOverDischarges int `json:"total_battery_over_discharges"` // 0x116
TotalBatteryFullCharges int `json:"total_battery_full_charges"` // 0x117
TotalChargingAmpHours decimal.Decimal `json:"total_charging_amp_hours"` // 0x118-119
TotalDischargingAmpHours decimal.Decimal `json:"total_discharging_amp_hours"` // 0x11A-11B
CumulativePowerGeneration decimal.Decimal `json:"cumulative_power_generation"` // 0x11C-11D
CumulativePowerConsumption decimal.Decimal `json:"cumulative_power_consumption"` // 0x11E-11F
StreetLightStatus bool `json:"street_light_status"` // 0x120 (eight higher bits)
StreetLightBrightness int `json:"street_light_brightness"` // 0x120 (eight higher bits)
ChargingState string `json:"charging_state"` // 0x120 (eight lower bits)
ControllerFaults []string `json:"controller_faults"` // 0x121-122
}
func Parse ¶
func Parse(dataBytes []byte) (*DynamicControllerInformation, error)
func (*DynamicControllerInformation) Synthesize ¶ added in v1.0.2
func (dci *DynamicControllerInformation) Synthesize() ([]byte, error)
type ModbusClient ¶
func NewModbusClient ¶
func (*ModbusClient) ReadData ¶
func (mc *ModbusClient) ReadData() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.