I have multiple thermostats that each have an attribute that represents boost mode.
I’m trying to write something (automation and or a sensor) that will trigger/represent any thermostat if any is in boost mode.
The logic is simply, any thermostat in boost mode then turn on boiler.
however if there are now no thermostats in boost mode, and there isn’t a normal ‘call for heat’ then turn off the boiler.
i’ve tried to work with the following snippets that I found here and in the docs:
{% for tracker in expand('device_tracker.paulus', 'group.child_trackers') %}
{{ state_attr(tracker.entity_id, 'battery') }}
{%- if not loop.last %}, {% endif -%}
{% endfor %}
This seems to require me to create a group for all the thermostats, although climate services can take ‘all’ as the entity_id, i can’t seem to apply that here.
value_template: "{% for player in states.media_player if player.state == 'playing' %}true{% endfor %}"
In this example I don’t need to create a new group, and I have merged this logic with the previous example.
but i need consolidate the output of the function to either TRUE if any thermostat preset_mode == Full power, or FALSE none are preset_mode == Full power.
My scripting skill in this language/construct is really holding me back - quite frustrating. I don’t have a working example to put here, or rather not one that i’m not ashamed of… ah well, here it is anyway.
{% for trv in states.climate %}
{% if state_attr(trv.entity_id, 'preset_mode') == "Full power" %}
TRUE
{% else %}
FALSE
{% endif -%}
{% endfor %}
which outputs:
FALSE
FALSE
FALSE
FALSE
FALSE
TRUE
FALSE
FALSE
FALSE
FALSE
any pointers would be super helpful. Thanks