rana Posted May 13, 2013 Share Posted May 13, 2013 What is the best way to code this situation? When I’m away and a switch is turned on or off to send me a notification. I’m hoping I don’t have to program each switch individually. I’m sure there is a better and easier way of doing this Link to comment
LeeG Posted May 13, 2013 Share Posted May 13, 2013 The status of each node has to be tested individually. Link to comment
arw01 Posted May 13, 2013 Share Posted May 13, 2013 you just list them all with an or between them. One program, all the switches listed. if control switch_1 is switched on or control switch_1 is switched off or control switch_2 is switched on or control switch_3 is switched off etc etc Link to comment
oberkc Posted May 14, 2013 Share Posted May 14, 2013 punctuation and capitalization please it makes it easier to read Link to comment
rana Posted May 15, 2013 Author Share Posted May 15, 2013 here is my code but its now working the way i wanted it to If $OCCUPIED is 0 or Status 'Motion Sensors / Laundry Motion Sensors-Sensor' is On or Control 'Backyard1' is switched On or Control 'Backyard1' is switched Off or Control 'Backyard2' is switched On or Control 'Backyard2' is switched Off or Control 'Front Door' is switched On or Control 'Front Door' is switched Off or Control 'Master Bath Room' is switched On or Control 'Master Bath Room' is switched Off Then Send Notification to 'TXT MSG All' content 'home is OCCUPIED ' Else - No Actions - (To add one, press 'Action') The problem is i get msg when i'm at home. i was hoping to get msg when im alway not all the time Link to comment
LeeG Posted May 15, 2013 Share Posted May 15, 2013 This is only a guess since the content of the variable is not described. If $OCCUPIED is 0 And ( or Status 'Motion Sensors / Laundry Motion Sensors-Sensor' is On or Control 'Backyard1' is switched On or Control 'Backyard1' is switched Off or Control 'Backyard2' is switched On or Control 'Backyard2' is switched Off or Control 'Front Door' is switched On or Control 'Front Door' is switched Off or Control 'Master Bath Room' is switched On or Control 'Master Bath Room' is switched Off ) Then Send Notification to 'TXT MSG All' content 'home is OCCUPIED ' Link to comment
oberkc Posted May 16, 2013 Share Posted May 16, 2013 Like LeeG, I am also unsure how your variable is controlled. Is it an integer or state variable? How does it change value? You say I believe you are on the right track, however. Link to comment
rana Posted May 16, 2013 Author Share Posted May 16, 2013 thank you LeeG that worked The state variable is updated by my router. im running this proximity script http://forum.universal-devices.com/viewtopic.php?f=51&t=9854&hilit=proximity Link to comment
Recommended Posts