Need help with a webCoRe piston

Need some advice... I'm trying to create a Webcore piston to turn on a pair of exterior RGB bulbs and change the color to white when my front garage door opens, then restore them to the previous color and turn them off when the door closes OR after 5 minutes. I've accomplished everything except the OR 5 minutes part. Unfortunately I'm not sure how to accomplish 'Door Closes OR 5 minutes elapses part. Line 45 is the critical point. I have it set up with a Logical OR Group, I', just not sure what the 2nd part of the Group needs to be.

There are many ways to accomplish this task. A question first. Do you want the lights to turn off even if the door is still open after 5 minutes? I presume you possibly have another piston to close the door after 5 minutes. But if you want the lights to stay on while the door is open, even after 5 minutes, then the complexity of your piston will grow. Or, you will need an additional piston for that scenario.

I want the lights to return to the previous state and turn of if the door closes OR 5 minutes goes by.

Just so I understand. You want to restore the lights to the previous state after 5 minutes, period, even if that means that your garage door is still open, and may remain open after 5 minutes. I have mine set to turn off after 3 minutes AFTER all garage doors are closed. The lights stay on as long as any door is open. I get various notifications if a garage door is left open for too long.

One scenario : your lights are restored to previous state after 5 minutes, or when the door closes. But, the garage door MAY still be open after 5 minutes, but your lights will restore after 5 minutes. And the door may remain open (with lights off) until closed by another method.

Or,

Your garage door ALWAYS closes after 5 minutes (or manually before 5 minutes), and the lights can be restored then. Thus making an easier piston to create.

Scenario one... the door has a contact sensor, to detect whether it is Open or Closed, but is not controlled by any smart devices. I have other means of knowing if the door stays open, I just need the lights to return to the previous state and turn off after 5 minutes if the door hasn't been closed.

Untested...

If garage door opens
	turn on lights
	wait 3 seconds
	capture light attributes
	set color to white
	wait 5 minutes
	restore light attributes
	turn off lights

If garage door closes
	restore light attributes
	wait 3 seconds
	turn off lights

If the garage door opens, and stays open for 5 minutes, then the piston will awaken from the 5 minute wait and turn off the lights.
If the garage door closes before the 5 minutes wait is finished, the 5 minute wake-up time is cancelled (if TCP is default), and the second IF turns off the lights.

If I could, I would have done this already. Problem is, the ordinary wait function is unavailable with setup I described. I would need some sort of variable or something along those lines, but I'm not sure how to accomplish what I want to do.

Not sure I understand this.

Try importing the piston using the code in my green snapshot and put rgbw bulbs in the first 2 slots and a contact sensor in the 3rd.
Then, go to line 38 in the Piston. Hit "Add A New Condition" below "Contact Changes To Closed". I'm certain that will clarify what I mean.
I appreciate your help.

I don't think your original piston will work as written. Are you trying to add a WAIT statement at line 38 as part of the IF condition? You cannot do that.
Try loading piston code XXXX that I listed above. Fill in your devices, and see if that works for you.

Edit : sorry, code z3jsm

I'll give it a try. Thanks

Does it work for you?

Sorry, haven't had the opportunity to see how it works. I'm going to call it solved. I'll let you know if I have any issues with it.
Thanks again for the help.

1 Like