OCPP: allow phase key in Energy.Active.Import.Register (#19405)
This commit is contained in:
parent
f26786ca9d
commit
9a94d1625d
1 changed files with 7 additions and 0 deletions
|
|
@ -321,6 +321,13 @@ func (conn *Connector) TotalEnergy() (float64, error) {
|
|||
return scale(f, m.Unit) / 1e3, err
|
||||
}
|
||||
|
||||
// fallback for missing total energy
|
||||
for _, suffix := range []types.Measurand{"", "-N"} {
|
||||
if res, found, err := conn.phaseMeasurements(types.MeasurandEnergyActiveImportRegister, suffix); found {
|
||||
return res[0] + res[1] + res[2], err
|
||||
}
|
||||
}
|
||||
|
||||
return 0, api.ErrNotAvailable
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue