Ocpp: fix phase energy unit conversion (#19590)

This commit is contained in:
andig 2025-03-08 14:30:57 +01:00 • committed by GitHub
parent 788e2ef780
commit 33758d094b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -324,7 +324,7 @@ func (conn *Connector) TotalEnergy() (float64, error) {
// 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 (res[0] + res[1] + res[2]) / 1e3, err
}
}