Best Practices for Scene Controllers (w LED managmenet) + Pleg

What is the best way to detect button being pressed (scene activated and deactivated) with the least number of triggers/conditions?

The following logic would seem to work on a per button basis.

Trigger
DBR_Scene1 = DBR - Scene Controller Scene #1 Activated

Condition
DBR_Scene1_On = DBR_Scene1
DBR_Scene1_Off = !DBR_Scene1

Action
DBR_Scene1_On
DBR_Scene1_Off

I have about 20 In Wall Scene Button with LED indicators spread out in 6 scene controllers (4 scene controllers @ Front Entry, Living Room, Master Bath, and Master Bed…and 2 scene controllers @ upstairs patio and back door). So that seem like 20 buttons x 5 PLEG items (2 Trigger, 2 Conditions, 2 Actions) = 100 Lines of PLEG to write for scene fire/scene LED indicator control to run the scene controllers actions with LED.

I also have 21 more buttons for remote controls (7 x minfob, minimote) that can hook on to the existing in wall button actions…but that will be at least 2 x 21 = 42 triggers.

Thinking of breaking this logic out to anther PLEG device, for a total of 3 on the device, Security, Motion Lighting, and now Scene Control…Iw as just planning on Security and Motion Lighting (with Scene and Lighting merged).

Any best practices for managing scene controllers and scene controller LED indicators with PLEG?

Sample PLEG Code that appears to be working on a small scale test for my two, 2 button scene controllers on the upstairs and downstairs patio. Scene 1 controls the local patio light (UPA or DPA), and scene 2 is the same on both which activates the outdoor floodlights (as well as the sets the LED’s).

[b]Triggers [/b]
UPA_S1_On	 UPA - Scene Controller: scene number 1 is activated
UPA_S2_On	 UPA - Scene Controller: scene number 2 is activated
UPA_S1_Off	 UPA - Scene Controller: scene number 1 is deactivated
UPA_S2_Off	 UPA - Scene Controller: scene number 2 is deactivated
DPA_S1_On	 DPA - Scene Controller: scene number 1 is activated
DPA_S2_On	 DPA - Scene Controller: scene number 2 is activated
DPA_S1_Off	 DPA - Scene Controller: scene number 1 is deactivated
DPA_S2_Off	 DPA - Scene Controller: scene number 2 is deactivated
Night	 Activated - Night Mode indicates Night time.

[b]Conditions[/b]

Name	                Repeat	Expression
BY_Floodlights_On	Yes		(Night;DPA_S2_On) OR (Night;UPA_S2_On)
BY_Floodlights_Off	Yes		DPA_S2_Off OR UPA_S2_Off or !Night
UPA_Patio_On		Yes		Night;UPA_S1_On
UPA_Patio_Off		Yes		UPA_S1_Off or !Night
DPA_Patio_On		Yes		Night;DPA_S1_On
DPA_Patio_Off		Yes		DPA_S1_Off or !Night

[b]Actions[/b]

Actions for Condition: BY_Floodlights_On

Immediate

Device	Action	Arguments
BY - Lawn Flood Light	SetLoadLevelTarget	 newLoadlevelTarget=100
DPA - Scene Controller	SetLight	 newValue=1 Indicator=2
UPA - Scene Controller	SetLight	 newValue=1 Indicator=2
BY - Alley Flood Light	SetLoadLevelTarget	 newLoadlevelTarget=100
Actions for Condition: BY_Floodlights_Off

Immediate

Device	Action	Arguments
BY - Lawn Flood Light	SetLoadLevelTarget	 newLoadlevelTarget=0
DPA - Scene Controller	SetLight	 newValue=0 Indicator=2
UPA - Scene Controller	SetLight	 newValue=0 Indicator=2
BY - Alley Flood Light	SetLoadLevelTarget	 newLoadlevelTarget=0
Actions for Condition: DPA_Patio_On

Immediate

Device	Action	Arguments
DPA - Left Bulb	SetLoadLevelTarget	 newLoadlevelTarget=100
DPA - Right Bulb	SetLoadLevelTarget	 newLoadlevelTarget=100
DPA - Scene Controller	SetLight	 newValue=1 Indicator=1
Actions for Condition: DPA_Patio_Off

Immediate

Device	Action	Arguments
DPA - Left Bulb	SetLoadLevelTarget	 newLoadlevelTarget=0
DPA - Right Bulb	SetLoadLevelTarget	 newLoadlevelTarget=0
DPA - Scene Controller	SetLight	 newValue=0 Indicator=1
Actions for Condition: UPA_Patio_Off

Immediate

Device	Action	Arguments
UPA - Right Bulb	SetLoadLevelTarget	 newLoadlevelTarget=0
UPA - Left Bulb	SetLoadLevelTarget	 newLoadlevelTarget=0
UPA - Scene Controller	SetLight	 newValue=0 Indicator=1
UPA - Flood Light	SetLoadLevelTarget	 newLoadlevelTarget=0
Actions for Condition: UPA_Patio_On

Immediate

Device	Action	Arguments
UPA - Flood Light	SetLoadLevelTarget	 newLoadlevelTarget=100
UPA - Right Bulb	SetLoadLevelTarget	 newLoadlevelTarget=100
UPA - Scene Controller	SetLight	 newValue=1 Indicator=1
UPA - Left Bulb	SetLoadLevelTarget	 newLoadlevelTarget=100

So I’ve been thinking about this some more, and think that since I have Hue Lights in 3 of the 4 room, to try a different take on 4 button scene control.

In the past, I has the LED have the following control for a 4 button scene controller:

  • Scene 1 On - Day/Night Auto Scene (Bedtime, Motion Deactivated)

  • Scene 1 Off - Room Off (Re-Activate Motion)

  • Scene 2 On - Bright Scene (Disables Motion Sensor from turning light off after 15 minutes)

  • Scene 2 Off - Super Bright Scene (Disables Motion Sensor from turning light off after 15 minutes)

  • Scene 3 On - All Lights Off but TV (Disables Motion Sensor from turning light off after 15 minutes)

  • Scene 3 Off - Colored Hue Light Purple (Disables Motion Sensor from turning light off after 15 minutes)

  • Scene 4 On - TV On

  • Scene 4 Off - TV Off (TV comes on automatically except at bedtime)

However, using PLEG states, I was going to try to add more customization to a scene controller, I was thinking of trying something like:

Scene 1 Button - Step through PLEG States

  • Motion On (LED ON and TV Auto On)
  • Motion Off for 3 Hours (LED Off)

Note - Motion Auto Disabled when Bedtime Virtual Switch Activated.

Scene 2 Button - Step through PLEG States

  • Dim
  • Medium
  • Bright
  • Lights Off
  • Super Dim (Night Light)

Based on Wakeup, Day, Night, Bedtime…and maybe some light sensor readings on phase 2…it will choose the best brightness level.

Scene 1 Button - Step through PLEG States

  • Hue Preset 1
  • Hue Preset 2
  • Hue Preset 3
  • Hue Preset 4
  • Hue Preset 5
  • Hue Preset 6

Scene 3 Button - Step through PLEG State

  • TV On
  • TV Off

Will this work with the PLEG state logic?