How To Get Rule To Fire Once with Temp

Actually, the wording on triggers can be confusing, but a trigger of "Temperature < 32" will fire any time any temperature reading comes in and is < 32, even if it is not the first. For example, consecutive reports of 31 to 30 will match that trigger both times. Here's an example rule you can use to test that:

image

and the output you'd get (I left trigger and action logging enabled for maximum clarity, but if you're doing it on your own, the log action in the rule actions alone should be enough to see) when that sensor goes from 33 to 32 to 31 to 30:

image

What I would do to catch only one reading below 32 is the Private Boolean trick as suggested in the docs for other uses (and as attempted above, but you need to set it back to True when the temperature goes above that again, something you can't do if your only trigger is <32). The general format of that (you'd have to add in whatever you want to do here instead of my log action) would be something like:

Trigger: Temperature *changes*

Actions:

IF (Temperature < 32) THEN
  IF (Private Boolean is True) THEN
    Log: "This is the first time it's below 32"
    Set Private Boolean False
  END-IF
ELSE
  Set Private Boolean True
END-IF

You'll still have the issue that the "ELSE" (where PB is set back to True here) will run every time the temperature reads above 32, but I'm not sure exactly what you're trying to do or if that would be problematic for you. If so, you could create a similar rule that also triggers on temperature changes but checks for the reverse and tracks the threshold with PB in a similar manner.

1 Like