My misery isn’t over yet folk’s (see PLTS-Bathroom Fan example for back ground)
[url=http://forum.micasaverde.com/index.php/topic,13987.0.html]http://forum.micasaverde.com/index.php/topic,13987.0.html[/url]
I’m trying to tidy up the PLEG with time of use and light level operation.
Of course, nothing is simple in life is it, time of use I thought would be
(18:00:00;Now;06:00:00) thinking that this is the logical expression for between the hours of 6pm and 6am, not so…
Similarly, light level operation.
I have the device property of the sensor returning the Light Level but what’s wrong with this code?
(LightLevel1 < 5)
Vera isn’t having a dummy spit with the syntex it usually has, so I’m guessing that my logic is out the window somehow.
The complete conditional statement is MotionTrip and (LightLevel1 < 5) and (18:00:00;Now;06:00:00) as usual I’ve tried adding in isolation (one condition at a time) with no luck and suspect that I’m missing a trigger on the Between statement, possibly Light1On and Light2On.
Anyone with any ideas?
Incidentally, the PLEG is otherwise working with timer functions on both lights functioning as programmed.
(18:00:00;Now;06:00:00)
This will always be false … A semi-colon separated sequence expression says all the events have to be in the specified order … Until time starts running backwards 06:00:00 is NEVER after 18:00:00 
What you want is:
(Not (06:00:00; NOW; 18:00:00))
I don’t know what has happened, but I upgraded to V2.9 and all weird things started happening.
I kept getting a popup with a message that the PLC wasn’t loaded, conditional expressions wouldn’t work etc.
Created a new PLEG and new PLC to hopefully go with it and now it doesn’t recognise the time.
What was Now > 3:00 and working in 2.8, becomes Now > 3:00 with 3:00 becoming an invalid token…
What was Now > 3:00 and working in 2.8, becomes Now > 3:00 with 3:00 becoming an invalid token...
That is an illegal fragment ... by itself ... What was whole condition ?
Please post your [b]Report[/b]
What was the report then is not what it is now.
I’ve recreated it (and the PLEG is armed) and gone back to 1st Principles by getting the sensor to trip the light, now I want it to time out after 3:00 min’s (which it was doing), now ziltch.
Report:
Triggers
Name Description
MotionTrip Entry 4 in 1 sensor (motion) is tripped
KitchenLEDOn Kitchen LED is turned on
EntryOn Upstairs Entry is turned on
Schedules
Name Type Time Days
Device Properties
Name Device Name Device Variable
LightLevel _4 in 1 sensor (light) CurrentLevel
Conditions
Name Expression
Entry MotionTrip
EntryOff MotionTrip; Now > 00:00:03 (edit, I’ve tried them is brackets as well).
Actions
Actions for Condition: EntryOff
Device Action Arguments
Kitchen LED SetTarget newTargetValue=1
Actions for Condition: Entry
Device Action Arguments
Upstairs Entry SetLoadLevelTarget newLoadlevelTarget=100
I accidentally hit reply before I finished the above reply.
The Time functions are the most frustrating I have come across, is there any reference that one can go to for a definitive answer?
I can see trouble heading my way again as I want the KitchenLED to turn on 30 sec’s after the entry, it isn’t going to like :30 or 0:30 or 00:00:00:30 either…
edit, I noticed that I had it as 3 sec’s in the above, altered it to 3 mins and still get the following Vera message:
Program Logic : MotionTrip; (Now > 00:03:00): Invalid Value token: 00:03:00
Program Logic : MotionTrip; (Now > 00:03:00): Invalid Value token: 00:03:00
This [u]is[/u] invalid because of the brackets. Try [b]MotionTrip; Now > 3:00[/b]
Actions for Condition: EntryOff
Device Action Arguments
Kitchen LED SetTarget newTargetValue=1
This will turn the Kitchen LED [u]On[/u]. Try [b]newTargetValue=0[/b]
I don’t know why version 2.9 has broken your PLEG. I still have your configuration loaded in a test PLEG and it works fine with my upgraded plugins. Did you upgrade Program Logic Core to V2.9 as well as Program Logic Event Generator?
I can see trouble heading my way again as I want the KitchenLED to turn on 30 sec's after the entry...
I can see trouble heading your way for this. PLEG timing is not that precise. The shortest delay it will give you will vary between 1 second and 1 minute depending on when, in real time, the trigger fires. I doubt that will be acceptable in your application. If you really want a delay of 30 seconds, you will need to use a scene with a delayed action for the second light or, alternatively, use a PLTS to provide the 30 seconds delay. The scene approach is undoubtedly the easiest solution.
I was getting a popup saying that it didn’t have a PLC, I gather that each PLEG requires it’s own PLC, why this one didn’t upgrade is a mystery, so I added another one.
Then again anything I seem to do becomes just that, a mystery.
Access programming was much easier… ;D
I tried removing the brackets as well, it still returns an invalid token.
I’ve given up for the night, not sure if a backup will revert back to v2.8?
Backup doesn’t work, in fact it’s frozen the PLEG, not able to get a report or open Device Properties.
I need professional advice on this, is it best to uninstall the whole box and dice now and reinstall or what?
I was getting a popup saying that it didn't have a PLC, I gather that each PLEG requires it's own PLC, why this one didn't upgrade is a mystery, so I added another one.
You shouldn't need to create a PLC device. PLC is a hidden device that is used by PLEG and PLTS and you just need one of them. It is created automatically when you install PLC the first time. The only place you should see it is in [b]APPS, My apps[/b]. If you click on the line [i]Program Logic Core[/i] it will show you a list of devices and there should just be one. If you have created additional PLC devices, delete them (the ones with the highest device numbers).
How did you upgrade your PLxx plugins? Did you follow this procedure? http://forum.micasaverde.com/index.php/topic,14446.0.html
When you go to APPS, My apps do you have one each of Program Logic Core, Program Logic Event Generator and Program Logic Timer Switch? Are they all shown as version 2.9?
[quote=“zedrally, post:9, topic:175118”]Backup doesn’t work, in fact it’s frozen the PLEG, not able to get a report or open Device Properties.
I need professional advice on this, is it best to uninstall the whole box and dice now and reinstall or what?[/quote]
Assuming the rest of your system is still working, don’t panic yet. When things go missing from PLxx, a browser page reload often brings them back. If not, it may be possible to clean-up whatever damage has happened to PLxx by removing or replacing a few files. @RichardTSchaefer is definitely the best man to help you with this but he’ll be asleep right now.
The steam-hammer approach would be to uninstall all PLxx plugins and start again but I would wait for Richard’s comments.
Steam Hammer idea very good…Lappy through window was considered as well… 
We will wait for RTS…
edit: Rolled back to a 7 day old backup, performed a heal and found I have v2.8 with Basic PLEG working.
I would need the info from the popup message to figure out how to correct the problem.
I added those messages to tell me when/what data is corrupted.
This will allow me to assist you in correcting the problems without going through the UnInstall/Install cycles.
I doubt that the 2.9 code caused any problems … I believe the data is already corrupted … It will just be quiet failures. This may mean that certain types of future edits will not work properly. It’s very likely that the run-time logic will continue to work … until you need to change it.
The message will refer to one of the Variables in the Advanced tab. Sending me the contents of that variable will help me determine what the problem is. Sometimes I may need for you to turn Debug on and send me a Log.
The data corruption has always been do to my bugs … but I am working with your help to eliminate them.
Thanks Richard for your help, I know you’re working with me :), not against…
United we face FRED.
I’ve rolled back to v2.8.
Would you like me to upgrade to v2.9 or get the PLEG working as I want it in 2.8 first (it only triggers so far, the conditional timer statements and Not statements are not).
Please post or email the current report. I will look them over.
Report as follows:
Triggers
Name Description
KitchenOn Kitchen LED is turned on
UpstairsOn Upstairs Entry is turned on
MotionTrip Entry_4 in 1 sensor (motion) armed is tripped
Schedules
Name Type Time Days
Conditions
Name Expression
LightsOn MotionTrip and Not(KitchenOn) and Not(UpstairsOn)
Light1Off KitchenOn and (LightsOn; Now > 3:00)
Light2Off UpstairsOn and (LightsOn; Now > 4:00)
Actions
Actions for Condition: LightsOn
Device Action Arguments
Upstairs Entry SetLoadLevelTarget newLoadlevelTarget=100
Kitchen LED SetTarget newTargetValue=1
Actions for Condition: Light1Off
Device Action Arguments
Kitchen LED SetTarget newTargetValue=0
Actions for Condition: Light2Off
Device Action Arguments
Upstairs Entry SetLoadLevelTarget newLoadlevelTarget=0
I’ve put myself out of my misery by getting the timer and light level functions working.
There is something in that NOT statement that creates problems. Removing them gives me a workable PLEG that triggers when it’s dark and times out at 3 and 4 min’s respectively.
I haven’t played with setting the hours of operation, I’m frightened to tempt fate…
I’ll attach the report at the bottom for a comparison with the one above that doesn’t work.
I would like to sophisticate a tad by adding a delay on the KitchenLED by 30sec’s, what would be the time statement that should do this (it should be possible as we can countdown, would a NOT count up?)
Working Report.
Triggers
Name Description
KitchenOn Kitchen LED is turned on
UpstairsOn Upstairs Entry is turned on
MotionTrip Entry_4 in 1 sensor (motion) armed is tripped
Schedules
Name Type Time Days
Device Properties
Name Device Name Device Variable
LightLevel1 _4 in 1 sensor (light) CurrentLevel
Conditions
Name Expression
LightsOn MotionTrip and (LightLevel1 > 50)
Light1Off KitchenOn and (LightsOn; Now > 3:00)
Light2Off UpstairsOn and (LightsOn; Now > 4:00)
Actions
Actions for Condition: LightsOn
Device Action Arguments
Upstairs Entry SetLoadLevelTarget newLoadlevelTarget=100
Kitchen LED SetTarget newTargetValue=1
Actions for Condition: Light1Off
Device Action Arguments
Kitchen LED SetTarget newTargetValue=0
Actions for Condition: Light2Off
Device Action Arguments
Upstairs Entry SetLoadLevelTarget newLoadlevelTarget=0
[quote=“RexBeckett, post:10, topic:175118”]PLC is a hidden device that is used by PLEG and PLTS and you just need one of them. It is created automatically when you install PLC the first time. The only place you should see it is in APPS, My apps. If you click on the line Program Logic Core it will show you a list of devices and there should just be one. If you have created additional PLC devices, delete them (the ones with the highest device numbers).[/quote]
I have 2 PLC, Clicking on the highest number one returns me to the APP Menu.
Deletion doesn’t seem possible.
[i][quote=“RexBeckett, post:10, topic:175118”]How did you upgrade your PLxx plugins? Did you follow this procedure? [url=http://forum.micasaverde.com/index.php/topic,14446.0.html]http://forum.micasaverde.com/index.php/topic,14446.0.html[/url][/i][/quote]
Yes, I followed thr approved RTS Procedure
[i][quote=“RexBeckett, post:10, topic:175118”]When you go to APPS, My apps do you have one each of Program Logic Core, Program Logic Event Generator and Program Logic Timer Switch? Are they all shown as version 2.9?[/quote]
Yes and they are back to v2.8 now.
You might try:
LightsOn MotionTrip and (Not KitchenOn) and (Not UpstairsOn)
In case I have a problems with Precedence. Wrapping a single token, like: (KitchenOn) with parenthesis is a NO-OP. I will have to build some test cases to verify this is correct … Did it just not work ? or do you get an error ?
Also in your latest … I think you meant:
LightsOn MotionTrip and (LightLevel1 < 50)
As far as 2 PLC plugins … they actually do not do anything … There is no way to have a plugin without a device. I do not know how you managed to create two devices … You may need to do a MCV ticket yo get one removed. I hope they are both at the same version … or there could be weird problems. You could end up with a mix of version file.
I’m getting weird things happening here again, what was working now doesn’t, thinking out aloud could this be the problem?
What would happen if I uninstalled the PLC ? then reinstalled it? (Wish I could drop a screen Shot into this).