I’m trying tp get the example in PLEG BAsics to work using the following:
Step1 s2mintimer false 2017-09-20 15:17:39.897 2017-09-20 15:19:39.120
State$S1 Step1 and (State eq ?S3?) and (State; Step1) null 0 2017-09-20 14:16:16.278
State$S2 Step1 and (State eq ?S1?) and (State; Step1) null 0 2017-09-20 14:16:16.279
State$S3 Step and (State eq ?S2?) and (State; Step1) null 0 2017-09-20 14:16:16.279
Which is taken directly from Rex’s example. The trigger is a 2mintimer which works. The rest does not and returns the following error message.
Program Logic Event Generator (PLEG)[64] : Step and (State eq ?S2?) and (State; Step1): Invalid Value token: ?S2?
I’m in over my head as it according to Rex it should work! Any ideas where I can go from here?
Must be a typo in the example … replace the question marks with double quotes.
In the Conditions they are quotes, the question mark is from the copy/paste. See the attachment of the Status report.
When you say double quotes do you mean ““xxx”” or “xyz” ?
Double Quote: "
Single Quote: ’
You also need to initialize your state variable, since the conditions will only be true if one of the existing state variables is defined.
Does the error message have quotes or question mark … this is hard to interpret when your cut/paste changes the info.
error message has quotes.
Program Logic Event Generator (PLEG)[64] : Step1 and (State eq ?S2?) and (State; Step1): Invalid Value token: ?S2?
It appears that State$S1 is being triggered as there is the State Status Table indicating the value for S1
These are the Conditions as copied from Rex’s Basics. The trigger is Step1 which is a 2 minute timer.
Name Logic Expression
Step1 s2mintimer EditRemove false 2017-09-20 15:17:39.897 2017-09-20 15:19:39.120
State$S1 Step1 and (State eq ?S3?) and (State; Step1) EditRemove null 0 2017-09-20 14:16:16.278
State$S2 Step1 and (State eq ?S1?) and (State; Step1) EditRemove null 0 2017-09-20 14:16:16.279
State$S3 Step1 and (State eq ?S2?) and (State; Step1) EditRemove null 0 2017-09-20 14:16:16.279
State Name Value Last Change Previous Change
State S1 0 0
@[font=verdana][size=1em]zedrally[/size][/font]
[font=verdana]I was following this thread and decided to test it myself.[/font]
[font=verdana]Rex’s example from PLEG Basics works for me.[/font]
[font=verdana]Attached is a pdf copy of my status report.[/font]
[font=verdana]In the status report, please ignore the content other than Step in the Schedules section, State$S1, State$S2, and State$S3 in the Conditions section and the summary table for State Name State.[/font]
[font=verdana]Hope this helps.[/font]
Although you have managed to evaluate the True/False Conditions, the State Table only indicates S1.
I would have thought, possibly wrongly that S2 and S3 should also be shown in the State Table ?
I possibly have the wrong notion of using this variable as I had thought on each trigger it would evaluate the State progressively, ie first trigger-S1, next Trigger S2, next S3 and so on.
Otherwise, I just don’t see where the difference could be as the syntax is exactly the same, the only difference is the conditions not evaluating. I’ll try again in another PLEG and see what happens.
I’ve put all of this into a new PLEG.
Same result, in desperation to track down the cause I have broken up the first condition with neither parts evaluating. Now I am totally confused as to why this would be, I have done nothing that I would not normally do with PLEG yet I have no evaluations for Step. This just does not make sense to me.
edit: I did have a previous problem with PLEG showing an error, I’m wondering if this may be related although a backup restored the PLEG’s perhaps the core is corrupt in some manner?
I further broke down the Conditions and have now isolated the problem to the test.
State eq “S1” which does not evaluate.
I’m really looking for help here.
I have walked away from it for 3 hours and returned from a family lunch only to find that State eq “S1” in the test condition eventually did evaluate 1 hour & 51 minutes later (see Status PDF).
I’m lost for words, what would cause PLEG to do this?
Oddly the same condition (State eq “S1”) in brackets did not evaluate, should I wait another 01:51?
That’s because state has not (or never will be based on your conditions) been initialized.
Your conditions require state to be initialized.
Do you have an example of how this is done, I assumed that the trigger was all that was required.
I am so frustrated with this.
I have stripped it all back to what BrianBeaton has used and still cannot duplicate the result.
Attachment follows, what am I not seeing? If it works for Brian, why not for me or if anyone else is using this in a PLEG, would you mind sharing it with me so I can understand what I am doing wrong.
Keep playing - maybe make it even more simple.
I am by no way much more than a noob at PLEG but here are some observations.
- I see the cFrontLightOn was true at 5:44 am. Do you have an action defined to do something when that condition is true?
- You will need a condition to turn the lights back off otherwise they will stay on. You then define an action to turn off the lights when that condition is true.
- The state and step stuff confuses me - both what you are trying to accomplish and how you trying to accomplish it. However I notice a value of null so PLEG is not evaluating that expression the way you are expecting it, maybe because of a logic error. But like cFrontLightOn, each State needs an action to do something, otherwise, the condition just becomes true and later false with no action. The actions trigger when a condition becomes true so you need an opposite state to become true to undo what you are trying to do.
this has nothing to do with the Front Door condition. I should have deleted it front door as it nothing to do with this.
I’m done playing with this, I have spent 5 to 6 days on something that will not evaluate and no one has the faintest idea why.