marcin Posted June 6, 2015 Posted June 6, 2015 I trying to write a program to control my lights, and after unsuccessful attempts I decided to seek help from forum members. This is what I’m trying to accomplish if the light is “on” in the office, and motion sensor (located in the office) is normal then wait three minutes and run another program to double check that motion sensor is still normal if its normal then wait three minutes and turn the light off, but if the motion sensor is “trouble” then leave the lights on. This is what I have so far any help would be greatly appreciated. OFFICE - Check - [ID 0019][Parent 0018][Not Enabled] If Status 'Office / 01 Office Main Light' is 100% And Elk Zone 'OFFICE MOTION SE' is Normal Then Wait 3 minutes Enable Program 'OFFICE - Light Off' Else - No Actions - (To add one, press 'Action') and here is the check program: OFFICE - Light Off - [ID 001B][Parent 0018][Not Enabled] If Elk Zone 'OFFICE MOTION SE' is Normal Then Wait 1 minute Set 'Office / 01 Office Main Light' 1 (Beep Duration) Wait 1 minute Set 'Office / 01 Office Main Light' Off Set 'Office / 02 Office Desk Light' Off Else Run Program 'OFFICE - Check' (If)
marcin Posted June 6, 2015 Author Posted June 6, 2015 I forgot to mention that the reason why I want my program to wait three minutes is due to wireless sensors that after they detect the motion they go to ”sleep” for three minutes.
Michel Kohanim Posted June 8, 2015 Posted June 8, 2015 Hi Marcin, If you want to use two programs (I still do not know why), then after Enable Program xx you should also call Run If on the same program. i.e. Enabling a program might not actually cause to evaluate again. With kind regards, Michel
Recommended Posts