Piston will not resume from paused state after set time


#44

Am I correct in the assumption that there is no shower in this bathroom downstairs? (a shower curtain would hide motion from the sensor)

If there is no shower, it would be an easy fix if “Bath Basement Light 100% override” ended with:
Turn off Bulb
Resume other piston

(not the other way around)

This way, the light would ALWAYS get shut off after X minutes of a manual override, but motion would trigger it back on in case someone was lingering beyond your timer.


#45

Yes, there is shower with door, and another piston takes care of that and is working perfect.

https://community.webcore.co/uploads/default/original/2X/6/685baa96e9de16dfeabf3f5ef714dff0b2ede3ff.png

If I end the 100% override piston with Off that would tun Off the light if there is someone in the bathroom …no?
Or the resumed motion light piston has somehow priority?


#46

Will try that when I get home
Thanks!


#47

Corrected but it still wouldn’t turn the light OFF without presence in the bathroom :frowning:

Adding Turn OFF bulb before resuming the piston caused the light to go OFF even when there is presence in the bathroom, and it took long time before it turned back on again ( I guess blind period by the motion sensor)

To be continue tomorrow :slight_smile:


#48

I give up, perhaps the concept is flawed, tried countless combinations but no joy :frowning:
Deleted the piston for now and will try again later with clear mind.


#49

I have a couple of double shifts coming up, but I will continue brain storming…
I have a few good ideas, I just need to iron out the kinks in my mind


#50

You are very kind :slight_smile:
Don’t work too hard :wink:

Thanks


#51

Hmmm. I have an idea… What if your “100% override” piston kept the light on until the motion was inactive (instead of forcing 3 minutes). Something like this:

IF Keypad button gets pushed
THEN WITH Bulb 2
DO Pause other piston
Set level to 100%
Set boolean variable ‘Override’ to true
End IF

If Motion sensor is inactive
-AND-
Variable ‘Override’ is true
THEN WITH Bulb
Wait 2 minutes
turn off
Set variable 'Override" to false
Resume other piston
End IF

This method will keep the lights on at 100% until 2 minutes after the motion stops. At which point, the light will turn off completely, and the normal piston will resume.

The only issue I forsee is what if someone wants 100% light, then hops in the shower… (where the motion cannot detect them) The light would turn off in 2 minutes. (unless your shower piston takes that into account) I haven’t seen your shower piston though, so I am really just guessing on that angle


#52

Thank you, will try that
The shower piston should take care of that or I can just ad line to cancel the override piston


#53

Sorry I’m late to the party, but here is an explanation I posted in another thread with similar issues. The reason your original piston didn’t work as you thought is the same reasoning:

In your case, when your piston wakes up 3 minutes later, the “Keypad 8’s button gets pushed” condition evaluates false, therefore nothing further in your “THEN” statement is executed. Anything you had in “ELSE” would have been, though. A wait doesn’t resume piston execution where it left off.

Hope this helps! Once you understand how the piston flows, you can go back to writing something more ‘natural’ to you.


#54

Well, that explains a lot Thanks :slight_smile:
So there is no way to “continue” from the point where the piston was paused instead of executing it all over from the top of the sequence? That would solve my problems.


#55

There are a few different ways you can still make the piston behave the way you want… you just have to make sure the IF statement at the top won’t prevent your following actions from being completed. Here are two samples:

In the above, the wait and subsequent code isn’t dependent on any IF evaluation. This can be good or bad… meaning if the piston is triggered for another reason, the last 3 lines are executed. You’d have to decide if this is a good implementation since you know your system, what other inputs could make your piston execute, etc.

Another method that is less likely to cause “hmm, wasn’t expected that to happen” scenarios is to use a variable:

In this case, since your IF condition would still evaluate TRUE, you piston will jump in and resume execution from the WAIT command.

First run:
Button is pushed evaluates true
Sets variable
THEN pauses piston and sets light level to 100%
Sets wake-up timer for 3 minutes from now

Second run, 3 minutes later:
Variable evaluates true
THEN sets level to 28% and resumes piston, and sets variable back to false

Coming out of a WAIT command, the conditions are re-evaulated but no every step in your THEN/DO is repeated, otherwise you’d hit the same WAIT command and never get past it.


#56

Thanks for the detailed explanation, I’m true amateur when I see all the options possible :joy:

I will experiment with all of it, it’s a great learning lesson!


#57

So, finished testing the first version, it works fine till the point where it dims back and resumes the “bath autolight” piston but if the person left the bathroom before the end of the 3 min override the light will stay on untill someone walks in and will trigger once the motion sensor (we had this problem above as well)

EDIT:
Version 2 working perfect, I just have to comprehend it :innocent: