PLEG detect trip, fire, but not if already tripped...

Hello,

I have a motion sensor, and a door sensor. I would like the door sensor to turn on light1, as well as the motion sensor. SOmetimes the door is already open and the motion sensor turns the light on, sometimes the door is closed and would like the door sensor to turn the light on when its opened too.

I Cant seem to get both sensors working. pleg gets stuck in a loop if the door is open and i turn off the lights manually, because it detects that the door is “tripped” and turns the lights back on. What I would like is for it to ignore if the door is tripped but do detect the motion, and also fire if the door is closed.

Any ideas?

[code]Triggers:

BathMotion1 Bathroom Sensor is tripped
NOTBathMotion1 Bathroom Sensor is not tripped
NotBathDoor1 Bathroom Door is not tripped
BathDoor1 Bathroom Door is tripped
BathVanityLightIsOn1 Bathroom Vanity Light is turned on
BathFanLightIsOn1 Bathroom Fan Light is turned on

Conditions:

TurnOnBathLights1 (NOT BathVanityLightIsOn1) AND (NOT BathFanLightIsOn1) AND (NotBathDoor1;BathDoor1) or (BathMotion1)
AutoOnBathLights1 (TurnOnBathLights1; BathFanLightIsOn1 <15) AND (TurnOnBathLights1; BathVanityLightIsOn1 <15)[/code]

That’s what sequence expressions are for.

With the condition:

ConditionName X;Y

This is true if Y follows X.
You can also optionally add > or <

ConditionName X;Y > 1:00 < 5:00
This is true if Y follows X and it does so between 1 and 5 minutes.

Thanks or the reply Richard.

I expected the sequences to work, but with

(NOT BathVanityLightIsOn1) AND (NOT BathFanLightIsOn1) AND ((BathMotion1) OR (NotBathDoor1;BathDoor1))

Here is what happens:

Open Door
Lights turn on immediately
turn lights off (manually or remotely)
lights turn back on (loop)

The sequence works to initially turn the light on through the door sensor, but I am assuming that the logic detects that since bathdoor1 has come after notbathdoor1, and is still tripped, when you turn the lights off it fires it again.

This has certainly been a hair pulling project.

According to various posts, I assumed that a condition will only fire the FIRST time a trigger becomes true.

With the logic:

TurnOnBathLights1 (NOT BathFanLightIsOn1) AND (BathDoorClosed1;BathDoorOpen1)

It seems that the code will keep turning the light on , even if you turn it off manually as long as the door is open, forever.

Would the condition not specify that the door must be closed, then opened for it to be true, and should only fire the FIRST time this happens?

There is a bug with 4.3 handling a complimentary triggers X and NOT X

In your case:
BathDoorClosed1
BathDoorOpen1

The fix has been submitted … should be approved my MCV in the next business day or two.

still doesnt work…when the door is open and you turn the light off it turns back on…log is attached.

@Tony G

You entered this issue at the same time I had a problem with a construct you were using. So I did not pay close attention to the rest of the problem.

The construct:
TurnOnBathLights1 (NOT BathFanLightIsOn1) AND (BathDoorClosed1;BathDoorOpen1)

Is an infinite loop because of the following:
If the door is open and the lights are turned off … then (NOT BathFanLightIsOn1) becomes true … and TurnOnBathLights1 becomes true … fires the action that turns on the light … Witch fires the conditions then (NOT BathFanLightIsOn1) becomes false and TurnOnBathLights1 becomes false … and if you turn off the light again the cycle repeats.

I am not sure of what scenario you are trying to accomplish with:
(BathDoorClosed1;BathDoorOpen1)
Since these are complementary this is equivalent to just:
BathDoorOpen1

Given just a Door Sensor I am not sure how you detect if the door is opened because someone is entering and you want to turn the lights on vs someone is leaving and you want to turn the lights out.
[hr]
Maybe you want something like:
Inputs:
BathMotion
BathDoorOpen
BathVanLightOn
BathFanLightOn

Conditions:
LightsAreOff NOT (BathVanLightOn OR BathFanLightOn)
AutoLightsOn LightsAreOff and (BathMotion or (LightsAreOff; BathDoorOpen))

If there is motion in the bathroom, and the lights are off, you turn them on.
If the lights are off, and the bathroom door is closed, if you open it the lights will come on.

If the door is opened, then your turn the lights off, they stay off.

If you leave the door open, the lights will only come back on when there is motion in the bathroom.
If, however you close the bathroom door when you are done, the logic will turn the lights on when the door is opened again.