Skip to content

Check whether heater needs to be turned off be because all valves are closed.#160

Merged
Alexwijn merged 1 commit intoAlexwijn:developfrom
pvginkel:force-valves-closed
Feb 28, 2026
Merged

Check whether heater needs to be turned off be because all valves are closed.#160
Alexwijn merged 1 commit intoAlexwijn:developfrom
pvginkel:force-valves-closed

Conversation

@pvginkel
Copy link
Contributor

@pvginkel pvginkel commented Feb 10, 2026

If all valves close while the heater state is on, the heater state wasn't turned off. The valve check has been moved up and the heater state is forced off, if all valves are closed while SAT decides it should heat.

My setup is as follows:

  • 9 rooms with all of them a generic_thermostat helper, temperature sensor and underfloor heating valve switch:
    • 8 rooms are configured with a cold tolerance and warm tolerance of 0
    • 1 room is the "cold" room of the house and looses a lot of heat. The boiler can't heat that room when the error is low, and PWM isn't always kicking in. I've set the cold tolerance for this room to 0.3.
  • Sonoff SNZB-02D thermometers. Yes, it's very clear these do not suffice. The Xiaomi's are in the mail.
  • DIYless controller with ESPHome.
  • SAT configuration is as follows:
    • Setup:
      • Indoor temperature sensor: living room
      • Outdoor temperature sensor: WeerLive (a “real” sensor is in the mail)
      • Humidity sensor: living room
      • System: UFH
      • Area:
        • Primary: living room
        • Rooms: the 8 remaining thermostats
      • Overshoot value: 17.1
    • Settings:
      • General:
        • PID: Adaptive Controller
        • Minimum setpoint: Return Temperature
        • Mode: Comfort
        • Max setpoint: 50
        • Coefficient: 3.5
        • Minimum adjustment factor: 0.2
        • No contact sensors
      • Presets: default
      • System configuration:
        • Everything default except for Duty Cycles: set to normal (3x per hour); I had a lot of short cycling, but that was fixed by setting dynamic minimal setpoint
      • Advanced:
        • Dynamic minimal setpoint: enabled
        • The rest is at default I think

I've implemented this fix locally and it kicked in 4 times over the past day and suppressed heating for 2.5 hours in total. The primary cause seems to be the cold room I mentioned. The generic_thermostat for that room has a cold tolerance of 0.3. However, it is including the error of that room in its calculations regardless of the generic_thermostat state. Arguably the correct fix is to change that. I may still do this for my own setup and upstream those changes, but that doesn't negate the need for this fix. The boiler should never be turned off if all valves are closed.

Summary by CodeRabbit

Bug Fixes

  • Improved heater state management – Enhanced heater behavior when valves are not open. The system now properly logs and prevents heater activation in incompatible conditions, preventing potential operational issues.

… closed.

If all valves close while the heater state is on, the heater state wasn't turned off. The valve check has been moved up and the heater state is forced off, if all valves are closed while SAT decides it should heat.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 10, 2026

Walkthrough

The climate component's heater state-handling logic is enhanced to check valve status before activation. When turning ON, if valves are closed, the system either turns off an active heater or prevents activation. If valves are open, previous behavior is preserved.

Changes

Cohort / File(s) Summary
Heater state management
custom_components/sat/climate.py
Enhanced ON state logic to conditionally activate/deactivate heater based on valve open status and current heater state.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and specifically describes the main change: checking whether the heater needs to be turned off because all valves are closed, which is the core logic modification in the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Alexwijn
Copy link
Owner

Thanks!

@Alexwijn Alexwijn merged commit 213937c into Alexwijn:develop Feb 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants