OK, thanks! I will try to play with this on the weekend.
I cant seem to find cancel on truth change in a triggered rule with IF/ELSE statements. Is that by design?
Also, I was looking at global variables, and @bravenel this produces an error. Selecting variable. I'm not sure why you would want to set a variable from another variable, but I was looking at all the options.
Cancel on truth change only applies to Rules, not to triggered rule.
Could you provide more information, such as a log screenshot. When is this error thrown?
Had to laugh...used to have a rule very similar to this for my daughter when she kept turning up her light at night...ironically I just recently removed it as she never even tries anymore...plus is old enough to not care or want to.
Was there ever a time when cancel on truth change was applicable for a triggered rule, because I have a rule in RM2.5 that has the option. But going into that rule just now, there is no option to either select or change cancel on truth change. Could this rule have started life as a rule, and then used the option to convert to triggered rule?
Error is thrown when selecting "variable" in the image in that post. I was just playing around. The rule type in question was "action" if that's relevant. The Global variable type is a number that has been set.
Edit @bravenel. Did you see this?
The choice was there, but it wasn't supposed to be. So, the choice was removed. It would not have functioned if selected.
Any chance you might put it back?? After all, a triggered rule is still a rule, isn't it?
I've wanted to use it myself several times.
The reason it can't be a feature of a triggered rule is that the condition is only tested at the time of the event (trigger) so there is no condition change to monitor.
I suppose it could be monitored (the condition), just like a rule. There is a condition that is evaluated in a triggered rule, and that could be monitored for truth change.
No it can't that's the difference between a rule and a trigger rule. Like @halfrican.ak said triggers only get evaluated at the point of the trigger so the conditions don't get monitored full stop, there for when the condition changes nothing would/could happen. If you want that functionality then it needs to be a rule because that monitors the conditions.
I just converted over my rules from 2.5 to 3.0, and I wanted to give kudos to the Hubitat team. 3.0 is excellent. Things that used to take multiple rules and were hard to understand are now straightforward in a single rule. Very good work.
If I'm understanding this correctly, the simplest way to get a triggered rule with 'cancel on truth change' might be to have a separate RM trigger that RUNS a separate RM rule.
Thus, nothing happens until the RM trigger is triggered and the RM rule can check it's truth change (which may or may not have any connection with the truth that originally triggered it all) when ever it wants.
Except, nothing would stop the other RM rule from running when it's Conditions have events.
My guess is that one needs to rethink the rule design, wrt Triggered Rule vs Rule, if cancel a delay is needed.
Good point. Seemed like a good idea at the time.
Guess I'm back to IF... THEN stop this rule.
Thanks for the quick response.
You must spend ALL your time reading this forum.
It doesn't make sense to put it back. Triggered rules evaluate when the trigger is true and then take the true path or false path depending on the conditions. They don't evaluate (subscribe) to the conditions. You are describing a non-triggered rule and you can cancel on truth change in those because they are actually watching the conditions.
The fact is that cancel on truth change was never supported for Triggered Rules (because of the reasons stated above -- it doesn't make sense). But, for quite some time there was a bug where selecting it was allowed when it should not have been.
So, being new to Hubitat, what I'm getting from this discussion is that triggered rules are edge sensitive, and (regular? non-triggered?) rules are level sensitive. Those are long used terms related to electronic logic circuits.
IOW, triggered rules are only evaluated/run when the condition changes. Regular rules are constantly evaluated.
So, if I have rules based on the state of a switch (on/off) which increments the level of a light by 1, a triggered rule would only increase the level once for each time the switch is turned on. A regular rule would keep looping, increasing the level as long as the switch is on.
Is that essentially right?