wjoel Posted February 4, 2009 Posted February 4, 2009 I would like to run the Weather Module on a timely basis and send notification if the Weather reaches a certain temp. I would like to delay any repeat notification so that I don't get flooded with emails. Any tips on how to program this in a program. I know it must relate to the if statement. Current Logic which continues to run. If Module 'Climate' temperature <= 20 F' Then Send Notification All Wait 4 Hours
Sub-Routine Posted February 4, 2009 Posted February 4, 2009 I use one program that waits before sending the Notification. This way if the temperature is fluctuating emails aren't continually sent. That program is called by two other programs, one starts the timer and the other stops it. If you duplicate the Notification in the Else path you could have an email when it warms again. Program 'Temperature Warning' If - No Conditions - (To add one, press 'Schedule' or 'Condition') Then Wait 15 minutes Send Notification to All Else Wait 15 minutes Program 'Weather Cold' If Module 'Climate' Temperature < 20 °F And Program 'Temperature Warning' is False Then Run Program 'Temperature Warning' (Then Path) Else - No Actions - (To add one, press 'Action') When the temperature falls Only runs if it was warm during last check
Sub-Routine Posted February 4, 2009 Posted February 4, 2009 Program 'Weather Warm' If Module 'Climate' Temperature >= 20 °F And Program 'Temperature Warning' is True Then Run Program 'Temperature Warning' (Else Path) Else - No Actions - (To add one, press 'Action') When temperature rises Only runs if it was cold during last check Rand
Sub-Routine Posted February 6, 2009 Posted February 6, 2009 This is better. One program sends an email when the temperature falls below the target, and stays below, for 5 minutes, the other sends an email when the temperature rises above the target with the same 5 minute buffer. One email is titled Temperature Cold and the other Temperature Warm. Change the target temperatures if you like. I can't seem to place more than two Code boxes in a post so I created several posts. Program: Temperature Cold If - No Conditions - (To add one, press 'Schedule' or 'Condition') Then Wait 5 minutes Send Notification to All Else - No Actions - (To add one, press 'Action') Cold = True Warm = False Program: Temperature Warm If - No Conditions - (To add one, press 'Schedule' or 'Condition') Then Wait 5 minutes Send Notification to All Else - No Actions - (To add one, press 'Action') Warm = True Cold = False
Sub-Routine Posted February 6, 2009 Posted February 6, 2009 Program: Weather Cold If Module 'Climate' Temperature < 32 °F And Program 'Temperature Cold' is False Then Run Program 'Temperature Cold' (Then Path) Run Program 'Temperature Warm' (Else Path) Else - No Actions - (To add one, press 'Action') When the temperature falls Only runs if it was warm during last check
Sub-Routine Posted February 6, 2009 Posted February 6, 2009 Program: Weather Warm If Module 'Climate' Temperature >= 32 °F And Program 'Temperature Warm' is False Then Run Program 'Temperature Warm' (Then Path) Run Program 'Temperature Cold' (Else Path) Else - No Actions - (To add one, press 'Action') When it warms Only runs if it was cold during last check You can download the programs from here: Temperature.2009-02-06.10.53.39.zip. Unzip the file and Import it to your ISY Programs folder. Rand
burakk Posted February 7, 2009 Posted February 7, 2009 I use a flag program, named "email notice sent", which is changed to true (then path), when my monitoring program sends an email. However, the monitoring program will only send the email if notification flag is false. The flag is changed to false once a day during daily query... You could change the frequency of resetting the flag to false... For me once a day works good because my program monitors for conditions that can yield snow... Monitor: If Module 'Climate' Dew Point (less than) 32 °F And Module 'Climate' Humidity (more than) 75 % And Program 'flag - SnowTextSent' is False Then Send Notification to All Run Program 'flag - SnowTextSent' (Then Path) Else - No Actions - (To add one, press 'Action') Flag: (it's completely empty, just set to true or false by others)... If - No Conditions - (To add one, press 'Schedule' or 'Condition') Then - No Actions - (To add one, press 'Action') Else - No Actions - (To add one, press 'Action') The 3:00AM Query All program: If Time is 3:00:00AM Then Set Scene 'My Lighting' Query Run Program 'w - query thermostat' (Then Path) Run Program 'flag - SnowTextSent' (Else Path) Run Program 'flag-humidity mail sent' (Else Path) Else - No Actions - (To add one, press 'Action')
Recommended Posts