Blackbird Posted May 15, 2016 Share Posted May 15, 2016 I think my previous thread was deleted but I have these two programs running to let me know if I left my door open and it works fine. Garage Man Door left open - [iD 0054][Parent 0050] If Status 'Garage Small Door-Opened' is On And Status 'Garage Small Door-Opened' is not Off Then Wait 2 minutes Send Notification to 'email' content 'Garage man door left open' Send Notification to 'Pushover' content 'Garage man door left open' Enable Program 'Garage Man Door repeat ' Run Program 'Garage Man Door repeat ' (Then Path) Else Disable Program 'Garage Man Door repeat ' Garage Man Door repeat - [iD 0058][Parent 0050] If - No Conditions - (To add one, press 'Schedule' or 'Condition') Then Repeat Every 30 seconds Send Notification to 'email' content 'Garage man door left open' Send Notification to 'Pushover' content 'Garage man door left open' Else - No Actions - (To add one, press 'Action') I want to use this program to disable the above programs for 20 minutes then re enable them and this does the trick. Disable Garage doors left open - [iD 005C][Parent 005B] If - No Conditions - (To add one, press 'Schedule' or 'Condition') Then Disable Program 'Garage Man Door left open ' Disable Program 'Garage Man Door repeat ' Disable Program 'Overhead Garage door left open' Disable Program 'Overhead Garage Door repeat' Wait 20 minutes Enable Program 'Overhead Garage Door repeat' Enable Program 'Overhead Garage door left open' Enable Program 'Garage Man Door repeat ' Enable Program 'Garage Man Door left open ' Else - No Actions - (To add one, press 'Action') The problem is after the 20 minutes are up, it re enables the "garage man door left open" program but if the door was still open at the time, it doesn't notify me again. How do I make it check if the door is open or not? Thanks Link to comment
KeviNH Posted May 15, 2016 Share Posted May 15, 2016 Have you tried putting a "RunIf garage man door left open' below the enable? Link to comment
Blackbird Posted May 15, 2016 Author Share Posted May 15, 2016 Have you tried putting a "RunIf garage man door left open' below the enable? If you say "run if" does that run the whole program or just the "if" section of the program? Link to comment
larryllix Posted May 15, 2016 Share Posted May 15, 2016 (edited) You should be able to simplify the first two programs into one simpler one. Then add the Run Program(If) line suggested by KeviNH above to restart the disabled sequence again. Garage Man Door left open - [iD 0054][Parent 0050] If Status 'Garage Small Door-Opened' is On <---off will run Else and stop Then And Status 'Garage Small Door-Opened' is not Off <---not required for status Then Wait 1 minutes 30 seconds Repeat for 9999 times Wait 30 seconds Send Notification to 'email' content 'Garage man door left open' Send Notification to 'Pushover' content 'Garage man door left open' Else ----- If you say "run if" does that run the whole program or just the "if" section of the program? It runs the If and depending on the outcome runs the Then or the Else section of code. Edited May 15, 2016 by larryllix Link to comment
Scottmichaelj Posted May 15, 2016 Share Posted May 15, 2016 So I am going to kind of hijack this thread some. Larryllix you taught me before how to run two programs, so I have been and have told others here like Blackbird to do it to help him. So are you saying for my programs below I could cut it down to one program now with those changes? First Program: Side Gate Left (Dog Run) If Elk Zone 'Side Gate (Dog)' is Violated And Elk Zone 'Side Gate (Dog)' is not Normal And Elk Area 'HOUSE' 'Armed State' is Disarmed Then Send Notification to 'Pushover' content 'Side Gate Notification' Enable Program 'Side Gate Left (Dog Run) [speak]' Run Program 'Side Gate Left (Dog Run) [speak]' (Then Path) Else Disable Program 'Side Gate Left (Dog Run) [speak]' Second Program: Side Gate Left (Dog Run) [speak] If - No Conditions - (To add one, press 'Schedule' or 'Condition') Then Repeat Every 10 seconds Set Elk Speak Word 'Front' Set Elk Speak Word 'Side' Set Elk Speak Word 'Gate' Set Elk Speak Word 'Open' Else - No Actions - (To add one, press 'Action') Side Gate Left (Dog Run) [speak] If Elk Zone 'Side Gate (Dog)' is Violated And Elk Zone 'Side Gate (Dog)' is not Normal And Elk Area 'HOUSE' 'Armed State' is Disarmed And Elk Area 'HOUSE' 'Armed State' is not Disarmed Then Repeat for 9999 times Repeat Every 10 seconds Set Elk Speak Word 'Front' Set Elk Speak Word 'Side' Set Elk Speak Word 'Gate' Set Elk Speak Word 'Open' Wait 10 seconds Send Notification to 'Pushover' content 'Side Gate Notification' Else ----- Link to comment
larryllix Posted May 16, 2016 Share Posted May 16, 2016 So I am going to kind of hijack this thread some. Larryllix you taught me before how to run two programs, so I have been and have told others here like Blackbird to do it to help him. So are you saying for my programs below I could cut it down to one program now with those changes? <crazy stuff snipped> Side Gate Left (Dog Run) [speak] If Elk Zone 'Side Gate (Dog)' is Violated And Elk Zone 'Side Gate (Dog)' is not Normal And Elk Area 'HOUSE' 'Armed State' is Disarmed And Elk Area 'HOUSE' 'Armed State' is not Disarmed Then Repeat for 9999 times Repeat Every 10 seconds Set Elk Speak Word 'Front' Set Elk Speak Word 'Side' Set Elk Speak Word 'Gate' Set Elk Speak Word 'Open' Wait 10 seconds Send Notification to 'Pushover' content 'Side Gate Notification' Else ----- In this case I believe there is no reason not to combine the programs. Usually two programs are required when there are conditions we don't want to stop the programs line, no matter what. If trigger stimuli, Then run program2 Program2: (disabled) If 'another condition we want to test but not ever stop execution' Then 'don't stop code lines' This is common with time frames where we don't want the end time to stop Then in the middle. --------------------------------- Anther case is where we want to check for a specific sequence of events. We don't want the program2 running unless the dryer is started first. If Dryer is On, Then Wait 4 minutes, Enable Program2 Program2:(disabled) If Dryer is Off, Then Notify Wife 'Get clothes out now!', DIsable self again ------------------------------- So this should work If Elk Zone 'Side Gate (Dog)' is Violated And Elk Zone 'Side Gate (Dog)' is not Normal And Elk Area 'HOUSE' 'Armed State' is Disarmed And Elk Area 'HOUSE' 'Armed State' is not Disarmed Then Send Notification to 'Pushover' content 'Side Gate Notification' Repeat for 9999 times <---double repeat corrected Set Elk Speak Word 'Front' Set Elk Speak Word 'Side' Set Elk Speak Word 'Gate' Set Elk Speak Word 'Open' Wait 10 seconds Else ----- Link to comment
Blackbird Posted May 17, 2016 Author Share Posted May 17, 2016 You should be able to simplify the first two programs into one simpler one. Then add the Run Program(If) line suggested by KeviNH above to restart the disabled sequence again. Garage Man Door left open - [iD 0054][Parent 0050] If Status 'Garage Small Door-Opened' is On <---off will run Else and stop Then And Status 'Garage Small Door-Opened' is not Off <---not required for status Then Wait 1 minutes 30 seconds Repeat for 9999 times Wait 30 seconds Send Notification to 'email' content 'Garage man door left open' Send Notification to 'Pushover' content 'Garage man door left open' Else ----- It runs the If and depending on the outcome runs the Then or the Else section of code. Seems to work good. Thanks Link to comment
Recommended Posts