In an effort to get comfortable with PLEG and its nuances, I decided to create a simple scenario and grow from there. But even this test case is stumping me:
Scenario: SwitchA and SwitchB control LightA. So… if either SwitchA or SwitchB are turned ON, then LightA gets turned ON, as well. If either SwitchA or SwitchB gets turned OFF, then LightA gets turned OFF. Similar in operation to a 3-way lighting circuit.
In practice I get unpredictable results, and I believe it has something to do with the Condition not being set up properly. The action will fire the first time I try it, but I need to toggle the triggers back to both ON or both OFF before it will trigger again. What I want to accomplish is a virtual 3-way circuit.
Here is what I have – what is the proper way to code this problem set?
Triggers
Name Description
SwitchA_ON SwitchA is turned on
SwitchA_OFF SwitchA is turned off
SwitchB_OFF SwitchB is turned off
SwitchB_ON SwitchB is turned on
Schedules
Name Type Time Days
Conditions
Name Expression
SwitchON SwitchA_ON or SwitchB_ON
SwitchOFF SwitchA_OFF or SwitchB_OFF
Actions
Actions for Condition: SwitchON
Device Action Arguments
LightA SetLoadLevelTarget newLoadlevelTarget=100
Actions for Condition: SwitchOFF
Device Action Arguments
LightA SetLoadLevelTarget newLoadlevelTarget=0
Any help demystifying the PLEG syntax would be greatly appreciated.
Regards, Mark