From 7320e7305977063a6dae72b8cc2092c7d6f74e21 Mon Sep 17 00:00:00 2001 From: andig Date: Tue, 2 Jan 2024 15:47:14 +0100 Subject: [PATCH] OpenWB 2: fix negative phase readings --- charger/openwb-2.0.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charger/openwb-2.0.go b/charger/openwb-2.0.go index 8e96d6df5b..224d5aa0cf 100644 --- a/charger/openwb-2.0.go +++ b/charger/openwb-2.0.go @@ -182,7 +182,7 @@ func (wb *OpenWB20) getPhaseValues(reg uint16) (float64, float64, float64, error var res [3]float64 for i := range res { - res[i] = float64(binary.BigEndian.Uint16(b[2*i:])) / 100 + res[i] = float64(int16(binary.BigEndian.Uint16(b[2*i:]))) / 100 } return res[0], res[1], res[2], nil