Trying to repeat an action if the condition is true. Where did Cancel on Truth Change go on 2.10?
Is it a triggered rule?
Don't think you can cancel on truth change in a triggered rule.
DUH?!?!?!?!!?
Thank you!
Let me ask this question regarding a triggered rule.
Say I want an action to repeat when I turn on a switch and I want the repeat to continue until I turn off the switch. What is the easiest way to accomplish this in a single rule
Is this what you mean.
TRIGGER
Light x turns on.
CONDITION
Light x is on.
RULE
Light x is on.
ACTIONS FOR TRUE
IF (light x is on) THEN
REPEAT EVERY X minutes/hours etc. (cancel on truth change)
Do your actions
ENDIF
So that's the exact triggered rule I created above and I can't get CANCEL ON TRUTH CHANGE TO APPEAR.
Your repeat is at the end.
If you look at mine below, this one repeats every hour if the garage door is open. I t starts after a delay of 1 hour.
Just ignore the delay for your use case.
Your IF should show the light as on.
Made the repeat the first action of 'TRUTH' condition --> no repeat available.
Made the repeat the first action of the 'TRUTH' condition if Mode = day -->. No repeat available.
I should note that I have a separate rule that does nearly the same thing (I created prior to 2.10.) and repeat is there.
Maybe its because you are using a trigger.
Here is a rule I have that turns lights on and off when I'm away.
It uses conditions.
Perhaps you can do something with this example.
Cancel on Truth Change only works for Rules, not Triggered Rules. What fires a Rule to do something is a change of rule truth. What fires a Triggered Rule to do something is a trigger event. For this reason, Cancel on Truth Change doesn't really work for a Triggered Rule, so it isn't offered in the UI.
Unless you are wanting your rule to run even when there is no truth change, it really could just be a Rule.
I've noticed lots of users using Triggered Rules when a Rule would work just fine.
So I have to ask... what's the best use case for trigger versus condition. In answering my own question, it would appear that trigger would only be useful for things like motion where you would want an action based upon the happening of an event, rather than the state of the event.
No, you're missing the whole point. Conditions only change state because of events. So a Rule is every bit as much event driven as a Trigger. When you have a Rule based on motion, for example, that condition is going to be tested on every motion event, active and inactive. The rule is going to fire Actions for True or Actions for False if motion is the only condition. So a Rule is just like a Trigger on motion active, especially if it only has Actions for True.
The only reason to put this into a Triggered Rule would be to overcome the fact that a Rule only acts upon truth change, i.e., state change of the condition.
Or if the action causes the rule to re evaluate and you get stuck in a loop. Then a triggered rule gets over that because it only evaluates when the trigger happens.
In reference to "cancel on truth change" this is possible in a triggered rule with repeating but only if you use a simple conditional action. I have this set up in one of my rules and when I turn off the switch the rule stops repeating.