I have a piston using "stays greater than". How do i do something only once after it's no longer greater than?


#1

This isn’t a problem. It’s just a question. Am I posting in the wrong forum? Anyway…

I use “stays greater than” for a freezer using too much power for too long. If this happens, i push an alert. What I’d like to have happen is for it to send another alert when it’s back to normal. I could do this with a tracking variable, but i’m wondering if something is built in to trigger an action when a “stays greater than” condition returns to false.

Kind of a pseudocode is below.

If power level stays greater than 50W, then alert me that there’s an issue. Once it returns to a normal power level, send me another alert saying that things are back to normal.

Does this make sense? Is this possible with some built in mechanism, or will I need to do it manually with a state tracking var?

thx.


#2

I would just add a new block to the bottom.

IF power level drops below 25W (or whatever)
    Then send alert "Freezer back to normal"
END IF

#3

I’d suggest using a second piston only to monitor the power.
Just like you wrote. But as a second piston.


#4

I agree with Ike, with one addendum.

If you already have a piston with a trigger based on freezer power, do not make another one! When it comes to triggers based on power, any device (like your freezer) should have all power triggers in the same piston.

Power changes so often, you do not want two pistons firing at each event.


To say this another way:

“Power” triggers are ideally kept separate from other (non-power) triggers.
… but two power triggers for the same device should be in the same piston.


#5

This isn’t something I had considered, but that’s definitely something to keep in mind!

Semi-related: do you know if it’s possible to reduce the number of times the outlet(s) are sending power updates through the hub?


#6

I am a bit tied up at the moment, but a quick answer:

Power fluctuates… a lot. (often dozens of times each second)

Whether it is reported to the hub or not, depends on the hardware…
(although sometimes it can be “mellowed out” a bit via software)

In reference to hardware:
Sensitive devices tend to send more notifications to the hub
El-cheapo outlets often report poorly, or less frequiently

In reference to software:
Sometimes, the maker of the outlet has proprietary software, that lets you tweak these numbers…


#7

Thanks, two of mine are samsung branded, but I’ll take another look and see if I find some info about that. Thanks.


#8

Dig thru the options. It may already be there, buried in some obscure menu, LOL