@km4lin wrote:
Hello,
from a few hours I’m trying to make the conditions which allows me to do this:
if trigger.from state and trigger.to_state doesnt’ have a word ‘ONLINE’ in state then it’s trueor the other way:
if trigger.from_state is ‘ONLINE’ and trigger.to_state is ‘BOOST ONLINE’ than it’s false
else if trigger.from_state is ‘BOOST ONLINE’ and trigger.to_state is ‘ONLINE’ than it’s false
else is true
for example:- condition: template value_template: >- {% if states('trigger.from_state') != "ONLINE" and states('trigger.to_state') != "BOOST ONLINE" %} true {% elif states('trigger.to_state') != "ONLINE" and states('trigger.from_state') != "BOOST ONLINE" %} true {% else %} false {% endif %}
but it doesn’t work as expected. Where I’m wrong?
Please help
Posts: 6
Participants: 3