This is related to an older thread but thought it may be best to start a new one due to the fact that I created a bunch of noise switching between PLTS and PLEG.
Anyway, I have a motion sensor and a door sensor combined with a light switch.
The on condition seems to work fine - TurnOnBathNightLight - turn on light and set 5 minute timer
Not party-mode
Not vacation-mode
Is nighttime
Bathroom light is NOT on
Motion detected AND The light was turned off THEN motion true for more that 60 seconds afterwards (essentially locks out the motion detector if the light was turned off less than a minute ago)
OFF condition - TurnOffUpstairsBathLights
Not party-mode
ANY time- Bath Door is open and the timer expires (defaults to 1 hour but gets set to 5 minutes at night)
OR Nighttime is true, Bathdoor is open, the bathdoor expired is triggered and then the door opens
A few problems I need help with - looking at the attachment
[ol][li]It appears that my 5 minute timer never gets set properly. The UBthTimer is “true” even though it has been more than 5 minutes[/li]
[li]I do not think my condition is correct for checking the UpstairsBathDoorClosedDly[/li]
[li]Why is TurnOffUpstairsBathLights “stuck” on true? is it because the Night Schedule hit at 10:00PM?[/li][/ol]
Sorry for the long message. I’ve been struggling with this one for a few weeks (on and off due to work travel schedules).
It appears that my 5 minute timer never gets set properly. The UBthTimer is “true” even though it has been more than 5 minutes
That’s because the UpstairsBathLightManualOn was on 8 minutes earlier and started the timer for 1 hour.[/quote]
Ugh! You’re so right! I’m not even using that condition at the moment. I just haven’t removed it because that condition (which you helped me with) is really neat and will come in handy later.
OK. So that took care of the timer issue (I think anyway - will test).
But now the light immediately gets turned off.
This is like due to:
… OR (NightLightSched AND UpstairsBathDoorOpen AND (UpstairsBathDoorClosedDly;UpstairsBathDoorOpen))
It’s doing exactly what I’m telling it to, unfortunately. So how can I change this so that the light goes off after the door opens (after being closed) but only fires once.
UpstairsBathDoorClosedDlym has never fired … I am not sure I understand what this condition is expected to do …
Because it has never fired it has a date/time stamp of 0 (which is like Jan 1, 1970) …
As a result the expression:
UpstairsBathDoorOpen AND (UpstairsBathDoorClosedDly;UpstairsBathDoorOpen)
Will always be true as long as the UpstairsBathDoor is open, causing the light to be turned off.
[hr]
Maybe you want something like:
LightsOn and DoorOpen and (((LightsOn; DoorOpen) and (DoorOpen; NOW > 30)) or (LightsON; NOW > 5:00))
The first part turns off the lights anywhere from 30 to 90 seconds after you leave the bathroom. The second part turns off the lights after 5 minutes if you turn them on but never close the door.
OK. I took Richard’s suggestion and got 99% the way there. The only thing I need to do now is essentially “de-bounce” the logic for turning the light off when the door opens. The issue is if you push the door “almost” closed (say to get a drink of water) enough to fire the “door closed” logic, and then it swings open. It then turns off the lights.
Here’s where I’m at. I separated the two “off logics” for me to more easily troubleshoot.
TurnOffUpstairsBathNight - No action fired
NightLightSched AND UpstairsBathLightsOn AND ((UpstairsBathLightsOn; NOW > 5:00) OR (UpstairsBathLightsOn;UpstairsBathDoorOpen))
TurnOffUpstairsBathAny - No action fired
UpstairsBathLightsOn AND UpstairsBathDoorOpen AND (UpstairsBathLightsOn AND (UpstairsBathLightsOn;NOW > 1:00:00))
TurnOffUpstairsBathLights- Turn off lights
!PartyOverride AND UpstairsBathDoorOpen AND(TurnOffUpstairsBathNight OR TurnOffUpstairsBathAny)
The de-bounce has to occur in the “TurnOffUpstairsBathNight” condition somewhere in the i[/i] area. I only want that part of the condition to be true if the door has been closed for more than 30 seconds. I know the syntax isn’t correct but something like: (!UpstairsBathDoorOpen+30;UpstairsBathDoorOpen) I’m not sure having UpstairsBathLightsOn in the sequence even makes sense at this point.
Best Home Automation shopping experience. Shop at Ezlo!