From 7e18c9bf97d7b0443bc9987a588ff5169820f792 Mon Sep 17 00:00:00 2001 From: Daniel Sadilek Date: Tue, 4 Aug 2026 09:30:18 +0200 Subject: [PATCH 1/2] Report the standby state that Init() actually wrote Init() writes register 258 to configure standby, but it did not record what it wrote. mStandbyEnabled therefore kept its header default of true while the register held the opposite, since AllowStandby is false. GetStandbyEnabled() reads the register on every publish and corrects the flag, so the mismatch normally lasts less than a publish cycle and is invisible. It stops being invisible when reads fail: the getter then falls back to the flag and returns the stale default, so the Standby Mode entity reports enabled while the wallbox has standby suppressed. That is the state described in the second half of issue #72, alongside the plug state reading "disconnected" for the same reason. The underlying cause there was the Lilygo RTS pin, fixed in 4.0.1; this only stops one of its symptoms from misreporting. Init() now stores the value it wrote, on success only. The transition check in SetStandbyEnabled is deliberately left alone. It is safe because GetStandbyEnabled() keeps the flag in sync with the register on every publish, and because a failed write leaves the flag unchanged, so repeating the command still writes. --- src/Components/Wallbox/HeidelbergWallbox.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Components/Wallbox/HeidelbergWallbox.cpp b/src/Components/Wallbox/HeidelbergWallbox.cpp index c1bcf7b..b87b878 100644 --- a/src/Components/Wallbox/HeidelbergWallbox.cpp +++ b/src/Components/Wallbox/HeidelbergWallbox.cpp @@ -28,6 +28,12 @@ void HeidelbergWallbox::Init() // Error writing modbus register Logger::Error("ERROR: Could not configure standby"); } + else + { + // Remember what was just written, so the reported state matches the + // register even if reads later fail. + mStandbyEnabled = Constants::HeidelbergWallbox::AllowStandby; + } // Disable watchdog Logger::Debug("Heidelberg wallbox: Setting watch dog timeout to %d s", Constants::HeidelbergWallbox::WatchdogTimeoutS); From c8aeb920092d48cdd4daa92b0016a5c45825fefa Mon Sep 17 00:00:00 2001 From: "Brock, Boris" Date: Tue, 4 Aug 2026 10:41:37 +0200 Subject: [PATCH 2/2] Reformatting --- src/Components/Wallbox/HeidelbergWallbox.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Components/Wallbox/HeidelbergWallbox.cpp b/src/Components/Wallbox/HeidelbergWallbox.cpp index b87b878..39f1098 100644 --- a/src/Components/Wallbox/HeidelbergWallbox.cpp +++ b/src/Components/Wallbox/HeidelbergWallbox.cpp @@ -30,8 +30,7 @@ void HeidelbergWallbox::Init() } else { - // Remember what was just written, so the reported state matches the - // register even if reads later fail. + // Remember what was just written, so the reported state matches the register even if reads later fail. mStandbyEnabled = Constants::HeidelbergWallbox::AllowStandby; }