Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 106108

Filtering entity state in template

$
0
0

Hi, in a template is it possible to filter/exclude 2 states of an entity?

sensor:
- name: "Heating State"
      unique_id: "heating_state"
      icon: mdi:fire
      state: >
         {% if is_state_attr('climate.smarther_thermostat','hvac_action','idle') %}
           INACTIVE
         {% else %}
           ACTIVE
         {% endif %}

When the entity “climate.smarther_thermostat” becomes unavailable or unknown, the template returns the ACTIVE result.

Is it possible to ignore these 2 states in the template? Or alternatively, that the unknown/unavailable state returns INACTIVE instead of ACTIVE.

Thanks

4 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 106108

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>