Skip to content

Commit 20ec34e

Browse files
Refactor load and grid data structures; separate per-phase load metrics from grid metrics to improve clarity and extensibility.
1 parent 31645fe commit 20ec34e

6 files changed

Lines changed: 130 additions & 82 deletions

File tree

inverter/aggregate.go

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ func aggregateBattery(units []UnitSnapshot) BatteryData {
4949
b.ControllerTemp = math.Max(b.ControllerTemp, u.Battery.ControllerTemp)
5050
b.BatteryTemp = math.Max(b.BatteryTemp, u.Battery.BatteryTemp)
5151
b.TotalChargePower += u.Battery.TotalChargePower
52+
b.SignedPower += u.Battery.SignedPower
5253
b.FaultAlarmBits |= u.Battery.FaultAlarmBits
5354
b.BMSVoltage += u.Battery.BMSVoltage
5455
b.BMSCurrent += u.Battery.BMSCurrent
@@ -113,6 +114,9 @@ func aggregateLoad(units []UnitSnapshot) LoadData {
113114
}
114115
l.PowerFactor /= n // average
115116
l.DCVoltage /= n // average
117+
l.L1 = aggregateLoadPhase(units, func(u UnitSnapshot) LoadPhaseData { return u.Load.L1 })
118+
l.L2 = aggregateLoadPhase(units, func(u UnitSnapshot) LoadPhaseData { return u.Load.L2 })
119+
l.L3 = aggregateLoadPhase(units, func(u UnitSnapshot) LoadPhaseData { return u.Load.L3 })
116120
return l
117121
}
118122

@@ -122,34 +126,43 @@ func aggregateGrid(units []UnitSnapshot) GridData {
122126
for _, u := range units {
123127
g.Frequency += u.Grid.Frequency
124128
g.MainsChargeCurr += u.Grid.MainsChargeCurr
129+
g.TotalPower += u.Grid.TotalPower
125130
}
126131
g.Frequency /= n
127-
g.L1 = aggregatePhase(units, func(u UnitSnapshot) PhaseData { return u.Grid.L1 })
128-
g.L2 = aggregatePhase(units, func(u UnitSnapshot) PhaseData { return u.Grid.L2 })
129-
g.L3 = aggregatePhase(units, func(u UnitSnapshot) PhaseData { return u.Grid.L3 })
132+
g.L1 = aggregateGridPhase(units, func(u UnitSnapshot) GridPhaseData { return u.Grid.L1 })
133+
g.L2 = aggregateGridPhase(units, func(u UnitSnapshot) GridPhaseData { return u.Grid.L2 })
134+
g.L3 = aggregateGridPhase(units, func(u UnitSnapshot) GridPhaseData { return u.Grid.L3 })
130135
return g
131136
}
132137

