I have a Piston that works to turn on the Garage Lights and one other light when either my wife or my phone “arrives”. What I’m trying to add is if it’s after sunset when we arrive, I’d like two additional lights to turn on. Would appreciate some help with my Piston. Thanks!
Need help with turning lights on with presence
Instead of $sunset, use between Sunset and Sunrise (without the dolar sign :))
And question : is your WAIT working? meaning, is your piston waiting 15 minutes? Because I don’t see the letter N - Never cancel task policy indication.
Here is a slightly different draft (because if your piston waits 15 minutes and it’s after sunset, you’ll need to wait 15 minutes before the aditional lights turn on.)
IF presense sensor 1 or 2 changes to present
then
IF time is between sunset and sunrise
Light bulb 2, 3
DO turn ON
Then
With (NEVER CANCEL TASK)
Switch 12 and 4
Do turn ON
Wait 15 minutes
Do turn OF
I put the wait as a second block.
Having said that, every now and then you will have problems with this piston.
a) Presence sensors do not register present accurrately, every now and they they will be late.
b) Lets say you both came home together your wife’s sensor registered fast, and piston got executed.
Yours registered a minute later, piston will be executed again and your countdown will start again.
(not a major problem ofcourse, I’m just explaining how pain in the butt working with multiple presence sensors are.
Let us know how my draft works.
Thanks @ike2018, I appreciate you taking the time to reply and offer a suggestion. I’ll edit the Piston using your suggestions and see how it works. To answer your question about the WAIT, yes it’s working. Those two lights turn on with presence and then 15 minutes later turn off… reliably. I’ll let you know how it works out, thanks again!
Nope,
Right now it will ONLY work between sunset and sunrise because light bulbs, 2 and 3 are in the TIME FRAME IF block,
take that WITH line 28
and move within the first IF block (I believe after line 34)
It should visually look something like this. (the allignments im talking about)
IF Presence sensor bla bla bla
IF time is between this and that
Do this and that
With Bulb 2 and 3
Do this and that
End execute
Looks like your verison would work too (I guess)
But if you add more stuff into this piston later on, your latest version would start causing problems.
In your version the WITH is outside of the presence sensor IF block, that means if this piston is executed by any other means, your lights would go ON, presence sensors are present or not.
You are so welcome.
It’s my pleasure when I can help a fellow smart home system owner.
Any time.