How To Get Rule To Fire Once with Temp

@bertabcd1234, @JasonJoel, @bobbles, @andrewL, @aaiyar I am wondering if a new part to trigger could be added. "Do Not Repeat Trigger Once Triggered". Seems that would be a neat way to insure the trigger only fires once like in this instance.

None of us wrote Rule Machine. :laughing: @bravenel might be able to comment on whether he'd consider adding a feature like that. But the effect is nothing you can't already get yourself--Private Boolean is easy to use if you're only tracking one thing, or you could use a local variable for more (or a global if you want to keep things a bit cleaner and set it from another rule or have a need to use the value in multiple rules).

1 Like

That is why in these types of instances I use a virtual switch. It is either on or off and therefore will only trigger when the state of the switches turns on or off.

Lots of ways to skin that darned cat........ :wink:

1 Like

I didn't include his name because he never answers me anymore. I think he is still mad at me.

Where would I insert the virtual switch in the rule so it would keep it from re-triggering? Same place as Boolean? What is the advantage of one or the other?

The virtual switch essentially takes the place of the boolean. Where you set the boolean true, you'd set the switch "on" and where you set the boolean false, you'd set the switch "off". Then, you can trigger off of the switch state, which will only toggle when the temp threshold is crossed.

Personally I would have a very simple rule to turn the switch on and off.
TRIGGER
Temp sensor xxx CHANGED.
ACTION
IF
Temp sensor xxx is below 32.
THEN
Turn on Switch Virt temp below 32
ELSE
Turn off Switch Virt temp below 32
END-IF

Then for you rule
TRIGGER
Switch Virt temp below 32 changed.
ACTION
Switch Virt temp below 32 is ON
AND
The rest of your rule
You can now drop the PB.

This is just the way I like to do things.
It goes way back before variables were available and I have my head round it.
It also allows you to test things easily by just manually turning the virtual switch on and off.

I see the advantage to a virtual switch. Going to try that. Thanks

I am going to follow this and see if I can get mine to work. I was just wondering if 2 rules would work. Thanks

@bobbles Ok, here is what I have. Did I get close? Man that is easier to understand. Thanks

You need to put a trigger in for Mode Changed so that the light will turn off when it becomes day.
Looks much simpler though. :+1:

@bobbles Ok, I changed the trigger to this on the garage lights rule.

1 Like