silverton38 Posted October 18, 2012 Posted October 18, 2012 I am trying to create a program that will turn off the house if none of my motion sensors receive motion for 24 hours. How should I create such a program?
apostolakisl Posted October 18, 2012 Posted October 18, 2012 Put all the devices in your house that you want to turn off into a single scene. Write a program that includes all of your motion detectors connected by "or" in the if section. Write a then statement that starts with "wait 24 hours" then sets that scene off.
ISYhbsh01 Posted October 19, 2012 Posted October 19, 2012 Since in my area it's quite common to have milliseconds long power outages, I have always in mind that possibility when making a program and I try to address it. In this case, what would you suggest to make it power failure proof? I thought to have the same "wait for 24 hours then off" in the else clause & then make the program run at startup. What do you say? Sent from my SPH-D710 using Tapatalk 2
oberkc Posted October 19, 2012 Posted October 19, 2012 What do you say? Power your ISY (not the PLM) via UPS?
apostolakisl Posted October 19, 2012 Posted October 19, 2012 What do you say? Power your ISY (not the PLM) via UPS? ISY only uses like 7 watts. So it can run all day on one of those.
Illusion Posted October 19, 2012 Posted October 19, 2012 viewtopic.php?t=2673 Sent from my iPhone using Tapatalk
apostolakisl Posted October 19, 2012 Posted October 19, 2012 If you are concerned with ISY not knowing that a power outage occurred, you can write a script on a computer that posts a variable to ISY on reboot. Of course you need the computer set to reboot with power restoration. The variable could say be set to 1 by the script. When that happens an iSY program could trigger a query and then reset the variable to 0.
Xathros Posted October 19, 2012 Posted October 19, 2012 silverton38- I have a series of programs that handle occupancy detection for me. Pretty sure they will survive a power outage for the most part. Here is how it works: State mvar for detection delay. In my case 45 minutes, in yours, 24 hours. First program monitors motion sensors and a list of switch try devices. Idea here is in the areas with no motion detection, someone operating a switch says occupied as well. When any activity is detected, the detection delay mvar gets reset to 45 (24 for yours) Second program says if detection delay >0, set detection delay mvar init to detection delay mvar, wait 1 minute (1 hr for you) and subtract 1. This restarts the 1 minuet (hour) timer since the state var changes. The set init is the part that solves for power outages. Set this to run at startup. Third program runs on detection delay mvar reaching 0. This is where you turn off your scene. Then set the delay mvar < 0 to disable till next detection. Prog#1 If motion detected then s.occupancyDelay = 45 Prog#2 if s.occupancyDelay > 0 then s.occupancyDelay InitTo s.occupancyDelay wait 1 s.occupancyDelay =- 1 Prog#3 if s.occupancyDelay = 0 then Set scene MostLights Off s.occupancyDelay InitTo -1 s.occupancyDelay = -1 Hope this helps. My progs are a bit more involved as I'm tracking occupancy statistics as well but this should meet your needs.
ISYhbsh01 Posted October 19, 2012 Posted October 19, 2012 Thanks for all the suggestions. However there are several types of Insteon devices which revert to an off state after a power failure. I have made ISY programs for those devices to make them go back to the state they were before the power outage. In order for this to work the ISY has to know that a power failure occured. So I rather don't have the ISY on a UPS, and just design all my programs in such a way with the possibilty of a power failure in mind. Sent from my SPH-D710 using Tapatalk 2
silverton38 Posted October 19, 2012 Author Posted October 19, 2012 Thank You very much for this program. It is exactly what I am looking for. I entered the program pretty much as you listed. I do notice the the second and third program do not seem to run unless I right click "RUN(if)". silverton38- I have a series of programs that handle occupancy detection for me. Pretty sure they will survive a power outage for the most part. Here is how it works: State mvar for detection delay. In my case 45 minutes, in yours, 24 hours. First program monitors motion sensors and a list of switch try devices. Idea here is in the areas with no motion detection, someone operating a switch says occupied as well. When any activity is detected, the detection delay mvar gets reset to 45 (24 for yours) Second program says if detection delay >0, set detection delay mvar init to detection delay mvar, wait 1 minute (1 hr for you) and subtract 1. This restarts the 1 minuet (hour) timer since the state var changes. The set init is the part that solves for power outages. Set this to run at startup. Third program runs on detection delay mvar reaching 0. This is where you turn off your scene. Then set the delay mvar < 0 to disable till next detection. Prog#1 If motion detected then s.occupancyDelay = 45 Prog#2 if s.occupancyDelay > 0 then s.occupancyDelay InitTo s.occupancyDelay wait 1 s.occupancyDelay =- 1 Prog#3 if s.occupancyDelay = 0 then Set scene MostLights Off s.occupancyDelay InitTo -1 s.occupancyDelay = -1 Hope this helps. My progs are a bit more involved as I'm tracking occupancy statistics as well but this should meet your needs.
apostolakisl Posted October 19, 2012 Posted October 19, 2012 Thank You very much for this program. It is exactly what I am looking for. I entered the program pretty much as you listed. I do notice the the second and third program do not seem to run unless I right click "RUN(if)". You need to use "State" variables. State variables trigger the if to run every time they change. You probably are using integer variables. And as mentioned, the second program needs to be set to run at startup to get the ball rolling again after a power failure.
silverton38 Posted October 22, 2012 Author Posted October 22, 2012 Thank You everyone; you have been very helpful. I ending up creating the three programs and using time as the trigger.
apostolakisl Posted October 22, 2012 Posted October 22, 2012 Not sure what you mean by used "time" as a trigger. But the 3 program example above would not function properly if you used a time to trigger it. It is designed to start counting down when the motion detector trips and to continue counting down after a power failure by having the second program run at startup.
Recommended Posts