thedishking Posted December 19, 2013 Share Posted December 19, 2013 Hello! I am using an I/O Linc connected to an outdoor motion sensor to activate a program in the ISY. This is so I can turn a scene of lights on, as well as get an email when motion is detected. I have it working, but the problem is I get a large amount of emails (literally every second) when motion is being detected Can anyone help me "clean up my code"? I would like to get an email when motion is detected, and only if the timeout expires (lights turn off after 2 min), then send an email? The lights are working perfectly with my code, I am just getting too many emails. I have posted the picture of the code below. Thank you very much for any advice you can provide. thedishking Link to comment
Xathros Posted December 19, 2013 Share Posted December 19, 2013 Hello! I am using an I/O Linc connected to an outdoor motion sensor to activate a program in the ISY. This is so I can turn a scene of lights on, as well as get an email when motion is detected. I have it working, but the problem is I get a large amount of emails (literally every second) when motion is being detected Can anyone help me "clean up my code"? I would like to get an email when motion is detected, and only if the timeout expires (lights turn off after 2 min), then send an email? The lights are working perfectly with my code, I am just getting too many emails. I have posted the picture of the code below. Thank you very much for any advice you can provide. thedishking Define an integer variable: i.notificationDelay and set it's value to 0 Create a second program as follows: Program:NotificationDelay If i.notificationDelay=0 Then Send notification to 'email notification' Content 'Garage Outside Motion' i.notificationDelay=1 Run Program NotificationDelay (Else Path) Else wait 2 minutes i.notificationDelay = 0 Modify your original program by changing the line with the notification From: Send notification to 'email notification' Content 'Garage Outside Motion' to: Run Program NotificationDelay (If Path) This will notify you then prevent additional notifications until there has been no motion activity for 2 minutes. -Xathros Link to comment
thedishking Posted December 19, 2013 Author Share Posted December 19, 2013 Thank you VERY MUCH for the advice! I will give it a try tonight. thedishking Link to comment
thedishking Posted December 20, 2013 Author Share Posted December 20, 2013 THANK YOU Xathros! I REALLY appreciate your help!!!!! Your code worked perfect!!! Happy Holidays! thedishking Link to comment
Xathros Posted December 20, 2013 Share Posted December 20, 2013 Anytime. Happy to help. Happy holidays to you too! -Xathros Link to comment
Recommended Posts