So I hope someone can help me out with this… I’ve got a piston that I want to have turn on my porch light on whenever it’s after sunset and before sunrise and triggered by my SmartThings arrival sensor & iPhone being present, but I’ve noticed that they both are always show they are falsely coming or going causing the porch light switches on & off. It’s generally only on for about a half hour to an hour, but still wastes electricity plus by now I think my neighbors must be wondering what the hell im doing.
Is there a more reliable way to do this? Can I put another condition in that will present this from happening? Thanks!
Post a picture of your piston so we can check it out. What I do in this situation is add a variable that would indicate that light has been turned on previously and include that as a condition. When it’s time to turn off the light, then add a task that will reset that variable to false.
I’m going to try that, but as for it making sense - not really. I’ve been wondering how to use variables for a while now and tried once before with no success.
On a side note, can you set a variable to save the on/off state and level of a dimmable light so I can have a level increase to 100% flashing multiple times when a contact sensor status changes, but afterwards have the light return to whatever brightness it was at before the piston ran? Not see if that makes sense or not.
You can use the Save attribute to variable tasks for that. Make sure to add a Wait of about 2 seconds before you perform any other task on the light/dimmer to give it time to save the variable. To restore the settings, use Load attribute from variable
One more thing - do you know if there’s a way to duplicate pistons to copy what I’ve already done and still have something there in case this won’t work?
Ok so I went back in to add another condition, chose variable then Boolean but don’t see one that’s says lighton. All these start with $ before the words and none have lighton listed. Am I in the wrong area?
That looks like it should work. Just to explain the the use of the variable lightOn. This will prevent the light from turning on again until the next day. Now, in this scenario, I don’t see the porch light being turned off by the same piston so once your other piston turns the light off and the phone presence comes and goes again, it will not turn on the porch light again.
I believe you have a problem with Time is after Sunset and Time is before sunrise. Before Sunrise is midnight to sunrise, After Sunset is Sunset to midnight, therefore both can’t be true together. Instead put in a piston restriction: Only execute if time is between sunset and sunrise.