pjjameso Posted November 10, 2022 Posted November 10, 2022 I have a generator that exercises every Sunday at 1pm. Currently have voltage sensors that will trigger a program and send a message that generator is exercising (utility and generator voltage present), powering house (utility voltage zero generator 240), and utility power status (voltage present or not). All this is working perfectly. However in my old age I sometimes don’t remember to check if the generator exercised eg, did I get the message. What I would like is for a program to execute and send me a text IF the generator didn’t exercise as expected. Those dings on the phone do get my attention. Not sure how to go about testing if a state variable did not change at by certain point in time each week. Any thoughts? Thanks in advance.
MrBill Posted November 11, 2022 Posted November 11, 2022 I could write a program (or group of programs) if you'd tell me more than we know here. It would be helpful to see the program that sends the message that the generator is exercising. (right click the program name, choose Copy to Clipboard at the bottom of the choices, then paste into a forum message.) Does the state variable you mention already exist? if so, what are its possible values? What nodes exist? are the simply true or false? or voltages. If the exercise is always at 1PM Sunday, what time does it finish? What time will it be on Sunday when we know it's missed? Its not a big deal to do this, but you've included to little information to be helpful. I too would definitely prefer to be notified if it didn't happen rather than it did.
pjjameso Posted November 11, 2022 Author Posted November 11, 2022 Thank you MrBill, here we go... The generator is dumb in that you set the exercise time by pushing a toggle switch that starts the clock for the next run 7 days later at the same time (actually number of hours). So when we fall back or spring forward the time it runs changes by an hour. So perhaps instead of using the day of week and expected time to run we should just know the interval between runs is 7*24 hours. The generator runs for 20 minutes exercising each week. Exercise program works correctly and message is sent by checking state variable as follows: Exercise.SendMessage - [ID 0026][Parent 0025] If $sExercise.State is 1 Then Set 'Notification Controller / Service Pushover polyglot' Send Sys Short With Params To iphone Priority=Normal Format=Monospace Sound=Pushover (default) Retry=30 Expire=60 Else - No Actions - (To add one, press 'Action') There are a total of 18 programs that determine the generator/utility state(s). I have attached a screenshot of them. Here are the state variables
MrBill Posted November 12, 2022 Posted November 12, 2022 I'm assuming that excerise state is always 1 or 0, also assuming you want to keep the message that positive message that the exercise started then simply add an ELSE Exercise.SendMessage - [ID 0026][Parent 0025] If $sExercise.State is 1 Then Set 'Notification Controller / Service Pushover polyglot' Send Sys Short With Params To iphone Priority=Normal Format=Monospace Sound=Pushover (default) Retry=30 Expire=60 Else Wait 170 hours (24*7+2) Set 'Notification Controller / Service Pushover polyglot' ....... and whatever else to change the message to no exercise in the past 170 hours. When exercise becomes 1 again the Wait will be interrupted and the notification below will never be sent. Another similar method is a separate program: NoExercise.SendMessage - (Enable Run at Startup) If $sExercise.State is 0 Then Wait 170 hours (24*7+2) Set 'Notification Controller / Service Pushover polyglot' ....... and whatever else to change the message to no exercise in the past 170 hours. Else (none) This program assumes that $sExercise.State will be zero when the ISY starts up, and will immediate start waiting 170 hours. An advantage to this program is that the original program could effectively be disabled, with only No Excercise notifications being sent. Either way should be ok, I would prefer the second if it was mine.
MrBill Posted November 12, 2022 Posted November 12, 2022 one more thought, you might want to add a nag.... NoExercise.SendMessage - (Enable Run at Startup) If $sExercise.State is 0 Then Wait 170 hours (24*7+2) Repeat every 6 hours Set 'Notification Controller / Service Pushover polyglot' ....... and whatever else to change the message to no exercise in the past 170 hours. Else (none) Now if the 170 hours expires the messages will continue being sent every 6 hours until the generator is exercised. 1
pjjameso Posted November 12, 2022 Author Posted November 12, 2022 You are awesome, thank you very much! Will incorporate tomorrow. 1
Recommended Posts