UD2)17rrh Posted December 26, 2023 Posted December 26, 2023 I think I have it correct. The Wireless Tag motion senses motion and the light turns on. All good to this point. But the light does not turn off. Why is the code wrong? Thanks for the advice. Utility Room Motion If 'Wireless Tags / Utility Room Sensor' Event State is Detected Movement Then Set 'Basement / Utility Room' On Wait 15 minutes Set 'Basement / Utility Room' Off Else - No Actions - (To add one, press 'Action')
paulbates Posted December 26, 2023 Posted December 26, 2023 If the tag turns off before 15 minutes, the program stops running.. is likely the cause. Try putting the actions in a separate program, and change the 'then' of the current program to run the new program. The new program should have no 'if' statement 1
paulbates Posted December 26, 2023 Posted December 26, 2023 Here's a more elegant one program version that came up on my drive back home from family Christmas If 'Wireless Tags / Utility Room Sensor' Event State is Detected Movement Then Set 'Basement / Utility Room' On Else Wait 15 minutes Set 'Basement / Utility Room' Off
UD2)17rrh Posted December 30, 2023 Author Posted December 30, 2023 (edited) On 12/26/2023 at 4:17 PM, paulbates said: Here's a more elegant one program version that came up on my drive back home from family Christmas If 'Wireless Tags / Utility Room Sensor' Event State is Detected Movement Then Set 'Basement / Utility Room' On Else Wait 15 minutes Set 'Basement / Utility Room' Off Thanks for the thoughts. I will give the latter idea a try. Does it matter at all if the tag continually senses motion and keeps sending an on signal to the switch? Would use of a variable program help here? Edited December 30, 2023 by UD2)17rrh
Solution Goose66 Posted December 30, 2023 Solution Posted December 30, 2023 (edited) Cleanest solution here (and just about all other instances with motion/presence triggering events and timed activities) is the two program solution: First program: Utility Room Motion (Enabled) If 'Wireless Tags / Utility Room Sensor' Event State is Detected Movement Then Run Program 'Utility Room Lights on Motion' (Then Path) Else - No Actions - (To add one, press 'Action') Second program: Utility Room Lights on Motion (Disabled) If - No Conditions - Then Set 'Basement / Utility Room' On Wait 15 minutes Set 'Basement / Utility Room' Off Else - No Actions - (To add one, press 'Action') When the Wireless tag sends movement, the first program starts the second program, and the second program turns on the lights, starts the timer, and turns off the lights when the timer expires. Subsequent motion from the Wireless tag turns the lights on again and resets the timer. 15 minutes after the last motion detected, the lights turn off. An advantage to this structure is that it works whether or not your Wireless Tag (or other motion detector) sends a DOF (No Motion) command after some delay. Edited December 30, 2023 by Goose66 3
dbwarner5 Posted December 30, 2023 Posted December 30, 2023 (edited) On 12/26/2023 at 1:07 PM, paulbates said: If the tag turns off before 15 minutes, the program stops running.. is likely the cause. To further explain this, read this wiki. https://wiki.universal-devices.com/ISY-99i/ISY-26_INSTEON:Scope,_Precedence_and_Execution_Order#Statement_Execution_Order Whenever a WAIT is encountered, the IF is re-evaluated. In your program case, the if then becomes false so the program runs the else and never gets to the last command. @Goose66 is indeed the cleanest and most strait-forward approach and one I use all the time. Edited December 30, 2023 by dbwarner5 fixed error.. "encountered replaced completed 1
UD2)17rrh Posted December 31, 2023 Author Posted December 31, 2023 8 hours ago, Goose66 said: Cleanest solution here (and just about all other instances with motion/presence triggering events and timed activities) is the two program solution Thank-you!
UD2)17rrh Posted December 31, 2023 Author Posted December 31, 2023 8 hours ago, dbwarner5 said: To further explain this, read this wiki. https://wiki.universal-devices.com/ISY-99i/ISY-26_INSTEON:Scope,_Precedence_and_Execution_Order#Statement_Execution_Order Whenever a WAIT is encountered, the IF is re-evaluated. In your program case, the if then becomes false so the program runs the else and never gets to the last command. @Goose66 is indeed the cleanest and most strait-forward approach and one I use all the time. Thank-you and bookmarked the how-to guide. Thanks for sending.
Recommended Posts