Deck string lights won't stay on outside of this piston


#1

1) Give a description of the problem
I have a contact sensor on my sliding door to my deck that turns on my deck string lights if my deck string lights were off for more than 10 seconds and then after 5 minutes the string lights turn off.

My issue is that if I turn on my string lights myself then after 5 minutes they turn off even though it wasn’t triggered by my sliding door contact sensor.

2) What is the expected behavior?
Turning on the string lights outside of this command should still leave my lights on until I go to turn them off.

3) What is happening/not happening?
The Piston is turning off my deck string lights even tho the lights are turning on outside of this Piston.

4) Post a Green Snapshot of the pistonimage


#2

You’d need to use a variable where the piston sets a boolean variable (let’s call it lightsAuto) to true when Contact Sensor 3 turns on the light. If the variable is false, the piston should leave the light strip alone and not turn it off.

The piston should also set the lightsAuto variable to false after it turns off the strip.


#3

There are some real gems in this thread.

It is based on a motion sensor, but you can replace a door contact everywhere you see a motion sensor to achieve your goals.


#4

I think your piston is getting checked every time there is a change to the status of the outlet switch. If the door is closed, the first if condition fails and nothing happens and your light should stay on as long as the door remains closed.

However if the door is open, if conditions 1 and 2 are true if the outlet was off more than 10 seconds and your light will turn on, wait 5 minutes, and then turn off. The piston works because the status changed on the outlet and not the door being opened.

I hope the following might fix the problem.

Change your first if statement to read if contact sensor 3 changes to open, instead of is open.

This should workwhen you want the lights on for only 5 minutes.

If you turn the outlet on manually, if the door is open, the sensor has not changed and the if statement fails. This piston will not run and your light stays on.
If the door is closed, this piston again fails and your light stays on
Give it a try. Hope it works for you