I’am brand new user of HA (just a couple of days experience) On raspi 3B .
After succesfully setting up zigbee buttons / switchs / thermostat, etc, I made my firsts automations without too much problem, but I stuck on the following:
I have a zigbee thermostat controling house heating, and i would like to add a switch working in parallel with the heater (switch on when heating, switch off otherwise ).
First off, please format your YAML properly in the forum, it’s very difficult to read what you have pasted. See item 11 in this post:
Second, your automation will likely be based on the hvac_mode as it’s the attribute that indicates if you are off, cooling, heating, etc. So your trigger will be something like this:
platform: state
entity_id:
- climate.the_name_of_your_climate_entity
attribute: hvac_action
from: idle
to: heating
Unfortunatly, I already tryed this . As what i have read somewhere, hvac_mode_changed indicate if the unit is in cooling /heating/ ventilation… mode, but not reflect if it is currently ON or OFF so no triggering .
In my case, the thermostat is TS0601 _TZE204_lzriup1j .
description: ""
trigger:
- platform: state
entity_id:
- climate.0xa4c138fcb49b0e00
attribute: hvac_action
from: idle
to: "on"
condition: []
action:
- service: switch.turn_on
metadata: {}
data: {}
target:
device_id: 2c4bc071d2e387fbc86b9c7f9722ddd5
mode: single
After a lot of try, i found a working way (I post it here, in case it can help someone):
alias: thermostat on
description: ""
trigger:
- platform: state
entity_id:
- climate.0xa4c138fcb49b0e00
attribute: running_state
to: heat
from: idle
condition: []
action:
- service: switch.turn_on
metadata: {}
data: {}
target:
device_id: 2c4bc071d2e387fbc86b9c7f9722ddd5
mode: single