diff --git a/charger/keba-modbus.go b/charger/keba-modbus.go index d57c02b4e..9bedb5226 100644 --- a/charger/keba-modbus.go +++ b/charger/keba-modbus.go @@ -244,14 +244,15 @@ func (wb *Keba) totalEnergy() (float64, error) { // currents implements the api.PhaseCurrents interface func (wb *Keba) currents() (float64, float64, float64, error) { - b, err := wb.conn.ReadHoldingRegisters(kebaRegCurrents, 6) - if err != nil { - return 0, 0, 0, err - } - var res [3]float64 - for i := 0; i < 3; i++ { - res[i] = float64(binary.BigEndian.Uint32(b[4*i:])) / 1e3 + for i := uint16(0); i < 3; i++ { + // does not support reading across register boundaries + b, err := wb.conn.ReadHoldingRegisters(kebaRegCurrents+2*i, 2) + if err != nil { + return 0, 0, 0, err + } + + res[i] = float64(binary.BigEndian.Uint32(b)) / 1e3 } return res[0], res[1], res[2], nil