How this piston work


#1

Hi All,
I created a simple piston that send me notification if the system is not at night mode on certain time .
It’s working ok but I would like to understand how webcore works on this simple piston as
currently I get notification on time and then after a while (Not sure if it’s consistent)
I would like also to send notification every 1 hour if the condition is true.

Thanks


#2

You have no triggers in this pistons, so both of your conditions become triggers. (lightning bolts in the left margin) This means that anytime your SHM status changes to anything, the entire piston runs top to bottom, and if line 19 & 21 match, then you will get notified again.


#3

Got it Thanks .
So if I want to run those checks every hour
should I add while loop with sleep ? timer ?
What is the best practice here ?


#4

I usually wrap the entire piston in a Timer… Something like this:

temp


#5

Great ! Thanks for that