From 3423c18e8efdd84ad4cab9580efcce012a2fe0a6 Mon Sep 17 00:00:00 2001 From: ESPHome Device Builder Date: Fri, 12 Jun 2026 17:37:07 +1200 Subject: [PATCH] Edit esp-gasheater.yaml --- esphome/esp-gasheater.yaml | 58 ++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/esphome/esp-gasheater.yaml b/esphome/esp-gasheater.yaml index adad201..7618a12 100644 --- a/esphome/esp-gasheater.yaml +++ b/esphome/esp-gasheater.yaml @@ -432,33 +432,37 @@ binary_sensor: if (!id(test_mode_enabled).state && id(mode_select).state == "AUTO") { id(warmup_until_ms) = millis() + (${warmup_seconds} * 1000UL); } - - choose: - # OFF mode watches for local physical heater starts. - # If someone presses the real heater ON button, the LEDs come on, this - # powered_state turns ON, and ESPHome changes to AUTO and takes over. - - conditions: - - lambda: 'return !id(test_mode_enabled).state && id(mode_select).state == "OFF" && !id(self_power_on);' - sequence: - - script.execute: local_on_takeover - - # In AUTO/MANUAL, if the controller intended the heater OFF but LEDs say ON, - # force the heater OFF. OFF is excluded because OFF performs local-start takeover. - - conditions: - - lambda: 'return !id(test_mode_enabled).state && id(mode_select).state != "BYPASS (Remote Only)" && id(mode_select).state != "OFF" && !id(power_intended_on) && !id(self_power_on);' - sequence: - - script.execute: enforce_heater_off - - # If the heater turns on externally while AUTO already intended it ON, - # re-baseline after warmup and continue normal automatic control. - - conditions: - - lambda: 'return !id(test_mode_enabled).state && id(mode_select).state == "AUTO" && id(power_intended_on) && !id(self_power_on);' - sequence: - - lambda: |- - id(ramp_until_ms) = millis() + (${fast_ramp_seconds} * 1000UL); - - delay: ${warmup_seconds}s - - script.execute: calibrate_to_min - - script.execute: auto_control_tick - - script.execute: adjust_to_desired + # ESPHome does not support Home Assistant's `choose:` action here, + # so this is written as nested if/else logic. + - if: + condition: + # OFF mode watches for local physical heater starts. + # If someone presses the real heater ON button, the LEDs come on, this + # powered_state turns ON, and ESPHome changes to AUTO and takes over. + lambda: 'return !id(test_mode_enabled).state && id(mode_select).state == "OFF" && !id(self_power_on);' + then: + - script.execute: local_on_takeover + else: + - if: + condition: + # In AUTO/MANUAL, if the controller intended the heater OFF but LEDs say ON, + # force the heater OFF. OFF is excluded because OFF performs local-start takeover. + lambda: 'return !id(test_mode_enabled).state && id(mode_select).state != "BYPASS (Remote Only)" && id(mode_select).state != "OFF" && !id(power_intended_on) && !id(self_power_on);' + then: + - script.execute: enforce_heater_off + else: + - if: + condition: + # If the heater turns on externally while AUTO already intended it ON, + # re-baseline after warmup and continue normal automatic control. + lambda: 'return !id(test_mode_enabled).state && id(mode_select).state == "AUTO" && id(power_intended_on) && !id(self_power_on);' + then: + - lambda: |- + id(ramp_until_ms) = millis() + (${fast_ramp_seconds} * 1000UL); + - delay: ${warmup_seconds}s + - script.execute: calibrate_to_min + - script.execute: auto_control_tick + - script.execute: adjust_to_desired on_release: - lambda: |-