doug95630 Posted June 27, 2015 Posted June 27, 2015 I'd like to make a program that monitors the roll up garage door (io linc) and the entry door into the house (Elk), then turn on a light so I never have to come home to a dark house. Once I get the basics, I'll add sunrise/sunset so it only activates at night. Couple problems. I'd like the Garage Door Sensor (roll-up) to trigger watching that the Elk Zone 'Garage Door' (garage into house). The way this is written, both need to be true, but I could walk into the garage from outside, close the big door behind me and not trigger a 'True' state. Also, I do not want to turn on a light because an occupant opens the door to a garage. So, both doors need open to run the Then commands. Is there a way to look at one sensor, see a trigger condition, then look at another sensor fo rthe second trigger condition, while the first sensor closes? Also, if one of the doors close before the 15 minute period, the entry light never turns off. Program returns to a false state. If Status 'Garage Door Sensor' in not On And Elk Zone 'Garage Door' is violated #elk zone 'garage door' is the door from garage to house Then Set Scene 'Entry Light' On Wait 15 Minutes Set Scene 'Entry Light' Off Else - No Action Thanks. Doug
oberkc Posted June 27, 2015 Posted June 27, 2015 (edited) Is there a way to look at one sensor, see a trigger condition, then look at another sensor fo rthe second trigger condition, while the first sensor closes? There is no doubt in my mind that there is a way. Unfortunately, I am unsure that I grasp what problem you are trying to solve. Furthermore, sensors are either open or closed. There is no such status as "while closing", so we have to work within the framework available. So, to put in different words....You want a program (or programs) to start watching for the entry door to trigger an action (turn on lights), but watch for that trigger only when the roll-up door is open, and for a short period after the roll-up door closes? Is this correct? Furthermore, once triggered, you want the lights to turn off after 15 minutes, unless one of the doors subesquently closes. Correct? As extra credit, additionally limit this trigger to times between sunrise and sunset? At a conceptual level, I think my solution would probably include logic such as: if time is sunset to sunrise (next day) and roll-up is open then watch for triggers (likely achieve by enabling trigger program or program folder, or using a variable) else wait short period (to allow for a period after door closes, ie "while closing") stop watching for triggers (likely achieve by disabling trigger program or program folder, or a variable) run trigger program (else path) (to halt 15 minute period when the roll-up door closes) the logic for the trigger program (enabled or disabled by the program above): if status of entry door is open (status used to halt 15 minute wait period if door is closed) turn on lights wait 15 minutes turn off lights else nothing Hopefully, this will give you some ideas. One problem you will have to consider is what you want to happen at sunrise if you happen to be in one of your 15 minute wait periods. The logic, above, would halt the wait and leave on the lights. Edited June 27, 2015 by oberkc
doug95630 Posted June 28, 2015 Author Posted June 28, 2015 I'm going to scrap the idea of delayed trigger. It is not needed. The light comes on as I walk into the house as the garage door sensor AND the house door sensor are open. Problem I have is that the WAIT 15 to turn off the light did not work. Reason is that as both doors become closed, the program AND state is no longer true. The program stopped before the wait period was over. I added a second program so that when the trigger condition occured, it starts the second program 'wait 15' and it no longer matters what happens to the 1st program conditions. Now I need to figure how to set it up to run only when dark. Program Lighted Entry: If Status 'Garage Door Sensor' in not On And Elk Zone 'Garage Door' is violated #elk zone 'garage door' is the door from garage to house Then Set Scene 'Entry Light' On Run Program 'Off in 15' (if) Else - No Action ~~~~~~~~~~~~~~ Program Off in 15: If Nothing Then Wait 15 Minutes Set Scene 'Entry Light' Off Else Nothing
G W Posted June 28, 2015 Posted June 28, 2015 (edited) Change program 1 to only run program 2. Remove the then statements. Change program 2 to turn on lights, wait 15, then turn off lights. Sent from my SM-N900P using Tapatalk Edited June 28, 2015 by GaryFunk
doug95630 Posted June 30, 2015 Author Posted June 30, 2015 Done. I also added the sunrise/sunset condition. Kinda cool that it works. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lighted Entry - [iD 0003][Parent 0001]If From Sunset To Sunrise (next day) And Status 'Garage Door-Sensor' is not On And Elk Zone 'Garage Door' is Violated Then Run Program 'Entry for 15' (If) Else - No Actions - (To add one, press 'Action') ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Entry for 15 - [iD 0004][Parent 0001]If - No Conditions - (To add one, press 'Schedule' or 'Condition') Then Set Scene 'Entry Light' Fast On Wait 15 minutes Set Scene 'Entry Light' Fade Down Else - No Actions - (To add one, press 'Action')
G W Posted June 30, 2015 Posted June 30, 2015 Once you understand the concept of triggers and programs it's easy. Sent from my SM-N900P using Tapatalk
LeeG Posted June 30, 2015 Posted June 30, 2015 (edited) There should be a Fade Stop after the Fade Down. Hardware always sends that command when a button/paddle/toggle is released after starting a Fade Up or Fade Down. Some devices will not react well if they do not see the Fade Stop. Entry for 15 - [iD 0004][Parent 0001]If - No Conditions - (To add one, press 'Schedule' or 'Condition') Then Set Scene 'Entry Light' Fast On Wait 15 minutes Set Scene 'Entry Light' Fade Down Wait 5 seconds Set Scene 'Entry Light" Fade Stop Else - No Actions - (To add one, press 'Action') Edited June 30, 2015 by LeeG
larryllix Posted June 30, 2015 Posted June 30, 2015 Now that your thinking logic fog is clearing it is easy to see how this can be simplified back into one program, if desired. Lighted Entry - [iD 0003][Parent 0001] If From Sunset To Sunrise (next day) And Status 'Garage Door-Sensor' is not On And Elk Zone 'Garage Door' is Violated Then Set Scene 'Entry Light' Fast On Wait 15 minutes Set Scene 'Entry Light' Fade Down Wait 5 seconds Set Scene 'Entry Light' Fade Stop Else - No Actions - (To add one, press 'Action').
Recommended Posts