Daheimladen: fix phase values (#21907)

This commit is contained in:
andig 2025-06-18 16:13:02 +02:00 • committed by GitHub
parent c3ca633f44
commit 30925be560
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -38,7 +38,7 @@ type DaheimLadenMB struct {
const (
dlRegChargingState = 0 // Uint16 RO ENUM
dlRegConnectorState = 2 // Uint16 RO ENUM
dlRegCurrents = 5 // 3xUint32 RO 0.1A
dlRegCurrents = 6 // 3xUint16 plus placeholder RO 0.1A
dlRegActivePower = 12 // Uint32 RO 1W
dlRegTotalEnergy = 28 // Uint32 RO 0.1KWh
dlRegEvseMaxCurrent = 32 // Uint16 RO 0.1A
@ -51,7 +51,7 @@ const (
dlRegCurrentLimit = 91 // Uint16 WR 0.1A
dlRegChargeControl = 93 // Uint16 WR ENUM
dlRegChargeCmd = 95 // Uint16 WR ENUM
dlRegVoltages = 108 // 3xUint32 RO 0.1V
dlRegVoltages = 109 // 3xUint16 plus placeholder RO 0.1V
// PRO only
dlRegPhaseSwitchState = 184
@ -254,7 +254,8 @@ func (wb *DaheimLadenMB) getPhaseValues(reg uint16) (float64, float64, float64,
var res [3]float64
for i := range res {
res[i] = float64(binary.BigEndian.Uint32(b[4*i:])) / 10
// 16-bit registers for currents/voltages spaced by 1 empty register
res[i] = float64(binary.BigEndian.Uint16(b[4*i:])) / 10
}
return res[0], res[1], res[2], nil