How to get the hvac_action of several climate entities?

Welcome Patrick!

Paste the following code into Developer Tools —> Template and play with it:


{% set hot = states.climate
|selectattr('attributes.hvac_action', 'eq', 'heating')
|map(attribute='entity_id') |list |count |int(0) %}
{{ hot > 0 }}

2 Likes