bbrally Posted March 12, 2013 Posted March 12, 2013 I'm trying to write a program where the condition is the on or off of any the switchlincs in the house. Is there a better way of testing this condition other than an "or" statement for every on or off command such as below? I have so many switches that this seems rediculous. If Control 'Basement' is switched Off Or Control 'Basement' is switched On Or Control 'Basement slave' is switched Off Or Control 'Basement slave' is switched On Or Control 'Den' is switched Off Or Control 'Den' is switched On Or Control 'Den slave' is switched Off Or Control 'Den slave' is switched On Or Control 'Dining Area' is switched Off Or Control 'Dining Area' is switched On Or Control 'Fireplace' is switched Off Or Control 'Fireplace' is switched On etc.... etc.... etc....
LeeG Posted March 12, 2013 Posted March 12, 2013 That is the way it is done. Note that If Control is looking for an Off command from each device. It sounds like you want to know if a device is On or Off which is determined by If Status.
bbrally Posted March 12, 2013 Author Posted March 12, 2013 That's a lot of conditions...... I'm wanting to test if a switch has been pressed, on or off. The if control seems to be working for that. Thanks for the confirmation.
Xathros Posted March 12, 2013 Posted March 12, 2013 I have a "Control event detection" routine as part of my occupancy programs. This is exactly how it works. Lots of If Control Switched..." statements ored together. Nasty to look at but seems to function just fine. I have two lines for most switches (On/Off) and four lines each for a few dimmers that see fade up/down regularly. -Xathros
bsobel Posted March 13, 2013 Posted March 13, 2013 FYI I've asked (in the programming improvements area in the past) for the ability to write a program like this based on a scene and have the ISY internally 'break it out' into the list of individual devices (so that if you update the scene membership the program would automatically update). E.g. is control 'All Light Switch Scene' is on and internally the ISY would generate a list much like what you wrote above. We shall see if it is considered...
Michel Kohanim Posted March 13, 2013 Posted March 13, 2013 Thank you. #84, priority low. With kind regards, Michel
Recommended Posts