I’m trying to create a piston to control integration between my Ring doorbell and my front lights. What I’m looking for is:
Turn on lights when doorbell rings between sunset and sunrise (ie front hall and porch lights)
Wait X minutes
Turn off lights ONLY IF front door has not opened since doorbell ring
So far I’ve got the piston set to turn on the lights when the doorbell rings (between sunset and sunrise), and turn off X minutes later, but I’m not sure how to add the condition to leave the lights on if the door has opened. The thought behind this is that if the front door has opened, then someone answered the door I don’t want to automatically turn the light off on them. Using a home/away mode could work, but I want the light to turn off if I’m home but didn’t answer the door.
To make it a bit more fancy, I’m thinking of adding another random wait time into the piston to delay the light turn on (so it’s not instant and seems more like someone is home).
One more step of fancy-ness is that eventually it will also be changed to utilize the light sensors throughout the house such that the light only comes on if it’s dark enough (based on specific threshold) as opposed to tying it to sunrise/sunset.
I don’t use webcore (prefer to write apps) but what I did for this was to use the close event of the door sensor…
I.e. If the door is open don’t switch off and then switch off 1 minute after closing the door
Yes - there is a sensor on the door. I’m hoping that setting the task cancelation policy (TCP) to “cancel on condition state change” will do the trick since I’ve put the front door being closed as a condition for the then statement to execute.
Will be able to test in a few hours and will post results.
Unfortunately the piston isn’t working entirely as intended - the light turns on and off no problem, but the TCP isn’t canceling the turn off portion when the front door is opened.
Am I misunderstanding what the “cancel on condition state change” does? I was under the impression that it would cancel pending tasks (ie, the delay and turn off part) if one of the initial conditions (ie, doorbell pushed and door closed) was no longer true?
I’m working on a custom app for this, but would really prefer to not have to delve into custom coding.
I would echo this… WebCoRE is much more capable then the original CoRE… I waited a while to switch my Pistons over to WebCoRE but am really glad I finally did as it is much easier to use than the original CoRE.
It took a couple of weeks but I’ve got everything ported over and have things running smoothly… (although I do find the occasional bug in my pistons).