@temp said in Execute a rule by another rule:
I searched the forum but didn’t find it.Can I execute a rule by another rule?
It is not possible as you might expect but there are some work-arounds:
- You can execute a rule using the pimatic API implicitly by activating it, e.g. using pimatic shell execute. - https://forum.pimatic.org/topic/310/execute-rule-through-api
- You can use some guard variable as part of the of the rule condition to fire the rule. I think the easiest way of achieving that is to use a DummySwitch. See example below:
# Setup a a DummySwitch with id "guard-1"
# The guarded rule
WHEN state of guard-1 changes THEN ...
# The trigger rule
WHEN .... THEN toggle guard-1