So, I AM about a week into PLEG, and I just stumbled on a post, where you can modify the SET TARGET value. This is powerful.
I saw a post where Richard offered this SET TARGET action, and it blew me away
{(SLights_On ? “1” : “0”)}.
What a great way to eliminate conditions, and even some schedules. Why do a cSchoolRampUp, when I can now do a SET TARGET to start the rampup plugin only if sWeekday and !sHoliday, heck, I suppose I can now even eliminate sHoliday schedule , and use tHoliday capturing status of Holiday Vswitch.
Would love to hear some others use cases out there!
[quote=“mrv777, post:2, topic:185942”]Can you explain a little more what this does:
{(SLights_On ? “1” : “0”)}.
Thanks![/quote]
It is explained in PLEG Basics. See the sections on Conditional Expressions and Actions.
When this expression is evaluated as an argument for the device action request, it will return the value “1” if SLights_On is true or “0” if it is false.
In my case, this checks to see if it is Evening (schedule: Sunset - 1:00 am) and if so, check the current load level on the stairway spots - if they are already on, use the current on level and if they are off, set the load level to 30. I use these all over my lighting PLEG to preserve prior/manually set statuses and load levels.
@ Rex : Thanks again for the great getting started manual.
I wonder if you might add some additional example screen shots next time you make a revision… For example, page 11 has the True False, and I did understood that example you gave.
I do not recall, I may have missed it, if the getting started guide mentioning that you can manipulate the value of the set target fields using PLEG values (I believe referred to as terms) . As I am very new to PLEG, visual examples are extremely helpful.
I saw mention on the board, of an Expression getting started guide, is this a separate guide? If so, please let me know where it lives .
I have not gotten into that depth …yet…Motion and light levels are next months project. What type of dimmers are you using? I need to install 2 dimers in the kids rooms, and want to make sure I get units well rated here on the forum.