Sequencing triggers in PLEG

I am quite new with PLEG and I could certainly use some help. I have the following:

Amy Garage Door Opens
Jeff Garage Door Opens
Yamaha Receiver

Main Kitchen Light
Main Hallway Light

Schedule One hour before Sunset to 22:30

I want the Main Kitchen Light ant the Main Hallway Light to go on during the time schedule if the Yamaha Receiver is off and Amy Garage Door or Jeff Garage Door Opens before the Kitchen Door

The receiver off tells me no one is watching Television. If I don’t have the Garage door open prior to the Kitchen Door then the lights go on if we leave in the evening.

while I’m not expert, I always suggest trying creating the expression just as you state it in your description. Example…

MAIN Schedule AND !YamahaReceiver AND ((AmyGarageDoor or JeffGarageDoor);KitchenDoor)

I’m not sure if you can use ‘(AmyGarageDoor or JeffGarageDoor)’ in a sequence… if not, you’ll need to have that in a separate Condition

GarageDoors AmyGarageDoor or JeffGarageDoor

MAIN Schedule AND !YamahaReceiver AND (GarageDoors;KitchenDoor)

for that then use the Condition name itself in its place in the main Condition

your ACTION is then to turn on/off/level any of the devices as you desire.

Aaron,
You can’t put an expression as as argument to a sequence expression. An expression does NOT have a timestamp. Only inputs and conditions have timestamps.

The second approach should work.
But if you leave garage doors open … you will want to set the REPEATS on the GarageDoors condition so that it gets a new timestamp when any door opens, even if the other one is already open.

[quote=“RichardTSchaefer, post:3, topic:183711”]Aaron,
You can’t put an expression as as argument to a sequence expression. An expression does NOT have a timestamp. Only inputs and conditions have timestamps.

The second approach should work.
But if you leave garage doors open … you will want to set the REPEATS on the GarageDoors condition so that it gets a new timestamp when any door opens, even if the other one is already open.[/quote]

I thought you might not be able to :slight_smile: thank you for confirming.

@RichardTSchaefer

How do I set REPEATS? Sorry I am really quite new at this. I have read hours of discussions on these boards but it is a lot to consume until you actually dive in and use it

[quote=“jquincy, post:5, topic:183711”]@RichardTSchaefer

How do I set REPEATS? Sorry I am really quite new at this. I have read hours of discussions on these boards but it is a lot to consume until you actually dive in and use it[/quote]

‘Check box’ under the name of the Condition.

Wow Thanks. That one was really easy.

So now I have a different issue and not exactly sure what I have done wrong. When we enter the house and tYamaha_Switch is false lights come on perfect. Later in the evening we turn those switches off manually. We then turn the Yamaha receiver on to watch TV. When we turn off the Yamaha the lights come back on. Any ideas ? Thanks

Your problem is in the matter of order. Lets break it down.

Schedule AND !YamahaReceiver AND (GarageDoors;KitchenDoor)

Light come on when all 3 are true.

  1. Schedule is set and that should be true during the time the lights are automatically coming back on right?

  2. !YamahaReciever you said you turn off right before the lights come on. So this would be true.

  3. The last one is the doors. And if either of the garage doors were the last door to be opened this would stay true until you open the kitchen door.

So I suspect your problem is in #3 where the last door to be opened wasn’t the kitchen door. Does this seem right?

So actually today it went this way.

sKitchenHall in time slot
tAmyGarage opened
tKitchenDoor opened

Kitchen Main on
Main Floor Hallway on

Now I turned off Kitchen Main and Main Floor Hallway

I just turned on tYamaha_Switch and then turned it off after 5 minuter

Kitchen Main and Main Floor Hallway both come back on

[quote=“jquincy, post:10, topic:183711”]So actually today it went this way.

sKitchenHall in time slot
tAmyGarage opened
tKitchenDoor opened

Kitchen Main on
Main Floor Hallway on

Now I turned off Kitchen Main and Main Floor Hallway

I just turned on tYamaha_Switch and then turned it off after 5 minuter

Kitchen Main and Main Floor Hallway both come back on[/quote]

Sometimes when I need to find the problems (since I’m not always smart enough to find the problem by looking at it in a whole) I break it down into test sections. So make 3 test conditions with no actions just to see when or which one is staying true when it shouldn’t be.

So:

cTest1: sKitchen_Hall
cTest2: !tYamaha_Switch
cTest3: (cGarageDoors;tKitchenDoor)

Leave the orginal as normal and run threw and see whats true when it shouldn’t be.

I’m sure your problem is in test 3 and maybe its because you have the repeat checked “cGarageDoors”. But test using the above to find out.

Well I tried the changes you suggested and still no luck. When Yamaha is true the light come on after Garage opens then Kitchen Door opens.

Yes you can see your problem right there.
cTest3: (cGarageDoors;tKitchenDoor) Is true because the garage Door was opened then the Kitchen door was opened.

cGarageDoors were opened at 2014-11-06 18:46:17.502
then
tKitchenDoor was tripped at 2014-11-06 18:46:25.907

So you need to rethink how you attack this. Sounds like you want this to be true only when you first come in for the day but not again until?
You can solve this a few different ways. If above is true only the first time after the garage doors are open, you can base it off time and when the door was opened like this.
(cGarageDoors; Now > 5:00) If you add that to this " Schedule AND !YamahaReceiver AND (GarageDoors;KitchenDoor) AND (cGarageDoors; Now > 5:00)"
Now the whole thing will only be true for 5 min after one of the garage doors was opened. After 5 min. they would never auto come on again until the door was reopened.

You can also add another order to it, so like if or once the receiver was turned on after doors were opened or closed it would be void until the door opened again first before the receiver.

Thank you very much for helping me through this. I was stuck on this. I will try this tonight. I thought through this but wasn’t exactly sure how to execute it.

CHange as follows:

cMain2 sFrontBorchBefore230 and !tYamaha_Switch
cMain3] cMain and cMain2 and (cMain2; cMain)

Move the actions from cMain to cMain3

cMain – Is true when the kitchen triggers AFTER the Garage Door opens
cMain2 - Is true when the Yamaha switch is off during the specified interval

cMain3 - is true when cMain and cMain2 are true and also when cMain happens after cMain2.

I appreciate your help very much. It has been working perfectly for a week,

So all was good for a good while and now I have an issue. I have added various things to my PLEG and now I have the issue I had before. Once cMain,cMain2 and cMain3 three are true when the kitchen door is opened the lights go on. Would appreciate any suggestions.

Looks like your PDF file is missing a all of the conditions.

Check your conditions that use schedules. Many of your schedules do not have an OFF time.
This means your schedule is always true … and maybe your conditions are always true.
In that case you will need the REPEATS set to re-trigger.

I should have looked at it after I ran it through the scanner. Sorry about that. This has everything in it except the last page of actions. It is over the 512kb. I appreciate your time

I can see your logic … but I do not understand your requirements …
What is not working as expected ?