Repository navigation
fix(heishamon): reset the offset only after FTW wrote one (0.8.1) - #235
Merged
Merged
Conversation
Default mode and cleanup always published safe_offset to Z1_Heat_Request_Temp. Core runs default mode at every start and on watchdog trips, so an owner who sets the offset from Home Assistant had it put back to 0 each time, even when FTW never commanded the pump. The driver now marks when FTW sends an offset and resets only then. A failed reset keeps the mark for the next default mode. No new setting. Closes #233 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Fredrik Ahlgren <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
frahlg
added a commit
to srcfl/ftw
that referenced
this pull request
Nov 17, 2026
…2036) srcfl/device-drivers#235 makes default mode and cleanup reset Z1_Heat_Request_Temp only after FTW wrote an offset. Core runs default mode at every start and on watchdog trips, so an offset set from Home Assistant went back to 0 each time (srcfl/device-drivers#233). The pin moves 1e4b5de7 to 940a9136; heishamon is the only driver that changes. The new test runs the driver through Core's own Lua host, whose mqtt_publish returns nothing on success. Signed-off-by: Fredrik Ahlgren <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #233.
Problem
driver_default_mode()anddriver_cleanup()always publishedsafe_offset(default 0) toset/Z1_Heat_Request_Temp. Core runs default mode at every start, on watchdog trips and on shutdown (go/internal/drivers/registry.go). An owner who sets the offset from Home Assistant had it put back to 0 each time, even on a site where FTW never commanded the pump. Reported by @Romaost on Discord, heishamon 0.8.0 on WH-SXC09H3E8.Change
driver_commandmarks that FTW sent an offset, before it publishes. A failed publish may still have reached the broker, and a needless reset is the old, safe behaviour.safe_offsetonly when the mark is set, then clear it. A failed reset keeps the mark, so the next default mode tries again.observe_onlywould do the job of Roma's proposedcontrol: false, but its config check requiresbattery_capacity_wh, so it does not fit a heat pump.make bump-driver.Known limit
After a Core crash the driver no longer knows FTW wrote, so that offset stays on the pump. Today only the operator's offset control on the heating card sends
set_heat_curve_offset; no planner does. So the value that stays is one the owner chose. Planned heat control will need the device-side lease from ADR 0012.Tests
drivers/tests/lua_harness/test_heishamon_offset_reset.lua: no write at startup default mode or cleanup before a command; one reset tosafe_offsetafter a command, then none; a rejected command arms nothing; a failed reset is retried.startup default mode overwrote an offset FTW never wrote) and passes on 0.8.1.make test-driver ID=heishamon: 40 passed, 14 skipped.make check: 5091 passed, 951 skipped.The shared mock's
host.mqtt_publishreturnstrue, while FTW's host returns nothing on success and an error string on failure. heishamon reads any return value as an error, so the new test records publishes the way the host does. The mock itself is unchanged here.Hardware
Not yet checked on hardware. @Romaost has offered to test on WH-SXC09H3E8: set an offset from HA, restart FTW, and the offset should stay.
Core picks this up when the pin in
drivers/BUNDLED_SOURCE.jsonmoves.🤖 Generated with Claude Code