Nehsmit Posted August 29, 2019 Share Posted August 29, 2019 Im trying to program a light to turn on with certain motion and shut off 10 minutes later. I know how to get the light on and off but cant figure out how and where to insert" after 10 minutes turn off light". Any help is appreciated. Thank you Quote Link to comment Share on other sites More sharing options...
msgreenf Posted August 29, 2019 Share Posted August 29, 2019 when motion occurs --> start a timer. When timer starts --> turn on lights. When timer expires turn off lights Quote Link to comment Share on other sites More sharing options...
dcovach Posted August 29, 2019 Share Posted August 29, 2019 Another counter intuitive way that is taught at dealer training... Create a 10 minute timer using the timer agent When motion occurs -->stop that timer, turn on lights When motion stops --> start that timer When that timer expires --> turn off lights dannyboy 1 Quote Link to comment Share on other sites More sharing options...
Kahn Posted August 31, 2019 Share Posted August 31, 2019 On 8/29/2019 at 9:08 AM, dcovach said: Another counter intuitive way that is taught at dealer training... Create a 10 minute timer using the timer agent When motion occurs -->stop that timer, turn on lights When motion stops --> start that timer When that timer expires --> turn off lights OK - I'm curious why a timer needs to be stopped first? I get the "when motion stops" starting the timer..... Quote Link to comment Share on other sites More sharing options...
dcovach Posted August 31, 2019 Share Posted August 31, 2019 10 minutes ago, Kahn said: OK - I'm curious why a timer needs to be stopped first? I get the "when motion stops" starting the timer..... It doesn't necessarily stop first. I just happened to write that line first. Each line is spread out in 3 different places. This type of programming is starting a timer when no motion is detected. Every time it detects motion the timer stops. Quote Link to comment Share on other sites More sharing options...
Nehsmit Posted August 31, 2019 Author Share Posted August 31, 2019 So I just wrote 3 lines: Start light Delay 10 minutes Stop light. Works perfect without issue. Quote Link to comment Share on other sites More sharing options...
Kahn Posted August 31, 2019 Share Posted August 31, 2019 I think you should consider the timer - it's actually the best way. msgreenf 1 Quote Link to comment Share on other sites More sharing options...
Nehsmit Posted August 31, 2019 Author Share Posted August 31, 2019 Just now, Kahn said: I think you should consider the timer - it's actually the best way. Can you explain why? What's the difference? Quote Link to comment Share on other sites More sharing options...
msgreenf Posted August 31, 2019 Share Posted August 31, 2019 Timers are more efficient then delays Sent from my Pixel 3a XL using Tapatalk Quote Link to comment Share on other sites More sharing options...
dcovach Posted August 31, 2019 Share Posted August 31, 2019 A "delay" will halt any programming below that line until the delay is complete. Consider it like a pause. Not a big deal for what you're doing but it's not really the best way to use a delay. Programming continues to run below any code using timers The programming I showed several conversations above is your typical "occupancy timer" for motion. Delays have better use cases in programming. msgreenf 1 Quote Link to comment Share on other sites More sharing options...
Nehsmit Posted August 31, 2019 Author Share Posted August 31, 2019 A "delay" will halt any programming below that line until the delay is complete. Consider it like a pause. Not a big deal for what you're doing but it's not really the best way to use a delay. Programming continues to run below any code using timers The programming I showed several conversations above is your typical "occupancy timer" for motion. Delays have better use cases in programming.Point taken. Thank you for the clarification. Sent from my iPhone using Tapatalk Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.