Jump to content

Any way to track duration of power outage?


chrishick

Recommended Posts

The cheapest way to do it is to put your ISY on a UPS.

 

Install the programs I wrote a few months ago that set variables to the time (hours and minutes).

 

Have a program that queries a reliable device every so often, like once per minute.

 

Then write a couple programs that set start of power outage to two variables (like $i.powerouthour, $i.poweroutminute) when the query first fails.  The same program enables a second and disables itself.  The second program writes the end of of power outage variables when the query succeeds (like $i.poweronhour, $i.poweronminute) and then that program re-enable the first program and disables itself.  Of course if the power goes on and off multiple times you will only get the last one.

 

Alternatively, you put your ISY and internet service on a UPS and have ISY send an email when the query fails and an email when the query first succeeds.  

Link to comment

I've search around but can't figure a way to do this. I know I can set a variable at midnight at count up every minute to track when the outage started, but I can't figure a way to get current time once the outage is over. Any ideas?

 

 

Sent from my iPad using Tapatalk

Have your program stuff the current time from your program, every update into the boot-up copy of a variable.. say $LastTimeRecorded. This is available with the "Init to" command.

 

When the ISY reboots have a program with it's "Run at startup" flag set that sends a notification to your email/SMS with the current time and the saved $LastTimeRecordedand let the receiver figure out the duration.

 

Once the notification is complete set an $Initialised variable as a flag that allows your time program to resume recording the time. It will be out of sync with real time. Perhaps several resync times per day could reduce the error times after a power failure. 

Link to comment

I wanted a email that said "power has been restored, it was out for xx minutes" but it sounds like there is no way to do that.

 

Those are both good work arounds though. The UPS would give me what I'm looking for, but not ready to go that route just yet for various reasons. I think I'll take Larry's suggestion and just send a email "The time is now hh:mm. The power went out at hh:mm" If there are multiple outages in the same day then it will be useless, but that rarely happens and this is really just a little toy so I can say "oh hey, the power was out for a hour today"

 

 

Sent from my iPad using Tapatalk

Link to comment

It would be nice if we could set a variable to the current time or date. I'll go find the suggestion thread and add that request.

 

 

Sent from my iPad using Tapatalk

Add your wants into one of the many existing threads requesting the same thing. It has been requested many times and promised as coming for almost a year that I have participated.

Link to comment

Here are 2 ways to set variables to the date.  I wrote both sets but feel that the second set is more elegant (the set in the forum, not the wiki).  I would read my wiki entry for the first set of programs as it will help you understand both sets.

 

http://forum.universal-devices.com/topic/13750-i-wrote-a-new-date-variable-program/?hl=date 

 

http://wiki.universal-devices.com/index.php?title=ISY-99i_Generic_Calendar_Using_Programs_and_Variables

 

Here are programs for setting the time to variables.(last post in this thread)

 

http://forum.universal-devices.com/topic/13295-variable-based-scheduling-of-programs/?hl=%2Bhour+%2Bminute&do=findComment&comment=109505

 

 

Having an email sent at power restore is nothing but writing a program that runs at boot that sends you an email.  The time the email was sent will be the time power was restored.  If you install the above programs and have it send you the value of the variables, for hour, minute, and date, you will see what time/date power went out.  The only trick is that if ISY manages to correct the time and date prior to sending the email, But I have some delays built into those programs that should prevent that.

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...