I am trying to make a notification piston for my driveway. I want the piston to activate the notification - "Driveway Alert"
each time the contact sensor is opened. But If that contact sensor was opened 4 times in the last minute the piston should send a different notification - "The drive is too Busy"
and stop sending all notifications after that for 15 minutes and then resume normal notification -"Driveway Alert"
Please Help with Notification piston
ehupp01
#1
bangali
#2
heres an example snippet … if you need an example piston let me know:
define
bool isBusy
integer count
datetime lastOpen
end define
if contact sensor changes to open
if isBusy
if lastOpen - now() > 15*60*1000
set isBusy = false
set count = 0
set lastOpen = now()
end if
end if
if now() - lastOpen < 1*60*1000
count = count + 1
end if
if count == 4
set isBusy = true
send notification the driveway is too busy
else
if count < 4
send notification driveway alert
end if
end if
set lastOpen = now()
end if
ehupp01
#3
Thank you so much!! That is perfect. I cant figure out how to translate that to a piston though. sorry I am a newb.