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

How do you use a variable in a template checking states?

$
0
0

I’m trying to change the color of the icon when the input_boolean is changed using a variable. I know how to do it without using a variable, but trying to learn with variables. I’m sure it’s some simple syntax error.

{% set away = states('input_boolean.away') %}
{% if is_state('away',  'on' %}
 green
{% endif %}

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 106772

Trending Articles



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