Hi, this template worked, but when I turned it in to blueprint the result is off when all switches are off or unavailable when they are on.
Please help.
That’s going to return a sequence of zero or more trues, which will evaluate to false for zero, true for one and unavailable for more than one. I can have a guess what you’re probably trying to achieve, but please describe what you want.
As a first guess, sorting out the issues of loop scope and switch referencing, and assuming your timing code is correct:
state: >
{% set ns = namespace(out=false) %}
{% for switch in switches %}
{% if (is_state(switch, 'on') and (int(as_timestamp(now()) - as_timestamp(states[switch].last_changed)) > int(states(timeout)) * 36)) %}
{% set ns.out = true %}
{% endif %}
{% endfor %}
{{ ns.out }}