diff --git a/charger/ocpp/connector.go b/charger/ocpp/connector.go index 409af091c0..6dea4275c8 100644 --- a/charger/ocpp/connector.go +++ b/charger/ocpp/connector.go @@ -265,10 +265,10 @@ func (conn *Connector) CurrentPower() (float64, error) { } // fallback for missing total power - - res, found, err := conn.phaseMeasurements(types.MeasurandPowerActiveImport, "") - if found { - return res[0] + res[1] + res[2], err + for _, suffix := range []types.Measurand{"", "-N"} { + if res, found, err := conn.phaseMeasurements(types.MeasurandPowerActiveImport, suffix); found { + return res[0] + res[1] + res[2], err + } } return 0, api.ErrNotAvailable @@ -347,9 +347,10 @@ func (conn *Connector) Currents() (float64, float64, float64, error) { return 0, 0, 0, nil } - res, found, err := conn.phaseMeasurements(types.MeasurandCurrentImport, "") - if found { - return res[0], res[1], res[2], err + for _, suffix := range []types.Measurand{"", "-N"} { + if res, found, err := conn.phaseMeasurements(types.MeasurandCurrentImport, suffix); found { + return res[0], res[1], res[2], err + } } return 0, 0, 0, api.ErrNotAvailable @@ -368,14 +369,10 @@ func (conn *Connector) Voltages() (float64, float64, float64, error) { return 0, 0, 0, api.ErrTimeout } - res, found, err := conn.phaseMeasurements(types.MeasurandVoltage, "-N") - if found { - return res[0], res[1], res[2], err - } - - res, found, err = conn.phaseMeasurements(types.MeasurandVoltage, "") - if found { - return res[0], res[1], res[2], err + for _, suffix := range []types.Measurand{"-N", ""} { + if res, found, err := conn.phaseMeasurements(types.MeasurandVoltage, suffix); found { + return res[0], res[1], res[2], err + } } return 0, 0, 0, api.ErrNotAvailable