Jump to content

Easier way to determine if one of multiple switches are switched on


mapeter

Recommended Posts

Does anyone have a clever way to simplify the if statement below?  I would love it if a scene name containing the devices could be specified, then if any device in the scene is switched off, the program would be triggered.  Listing out all of the devices like I have below means that I have to remember to modify the program whenever the associated scene is updated.

Thanks!

--Andy

If
        Control 'Devices / Foyer / Front Lights FOY_KPL' is switched Off
     Or Control 'Devices / Master Bathroom / Front Light Slave MBA_KPL2' is switched Off
     Or Control 'Devices / Mud Room / Front Lts Slave MUD_KPL' is switched Off
     Or Control 'Devices / Garage / Front Outside Lights Slave' is switched Off
     Or Control 'Devices / Basement / Front Lights Slave BAS_KPL' is switched Off
 
Then
        -- some action to take --
 
Else
   - No Actions - (To add one, press 'Action')
 
Link to comment

Not really.

 

An option is: If you have them all connected in a scene, and they all consistently switch off together, ideally you should only have to check the status of one of them.. e.g. they all go off if one goes off.

 

However, I'd leave it as is.

 

Paul

 

 

 

Does anyone have a clever way to simplify the if statement below?  I would love it if a scene name containing the devices could be specified, then if any device in the scene is switched off, the program would be triggered.  Listing out all of the devices like I have below means that I have to remember to modify the program whenever the associated scene is updated.

Thanks!

--Andy

If
        Control 'Devices / Foyer / Front Lights FOY_KPL' is switched Off
     Or Control 'Devices / Master Bathroom / Front Light Slave MBA_KPL2' is switched Off
     Or Control 'Devices / Mud Room / Front Lts Slave MUD_KPL' is switched Off
     Or Control 'Devices / Garage / Front Outside Lights Slave' is switched Off
     Or Control 'Devices / Basement / Front Lights Slave BAS_KPL' is switched Off
 
Then
        -- some action to take --
 
Else
   - No Actions - (To add one, press 'Action')
 
Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...