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 true
or 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:
Your solution is true if any trigger doesn’t have ‘ONLINE’ word in the state. But when I’ve changed ‘or’ to ‘and’ it’s working what’ I’m expected. Thank you very much!
My solution is:
condition:
- condition: template
value_template: >-
{{ not (trigger.from_state.state.count("ONLINE") and trigger.to_state.state.count("ONLINE")) }}