Closed muxa closed 4 years ago
Correct you need to manually tell the climate device of the switch update (it doesn't deduce what is triggered from the heat_/idle_action
).
You should make the switch internal and use the climate device as the only way to switch the heater on/off. Alternatively you can add a second template switch that itself controls the climate device with climate.control
I managed to get it working by handling heater
switch actions and synchronising thermostat state to it:
on_turn_on:
- lambda: |-
if (id(gas_thermostat).action != CLIMATE_ACTION_HEATING) {
// not HEATING, thus either OFF or AUTO, but action is IDLE
// this means that heater was manually switched on by its power button.
// force HEAT mode
auto thermostat = id(gas_thermostat);
thermostat->mode = CLIMATE_MODE_HEAT;
thermostat->action = CLIMATE_ACTION_HEATING;
thermostat->publish_state();
}
on_turn_off:
- lambda: |-
if (id(gas_thermostat).action != CLIMATE_ACTION_OFF) {
// not OFF, thus either HEATING or AUTO, but action is HEATING
// this means that heater was manually switched off by its power button.
// force OFF mode
auto thermostat = id(gas_thermostat);
thermostat->mode = CLIMATE_MODE_OFF;
thermostat->action = CLIMATE_ACTION_OFF;
thermostat->publish_state();
}
Operating environment/Installation: Home Assistant via Docker
ESP8266: Wemos D1 Mini
ESPHome version (latest production, beta, dev branch) 1.14.5
Affected component: Bang Band Climate
Description of problem: I have a Bang Band Climate component which is linked to a Template Switch. When Template Switch changes state it does not update Climate actions.
E.g. When in Auto mode and heating and action is showing Heating, as expected. However then Switch is turned off, the action remains as Heating.
Template Switch controls a momentary power button on a heater, and there's a sensor to detect if the heater is on or off. This allows to still use the heater power button and HASS in parallel.
Problem-relevant YAML-configuration entries:
Logs (if applicable): This is when the switch is off:
Additional information and things you've tried:
Do I need to manually update Action of the climate control when the switch toggles? I could not find documentation how to do that.