phoenix-em-eth: fix meter detection (#10799)

This commit is contained in:
mletenay 2023-11-16 11:54:48 +01:00 • committed by GitHub
parent bc8e3a451e
commit 81518caaae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,7 +56,7 @@ func NewPhoenixEMEthFromConfig(other map[string]interface{}) (api.Charger, error
)
// check presence of meter by voltage on l1
if b, err := wb.conn.ReadInputRegisters(phxEMEthRegVoltages, 2); err == nil && encoding.Uint32LswFirst(b) > 0 {
if b, err := wb.conn.ReadInputRegisters(phxEMEthRegVoltages, 2); err == nil && encoding.Int32LswFirst(b) > 0 {
currentPower = wb.currentPower
totalEnergy = wb.totalEnergy
currents = wb.currents