133-
func aggregatePhase(units []UnitSnapshot, get func(UnitSnapshot) PhaseData) PhaseData {
138+
func aggregateGridPhase(units []UnitSnapshot, get func(UnitSnapshot) GridPhaseData) GridPhaseData {
134139
n := float64(len(units))
135-
var p PhaseData
140+
var p GridPhaseData
136141
for _, u := range units {
137142
ph := get(u)
138143
p.GridVoltage += ph.GridVoltage
139144
p.GridCurrent += ph.GridCurrent
140145
p.InverterVoltage += ph.InverterVoltage
141146
p.InverterCurrent += ph.InverterCurrent
142-
p.LoadCurrent += ph.LoadCurrent
143-
p.LoadPower += ph.LoadPower
144-
p.LoadApparentPower += ph.LoadApparentPower
145-
p.LoadRatio += ph.LoadRatio
146147
}
147-
// Voltages: average. Currents/power/ratio: sum.
148+
// Voltages: average. Currents: sum.
148149
p.GridVoltage /= n
149150
p.InverterVoltage /= n
150151
return p
151152
}
152153

154+
func aggregateLoadPhase(units []UnitSnapshot, get func(UnitSnapshot) LoadPhaseData) LoadPhaseData {
155+
var p LoadPhaseData
156+
for _, u := range units {
157+
ph := get(u)
158+
p.Current += ph.Current
159+
p.Power += ph.Power
160+
p.ApparentPower += ph.ApparentPower
161+
p.Ratio += ph.Ratio
162+
}
163+
return p
164+
}
165+
153166
func aggregateInverter(units []UnitSnapshot) InverterData {
154167
n := float64(len(units))
155168
var inv InverterData

inverter/read.go

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ func readUnitSnapshot(session *modbus.Session) (UnitSnapshot, error) {
2929
snap.Stats.BatteryDischargeEnergy = snap.Stats.BatteryDischargeToday * snap.Battery.Voltage / 1000
3030
}
3131

32+
// Signed battery power: positive = charging, negative = discharging.
33+
// SRNE convention: battery current is negative when charging.
34+
snap.Battery.SignedPower = -snap.Battery.Current * snap.Battery.Voltage
35+
36+
// Grid total power from per-phase V×I.
37+
snap.Grid.TotalPower = snap.Grid.L1.GridVoltage*snap.Grid.L1.GridCurrent +
38+
snap.Grid.L2.GridVoltage*snap.Grid.L2.GridCurrent +
39+
snap.Grid.L3.GridVoltage*snap.Grid.L3.GridCurrent
40+
3241
snap.Errors = errs
3342
return snap, nil
3443
}
@@ -178,43 +187,50 @@ func readInverterAndLoadData(session *modbus.Session, load *LoadData, grid *Grid
178187
// Grid
179188
grid.Frequency = readScaled(session, register.AddrGridFrequency, register.Mul001)
180189
grid.MainsChargeCurr = readScaled(session, register.AddrMainsChargeCurrent, register.Mul01)
181-
readPhaseData(session, &grid.L1,
190+
readGridPhase(session, &grid.L1,
182191
register.AddrGridVoltageL1, register.AddrGridCurrentL1,
183-
register.AddrInverterVoltageL1, register.AddrInverterCurrentL1,
192+
register.AddrInverterVoltageL1, register.AddrInverterCurrentL1)
193+
readGridPhase(session, &grid.L2,
194+
register.AddrGridVoltageL2, register.AddrGridCurrentL2,
195+
register.AddrInverterVoltageL2, register.AddrInverterCurrentL2)
196+
readGridPhase(session, &grid.L3,
197+
register.AddrGridVoltageL3, register.AddrGridCurrentL3,
198+
register.AddrInverterVoltageL3, register.AddrInverterCurrentL3)
199+
200+
// Load (per-phase + aggregates)
201+
readLoadPhase(session, &load.L1,
184202
register.AddrLoadCurrentL1, register.AddrLoadPowerL1,
185203
register.AddrLoadApparentPowerL1, register.AddrLoadRatioL1)
186-
readPhaseData(session, &grid.L2,
187-
register.AddrGridVoltageL2, register.AddrGridCurrentL2,
188-
register.AddrInverterVoltageL2, register.AddrInverterCurrentL2,
204+
readLoadPhase(session, &load.L2,
189205
register.AddrLoadCurrentL2, register.AddrLoadPowerL2,
190206
register.AddrLoadApparentPowerL2, register.AddrLoadRatioL2)
191-
readPhaseData(session, &grid.L3,
192-
register.AddrGridVoltageL3, register.AddrGridCurrentL3,
193-
register.AddrInverterVoltageL3, register.AddrInverterCurrentL3,
207+
readLoadPhase(session, &load.L3,
194208
register.AddrLoadCurrentL3, register.AddrLoadPowerL3,
195209
register.AddrLoadApparentPowerL3, register.AddrLoadRatioL3)
196-
197-
// Load
198210
load.PowerFactor = readSigned(session, register.AddrLoadPowerFactor, register.Mul001)
199211
load.DCVoltage = readScaled(session, register.AddrDCLoadVoltage, register.Mul01)
200212
load.DCCurrent = readScaled(session, register.AddrDCLoadCurrent, register.Mul001)
201213
load.DCPower = readScaled(session, register.AddrDCLoadPower, nil)
202-
load.TotalPower = grid.L1.LoadPower + grid.L2.LoadPower + grid.L3.LoadPower
203-
load.TotalApparentPower = grid.L1.LoadApparentPower + grid.L2.LoadApparentPower + grid.L3.LoadApparentPower
214+
load.TotalPower = load.L1.Power + load.L2.Power + load.L3.Power
215+
load.TotalApparentPower = load.L1.ApparentPower + load.L2.ApparentPower + load.L3.ApparentPower
204216

205217
return nil
206218
}
207219

208-
func readPhaseData(session *modbus.Session, p *PhaseData,
209-
gridV, gridI, invV, invI, loadI, loadP, loadVA, loadRatio uint16) {
220+
func readGridPhase(session *modbus.Session, p *GridPhaseData,
221+
gridV, gridI, invV, invI uint16) {
210222
p.GridVoltage = readScaled(session, gridV, register.Mul01)
211223
p.GridCurrent = readScaled(session, gridI, register.Mul01)
212224
p.InverterVoltage = readScaled(session, invV, register.Mul01)
213225
p.InverterCurrent = readSigned(session, invI, register.Mul01)
214-
p.LoadCurrent = readScaled(session, loadI, register.Mul01)
215-
p.LoadPower = readScaled(session, loadP, nil)
216-
p.LoadApparentPower = readScaled(session, loadVA, nil)
217-
p.LoadRatio = readScaled(session, loadRatio, nil)
226+
}
227+
228+
func readLoadPhase(session *modbus.Session, p *LoadPhaseData,
229+
loadI, loadP, loadVA, loadRatio uint16) {
230+
p.Current = readScaled(session, loadI, register.Mul01)
231+
p.Power = readScaled(session, loadP, nil)
232+
p.ApparentPower = readScaled(session, loadVA, nil)
233+
p.Ratio = readScaled(session, loadRatio, nil)
218234
}
219235

220236
func readStatsData(session *modbus.Session, s *StatsData) error {

inverter/snapshot.go

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ type BatteryData struct {
4141
BatteryTemp float64 `json:"battery_temp"` // °C
4242
ChargeStatus uint16 `json:"charge_status"`
4343
ChargeStatusName string `json:"charge_status_name"`
44-
TotalChargePower float64 `json:"total_charge_power"` // W
44+
TotalChargePower float64 `json:"total_charge_power"` // W (magnitude only)
45+
SignedPower float64 `json:"signed_power"` // W (positive = charging, negative = discharging)
4546
FaultAlarmBits uint32 `json:"fault_alarm_bits"`
4647
// BMS fields (zero if unavailable)
4748
BMSVoltage float64 `json:"bms_voltage"` // V
@@ -63,35 +64,43 @@ type PVData struct {
6364
TotalPower float64 `json:"total_power"` // W (PV1 + PV2, summed across units)
6465
}
6566

66-
// PhaseData holds per-phase AC measurements.
67-
type PhaseData struct {
68-
GridVoltage float64 `json:"grid_voltage"` // V
69-
GridCurrent float64 `json:"grid_current"` // A
70-
InverterVoltage float64 `json:"inverter_voltage"` // V
71-
InverterCurrent float64 `json:"inverter_current"` // A
72-
LoadCurrent float64 `json:"load_current"` // A
73-
LoadPower float64 `json:"load_power"` // W
74-
LoadApparentPower float64 `json:"load_apparent_power"` // VA
75-
LoadRatio float64 `json:"load_ratio"` // %
67+
// GridPhaseData holds per-phase grid and inverter AC measurements.
68+
type GridPhaseData struct {
69+
GridVoltage float64 `json:"grid_voltage"` // V
70+
GridCurrent float64 `json:"grid_current"` // A
71+
InverterVoltage float64 `json:"inverter_voltage"` // V
72+
InverterCurrent float64 `json:"inverter_current"` // A
7673
}
7774

78-
// LoadData holds load consumption data.
75+
// LoadPhaseData holds per-phase load measurements.
76+
type LoadPhaseData struct {
77+
Current float64 `json:"current"` // A
78+
Power float64 `json:"power"` // W
79+
ApparentPower float64 `json:"apparent_power"` // VA
80+
Ratio float64 `json:"ratio"` // %
81+
}
82+
83+
// LoadData holds load consumption data with per-phase detail.
7984
type LoadData struct {
80-
TotalPower float64 `json:"total_power"` // W (sum of all phases)
81-
TotalApparentPower float64 `json:"total_apparent_power"` // VA
82-
PowerFactor float64 `json:"power_factor"`
83-
DCVoltage float64 `json:"dc_voltage"` // V
84-
DCCurrent float64 `json:"dc_current"` // A
85-
DCPower float64 `json:"dc_power"` // W
85+
TotalPower float64 `json:"total_power"` // W (sum of all phases)
86+
TotalApparentPower float64 `json:"total_apparent_power"` // VA
87+
PowerFactor float64 `json:"power_factor"`
88+
DCVoltage float64 `json:"dc_voltage"` // V
89+
DCCurrent float64 `json:"dc_current"` // A
90+
DCPower float64 `json:"dc_power"` // W
91+
L1 LoadPhaseData `json:"l1"`
92+
L2 LoadPhaseData `json:"l2"`
93+
L3 LoadPhaseData `json:"l3"`
8694
}
8795

8896
// GridData holds grid/mains data with per-phase detail.
8997
type GridData struct {
90-
Frequency float64 `json:"frequency"` // Hz
91-
MainsChargeCurr float64 `json:"mains_charge_curr"` // A
92-
L1 PhaseData `json:"l1"`
93-
L2 PhaseData `json:"l2"`
94-
L3 PhaseData `json:"l3"`
98+
Frequency float64 `json:"frequency"` // Hz
99+
MainsChargeCurr float64 `json:"mains_charge_curr"` // A
100+
TotalPower float64 `json:"total_power"` // W (sum of V×I across phases)
101+
L1 GridPhaseData `json:"l1"`
102+
L2 GridPhaseData `json:"l2"`
103+
L3 GridPhaseData `json:"l3"`
95104
}
96105

97106
// InverterData holds inverter operational state.

serve/mqtt.go

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ var systemSensors = []sensorDef{
3232
{"battery_voltage", "Battery Voltage", "V", "voltage", "measurement", "mdi:flash", "battery.voltage"},
3333
{"battery_current", "Battery Current", "A", "current", "measurement", "mdi:current-dc", "battery.current"},
3434
{"battery_power", "Battery Power", "W", "power", "measurement", "mdi:battery-charging", "battery.total_charge_power"},
35+
{"battery_power_signed", "Battery Power (Signed)", "W", "power", "measurement", "mdi:battery-sync", "battery.signed_power"},
3536
{"charge_status", "Charge Status", "", "", "", "mdi:battery-sync", "battery.charge_status_name"},
3637
{"bms_voltage", "BMS Voltage", "V", "voltage", "measurement", "mdi:flash", "battery.bms_voltage"},
3738
{"bms_current", "BMS Current", "A", "current", "measurement", "mdi:current-dc", "battery.bms_current"},
@@ -47,26 +48,31 @@ var systemSensors = []sensorDef{
4748
// Grid (shared grid connection)
4849
{"grid_frequency", "Grid Frequency", "Hz", "frequency", "measurement", "mdi:sine-wave", "grid.frequency"},
4950
{"mains_charge_current", "Mains Charge Current", "A", "current", "measurement", "mdi:transmission-tower-export", "grid.mains_charge_curr"},
51+
{"grid_power", "Grid Power", "W", "power", "measurement", "mdi:transmission-tower", "grid.total_power"},
5052

51-
// Grid L1 (voltage = shared grid, current/power = summed)
53+
// Grid L1
5254
{"grid_voltage_l1", "Grid Voltage L1", "V", "voltage", "measurement", "mdi:transmission-tower", "grid.l1.grid_voltage"},
5355
{"grid_current_l1", "Grid Current L1", "A", "current", "measurement", "mdi:transmission-tower", "grid.l1.grid_current"},
5456
{"inverter_voltage_l1", "Inverter Voltage L1", "V", "voltage", "measurement", "mdi:sine-wave", "grid.l1.inverter_voltage"},
5557
{"inverter_current_l1", "Inverter Current L1", "A", "current", "measurement", "mdi:sine-wave", "grid.l1.inverter_current"},
56-
{"load_power_l1", "Load Power L1", "W", "power", "measurement", "mdi:flash", "grid.l1.load_power"},
57-
{"load_current_l1", "Load Current L1", "A", "current", "measurement", "mdi:flash", "grid.l1.load_current"},
58-
{"load_apparent_power_l1", "Load Apparent Power L1", "VA", "apparent_power", "measurement", "mdi:flash", "grid.l1.load_apparent_power"},
59-
{"load_ratio_l1", "Load Ratio L1", "%", "", "measurement", "mdi:gauge", "grid.l1.load_ratio"},
58+
59+
// Load L1
60+
{"load_power_l1", "Load Power L1", "W", "power", "measurement", "mdi:flash", "load.l1.power"},
61+
{"load_current_l1", "Load Current L1", "A", "current", "measurement", "mdi:flash", "load.l1.current"},
62+
{"load_apparent_power_l1", "Load Apparent Power L1", "VA", "apparent_power", "measurement", "mdi:flash", "load.l1.apparent_power"},
63+
{"load_ratio_l1", "Load Ratio L1", "%", "", "measurement", "mdi:gauge", "load.l1.ratio"},
6064

6165
// Grid L2
6266
{"grid_voltage_l2", "Grid Voltage L2", "V", "voltage", "measurement", "mdi:transmission-tower", "grid.l2.grid_voltage"},
6367
{"grid_current_l2", "Grid Current L2", "A", "current", "measurement", "mdi:transmission-tower", "grid.l2.grid_current"},
6468
{"inverter_voltage_l2", "Inverter Voltage L2", "V", "voltage", "measurement", "mdi:sine-wave", "grid.l2.inverter_voltage"},
6569
{"inverter_current_l2", "Inverter Current L2", "A", "current", "measurement", "mdi:sine-wave", "grid.l2.inverter_current"},
66-
{"load_power_l2", "Load Power L2", "W", "power", "measurement", "mdi:flash", "grid.l2.load_power"},
67-
{"load_current_l2", "Load Current L2", "A", "current", "measurement", "mdi:flash", "grid.l2.load_current"},
68-
{"load_apparent_power_l2", "Load Apparent Power L2", "VA", "apparent_power", "measurement", "mdi:flash", "grid.l2.load_apparent_power"},
69-
{"load_ratio_l2", "Load Ratio L2", "%", "", "measurement", "mdi:gauge", "grid.l2.load_ratio"},
70+
71+
// Load L2
72+
{"load_power_l2", "Load Power L2", "W", "power", "measurement", "mdi:flash", "load.l2.power"},
73+
{"load_current_l2", "Load Current L2", "A", "current", "measurement", "mdi:flash", "load.l2.current"},
74+
{"load_apparent_power_l2", "Load Apparent Power L2", "VA", "apparent_power", "measurement", "mdi:flash", "load.l2.apparent_power"},
75+
{"load_ratio_l2", "Load Ratio L2", "%", "", "measurement", "mdi:gauge", "load.l2.ratio"},
7076

7177
// System state
7278
{"inverter_state", "Inverter State", "", "", "", "mdi:state-machine", "inverter.machine_state_name"},
@@ -130,20 +136,24 @@ var unitSensors = []sensorDef{
130136
{"grid_current_l1", "Grid Current L1", "A", "current", "measurement", "mdi:transmission-tower", "grid.l1.grid_current"},
131137
{"inverter_voltage_l1", "Inverter Voltage L1", "V", "voltage", "measurement", "mdi:sine-wave", "grid.l1.inverter_voltage"},
132138
{"inverter_current_l1", "Inverter Current L1", "A", "current", "measurement", "mdi:sine-wave", "grid.l1.inverter_current"},
133-
{"load_power_l1", "Load Power L1", "W", "power", "measurement", "mdi:flash", "grid.l1.load_power"},
134-
{"load_current_l1", "Load Current L1", "A", "current", "measurement", "mdi:flash", "grid.l1.load_current"},
135-
{"load_apparent_power_l1", "Load Apparent Power L1", "VA", "apparent_power", "measurement", "mdi:flash", "grid.l1.load_apparent_power"},
136-
{"load_ratio_l1", "Load Ratio L1", "%", "", "measurement", "mdi:gauge", "grid.l1.load_ratio"},
139+
140+
// Load L1
141+
{"load_power_l1", "Load Power L1", "W", "power", "measurement", "mdi:flash", "load.l1.power"},
142+
{"load_current_l1", "Load Current L1", "A", "current", "measurement", "mdi:flash", "load.l1.current"},
143+
{"load_apparent_power_l1", "Load Apparent Power L1", "VA", "apparent_power", "measurement", "mdi:flash", "load.l1.apparent_power"},
144+
{"load_ratio_l1", "Load Ratio L1", "%", "", "measurement", "mdi:gauge", "load.l1.ratio"},
137145

138146
// Grid L2
139147
{"grid_voltage_l2", "Grid Voltage L2", "V", "voltage", "measurement", "mdi:transmission-tower", "grid.l2.grid_voltage"},
140148
{"grid_current_l2", "Grid Current L2", "A", "current", "measurement", "mdi:transmission-tower", "grid.l2.grid_current"},
141149
{"inverter_voltage_l2", "Inverter Voltage L2", "V", "voltage", "measurement", "mdi:sine-wave", "grid.l2.inverter_voltage"},
142150
{"inverter_current_l2", "Inverter Current L2", "A", "current", "measurement", "mdi:sine-wave", "grid.l2.inverter_current"},
143-
{"load_power_l2", "Load Power L2", "W", "power", "measurement", "mdi:flash", "grid.l2.load_power"},
144-
{"load_current_l2", "Load Current L2", "A", "current", "measurement", "mdi:flash", "grid.l2.load_current"},
145-
{"load_apparent_power_l2", "Load Apparent Power L2", "VA", "apparent_power", "measurement", "mdi:flash", "grid.l2.load_apparent_power"},
146-
{"load_ratio_l2", "Load Ratio L2", "%", "", "measurement", "mdi:gauge", "grid.l2.load_ratio"},
151+
152+
// Load L2
153+
{"load_power_l2", "Load Power L2", "W", "power", "measurement", "mdi:flash", "load.l2.power"},
154+
{"load_current_l2", "Load Current L2", "A", "current", "measurement", "mdi:flash", "load.l2.current"},
155+
{"load_apparent_power_l2", "Load Apparent Power L2", "VA", "apparent_power", "measurement", "mdi:flash", "load.l2.apparent_power"},
156+
{"load_ratio_l2", "Load Ratio L2", "%", "", "measurement", "mdi:gauge", "load.l2.ratio"},
147157

148158
// Inverter (per-unit diagnostics)
149159
{"inverter_state", "Inverter State", "", "", "", "mdi:state-machine", "inverter.machine_state_name"},

serve/sse.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,14 @@ func snapshotValues(s *inverter.Snapshot) map[string]string {
132132
"load-dc": fmt.Sprintf("%.0f", s.Load.DCPower),
133133
// Grid / AC output
134134
"grid-l1-v": fmt.Sprintf("%.1f", s.Grid.L1.GridVoltage),
135-
"grid-l1-w": fmt.Sprintf("%.0f", s.Grid.L1.LoadPower),
136-
"grid-l1-va": fmt.Sprintf("%.0f/%.1f", s.Grid.L1.LoadApparentPower, s.Grid.L1.LoadCurrent),
137-
"grid-l1-pct": fmt.Sprintf("%.0f", s.Grid.L1.LoadRatio),
135+
"grid-l1-w": fmt.Sprintf("%.0f", s.Load.L1.Power),
136+
"grid-l1-va": fmt.Sprintf("%.0f/%.1f", s.Load.L1.ApparentPower, s.Load.L1.Current),
137+
"grid-l1-pct": fmt.Sprintf("%.0f", s.Load.L1.Ratio),
138138
"grid-l2-v": fmt.Sprintf("%.1f", s.Grid.L2.GridVoltage),
139-
"grid-l2-w": fmt.Sprintf("%.0f", s.Grid.L2.LoadPower),
140-
"grid-l2-va": fmt.Sprintf("%.0f/%.1f", s.Grid.L2.LoadApparentPower, s.Grid.L2.LoadCurrent),
141-
"grid-l2-pct": fmt.Sprintf("%.0f", s.Grid.L2.LoadRatio),
142-
"grid-l3-i": fmt.Sprintf("%.1f", s.Grid.L3.LoadCurrent),
139+
"grid-l2-w": fmt.Sprintf("%.0f", s.Load.L2.Power),
140+
"grid-l2-va": fmt.Sprintf("%.0f/%.1f", s.Load.L2.ApparentPower, s.Load.L2.Current),
141+
"grid-l2-pct": fmt.Sprintf("%.0f", s.Load.L2.Ratio),
142+
"grid-l3-i": fmt.Sprintf("%.1f", s.Load.L3.Current),
143143
"grid-freq": fmt.Sprintf("%.2f", s.Grid.Frequency),
144144
"grid-charge": fmt.Sprintf("%.1f", s.Grid.MainsChargeCurr),
145145
"inv-l1-v": fmt.Sprintf("%.1f", s.Grid.L1.InverterVoltage),

0 commit comments

Comments
 (0)