Clarification on Greater Than/Less Than Triggers in RM 4.0


I have a question on the Triggers in Rule Machine 4.0. For a temperature related trigger, the text on the screen says "temp becomes" but it appears through testing, it will happen whenever the temp reading reading is above that point. So, a trigger set to >= 80 would happen if the temp was 81 and became 82. This is a little confusing as the text displayed under the trigger says "becomes".


With this very simple RM4.0 rule, it happens if the temp reading goes from 81 to 82 and if it goes from 82 to 83. It would be helpful if this trigger could be changed to allow a 1-time threshold trigger, as the name "becomes" implies. The other option would be an IS trigger. Temp of X IS >= would trigger for all temp readings greater than or equal to. BECOMES = 1 time. IS = Continuous. Just a thought.


Is it me or is it Rule Machine...battery level isn't doing what I expected


Today, I use a global variable and conditional statements to debounce.


Yeah, you can use PB too but it is a PITA. Especially when you have a rule with multiple trigger events and only the temp you want to happen once but the others you want to happen every time. It seems to me like there should be two options. Personally, I like the "becomes" vs "is" but some prefer "single" vs. "continuous" nomenclature. In the end...i'll take either as long as it works. :slight_smile:


That is a brilliant idea in my opinion.


These words are basically arbitrary stabs at what is going on. A comparison trigger like this is going to fire on every temperature report. Do not read more into the word "becomes". If you want to only trigger something when the temperature becomes 80 but not 81, then why not just use temp = 80, instead of temp >= 80? That will trigger every time the temperature becomes 80. temp >= 80 will trigger every time the temperature is greater than or equal to 80. Each one is going to take a look on every temperature report.


Because a trigger of temp = 80 will never fire if the temp jumps from 79 to 81. If you don't want to implement a single threshold change it can be implemented manually through a Boolean variable. I just figured it would be easier for folks to be able to do it by default through RM.


It's not so much that I "don't want to implement ..." as it is a major departure from the way a trigger event is defined. You'd be doing the same thing with PB as the code would have to do, without gutting RM's trigger definition.


That's fine. But I didn't say you should get rid of the current Trigger, just that it should be renamed. I was talking about adding an additional trigger that had the PB for the trigger event built in. Since the concept already exists in RM, didn't seem like to would be that hard to implement. But I understand.

The trouble with using PB is that there is only one per rule. If you have two triggers that you want handled like a threshold instead of continuous, you'd have to create a Boolean GV. Or, if you're already using PB to restrict the rule, then you're out of luck and have to use a GV. If the option was build in, it would save the trouble. But like I said, maybe I'm the only one.

However, I maintain that the wording is very deceiving. IMHO, it should be "is" and not "becomes". "Becomes" implies that it happens only once and not continuously. Hence my confusion.


Perhaps you could have a global variable last_temp that is set at the end of each run. So you could have a condition like

Temperature of Driveway Motion becomes >= 80 AND last_temp < 80

which will run if last_temp = 79 and current temp = 81 but not when last_temp = 81 and current temp = 82.

Hope this helps.


It's a lot simpler than that. You just need a Boolean variable that trips false when above and true when below the threshold.