Hi,
I need a template or state condition (in a script) that will test if any of the lights in a list is off. The list is supplied as a variable lights
which may contain one or more lights.
Say I supply something like
variables:
lights:
- light.one
- light.two
Then I would to condition the script to run only if all the lights are off. So I need something like
condition: "{{is_state(lights,'off'}}"
that will work with a list of one or more lights. I can use some kind for
loop, but how do I combine the True/Falses I get as output?
I tried something like the below, but it doesn’t work, even though it doesn’t give a syntax error:
conditions:>
{% for l in light %}
- {{is_state(l,'on')}}
{%-endfor %}
Thanks for any help!