From 1e14d2db2adfabbcffc890c6aca99ec16afb685d Mon Sep 17 00:00:00 2001 From: VolkerK62 <99199865+VolkerK62@users.noreply.github.com> Date: Sun, 9 Jul 2023 10:40:32 +0200 Subject: [PATCH] Fix minActiveVoltage (#8867) Reduce lower limit to >= 207V (230V-10%) --- core/loadpoint.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/loadpoint.go b/core/loadpoint.go index 1016ebb64..145f8a3af 100644 --- a/core/loadpoint.go +++ b/core/loadpoint.go @@ -50,7 +50,7 @@ const ( timerInactive = "inactive" minActiveCurrent = 1.0 // minimum current at which a phase is treated as active - minActiveVoltage = 208 // minimum voltage at which a phase is treated as active + minActiveVoltage = 207 // minimum voltage at which a phase is treated as active guardGracePeriod = 60 * time.Second // allow out of sync during this timespan phaseSwitchCommandTimeout = 30 * time.Second // do not sync charger enabled/disabled state during this timespan @@ -1261,15 +1261,15 @@ func (lp *Loadpoint) updateChargeVoltages() { lp.publish("chargeVoltages", chargeVoltages) // Quine-McCluskey for (¬L1∧L2∧¬L3) ∨ (L1∧L2∧¬L3) ∨ (¬L1∧¬L2∧L3) ∨ (L1∧¬L2∧L3) ∨ (¬L1∧L2∧L3) -> ¬L1 ∧ L3 ∨ L2 ∧ ¬L3 ∨ ¬L2 ∧ L3 - if !(u1 > minActiveVoltage) && (u3 > minActiveVoltage) || (u2 > minActiveVoltage) && !(u3 > minActiveVoltage) || !(u2 > minActiveVoltage) && (u3 > minActiveVoltage) { + if !(u1 >= minActiveVoltage) && (u3 >= minActiveVoltage) || (u2 >= minActiveVoltage) && !(u3 >= minActiveVoltage) || !(u2 >= minActiveVoltage) && (u3 >= minActiveVoltage) { lp.log.WARN.Printf("invalid phase wiring between charge meter and charger") } var phases int - if (u1 > minActiveVoltage) || (u2 > minActiveVoltage) || (u3 > minActiveVoltage) { + if (u1 >= minActiveVoltage) || (u2 >= minActiveVoltage) || (u3 >= minActiveVoltage) { phases = 3 } - if (u1 > minActiveVoltage) && (u2 < minActiveVoltage) && (u3 < minActiveVoltage) { + if (u1 >= minActiveVoltage) && (u2 < minActiveVoltage) && (u3 < minActiveVoltage) { phases = 1 }