I did something wrong...

Let me start off by thanking everyone that was involved in making PLEG.

I’m kind of a dope when it comes to coding and don’t quite understand what all is going on.

I used the Basic light, Motion Sensor, Night Time example to create one that should turn my porch light on for 5 minutes only after 9pm to sunrise, Sunday-Thursday for 5 minutes when the garage door sensor is tripped. I’m getting an error: Program Logic : TurnOnPorch; PorchLightOn <15: Invalid Key token: TURNONPORCH

Here is what I set up.
Triggers
[table]
[tr]
[td]Name [/td]
[td]Description[/td]
[/tr]
[tr]
[td]GarageOpen[/td]
[td]Garage Door Sensor armed is tripped[/td]
[/tr]
[tr]
[td]GarageClosed[/td]
[td]Garage Door Sensor is not tripped[/td]
[/tr]
[tr]
[td]PorchLightOn[/td]
[td]Porch is turned on[/td]
[/tr]
[/table]

Schedules
[table]
[tr]
[td]Name [/td]
[td]Type[/td]
[td]Random On Delay[/td]
[td]Off After Type[/td]
[td]Random Off Delay[/td]
[/tr]
[tr]
[td]LateNight[/td]
[td]Weekly:1,2,3,4,7[/td]
[td]None[/td]
[td]Weekly[/td]
[td]None[/td]
[/tr]
[/table]

Conditions
[table]
[tr]
[td]Condtion Name[/td]
[td]Condition Expression[/td]
[/tr]
[tr]
[td]Welcome_Home[/td]
[td]GarageOpen; LateNight

[/td]
[/tr]
[tr]
[td]TurnOnLight[/td]
[td](Not GarageLightON) AND (GarageOpen AND LateNight)[/td]
[/tr]
[tr]
[td]AutoPorchLightOn[/td]
[td]TurnOnPorch; PorchLightOn 15[/td]
[/tr]
[tr]
[td]AutoPorchLightOff[/td]
[td]AutoPorchLightOn AND (GarageOpen; GarageClosed)AND (GarageClosed; NOW ]5:00)[/td]
[/tr]
[/table]

Actions
[table]
[tr]
[td]Condition[/td]
[td]# of Actions[/td]
[/tr]
[tr]
[td]Welcome_Home[/td]
[td]Immediate -2; Delay 05:00 -1; Delay 10:00 -1

[/td]
[/tr]
[tr]
[td]TurnOnLight[/td]
[td]Immediate -1[/td]
[/tr]
[tr]
[td]AutoPorchLightOn[/td]
[td]Immediate -1[/td]
[/tr]
[tr]
[td]AutoPorchLightOff[/td]
[td][/td]
[/tr]
[/table]

Thanks.

You have not defined an input, schedule or condition called TurnOnPorch so the expression for the condition AutoPorchLightOn is not valid. Did you mean to write TurnOnLight which is a valid condition name?

Need to make the following changes:

  1. Edit the LateNight Input Schedule.
    Need to define when it is no longer true. If you only define a start … it is only true for that instance in time. You want it to be true for an interval! So specify an off time.

  2. There is are syntax error for the condition AutoPorchLightOn and AutoPorchLightOff
    Not sure exactly what you are trying to do (AutoPorchLightOn vs TurnOnLight)
    I think that’s what you want is for AutPorchLightON to be true because it was automatically turned on.
    In which case you want:

TurnOnPorch; PorchLightOn < 15

I do not know why you would have an action on this. It’s only purpose is for a subsequent condition.
This is saying that if the light came on within 15 seconds after TurnOnLight triggered … then this is true.
NOTE: That the action for TurnOnLight should turn on the light. This condition will trigger when the light is actually turned on. If you turn on the light manually this will evaluate to FALSE.

  1. Change AutoPorchLightOff condition.
    I think it should be:
AutoPorchLightOn AND GarageClosed and (GarageClosed; NOW > 5:00)

[hr]
It’s easier to review and easier to post if you only show the output from the Status Report.
Then describe any problems you are having.

It’s taking me a little time to digest what has been suggested.

Thanks RexBeckett and RTS.

  1. I didn’t set the days I wanted to stop the schedule. I just assumed that only “at Sunrise” would be sufficient. I went ahead and checked the appropriate days.

  2. I went ahead and corrected the syntax error like Rex and Richard suggested.
    It’s been a couple of weeks since I did this so my memory is a little fuzzy. In the end I would like the porch light (Porch) to turn on when the garage is opened.
    I thought I would be avoiding a manual vs. automatic activation conflict. When I turn on the light switch for the porch at 11pm I was thinking that it would turn off the light after 5 mins, I don’t want this to happen. I think that is why I have TurnOnLight and AutoPorchLightOn conditions.

  3. I made this change.

After these changes I’m getting errorProgram Logic : TurnOnPorch; PorchLightOn <15: Invalid Key token: TURNONPORCH

I’m learning to fish here. The mistake I made, this time, was with the TunOnPorch part of the AutoPorchLightOn Condition Expression? There is no condition named TurnOnPorch right?

How do I get a status report? It’s under Debugging right?

My Mistake, i forgot to merge the changes from @RecBecket

TurnOnLight; PorchLightOn < 15

The Status report is on the Control tab. You should see it when you click on the Wrench on the PLEG device on the Vera Dashboard. Right Next to Inputs

:slight_smile:
No errors, I think she is happy.

Hopefully I can use this as a template for another one for the weekend nights.

Thanks.