Conditions¶
In event driven automation a condition determines if a rule fires (runs its action). Conditions are written in format that is similar to the conditionals format in Ansible playbooks:
event.status == "enabled"
Each condition will match one event. The condition much have a value with the event
prefix
to compare to other variables or values. The line above can be read as if you find an event
with status equal to “enabled” then run the action.
That event will be stored as a variable named event
for the action to access.
Conditions support the following operators:
==
- equality>
- greater than>=
- greater than or equal to<
- less than<=
- less than or equal toand
- true if both adjoining statements are trueor
- true if either adjoining statement is trueis defined
- true if a value is definedis not defined
- true if a value has been removed (does not exist)+
- add a value-
- subtract a value{{x}}
- variable substition for variablex