Just wondering if someone wil be able to help we out with the below. I am trying to create a template which will tell me when all the of my stats are in an off state. This is my first time doing a template so not really sure what i’m at. When I enter the below in the template in developer tools it works but not when I put into my configuration.yaml.
# Determine when all upstair stats are off #
binary_sensor:
- platform: template
sensors:
underfloor_stats_off:
value_template: >-
{% if is_state ('climate.wardrobe_stat' , 'off') and is_state ('climate.upstairs_hall_stat', 'off') and is_state ('climate.master_bathroom_stat', 'off') and is_state ('climate.main_bathroom_stat', 'off') and is_state ('climate.hot_press_stat', 'off') %}
Yes
{% else %}
No
{% endif %}
I need to use the hvac_action attribute to see when it shows heating instead of the state as I need to know when the stats are in idle or off mode. With the state attribute when in idle it still shows heat. I have tried the below but it just gives me a date back. Sorry about this still learning. Any help would be great.
# Determine when all upstair stats are off #
binary_sensor:
- platform: template
sensors:
underfloor_stats_off:
value_template: >-
{{ expand('climate.wardrobe_stat' , 'climate.upstairs_hall_stat', 'climate.master_bathroom_stat', 'climate.main_bathroom_stat', 'climate.hot_press_stat')
| selectattr('attributes.hvac_action', 'eq', 'heating') | list | count == 5 }}
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.