Jump to content

Boot-Time Notification?


johnmsch

Recommended Posts

Posted

I'd like to setup a notification whenever my ISY994i boots, like after a power failure.

 

I'm assuming I can create a program that will activate at boot time, but just can't figure out what the "If" statement should be checking for.

 

Thanks

Posted

Leave the "if" blank. I generally put a "Wait 2 mins" before sending the notification to allow the ISY time to complete it's boot up and query devices.

Posted
This program checks to ensure the ISY Series Controllers clock is still accurate and NTP was successful.

 

Time Check - [iD 02A0][Parent 012A]

 

If

        Time is 12:00:00AM

 

Then

        Send Notification to 'GMX' content 'ISY - Clock Check'

 

Else

   - No Actions - (To add one, press 'Action')

 

============================================================

============================================================

 

Create one *Integer* variable and copy this program. This program will tell you how long (up time) the ISY Series Controller has been running for. Upon reboot the ISY Series Controller will send you the total hours the device has been running for. You will of course need to create a custom email so you can see the value(s).

 

Much credit for this outstanding program goes to my partner in crime the all mighty Xathros. 

 


ISY Uptime - [iD 0265][Parent 012A][Run At Startup]

 

If

   - No Conditions - (To add one, press 'Schedule' or 'Condition')

 

Then

        Send Notification to 'GMX' content 'ISY - Uptime Counter'

        Wait  1 minute 

        $i.ISY_Uptime_Counter  = 0

        $i.ISY_Uptime_Counter Init To 0

        Run Program 'ISY Uptime' (Else Path)

 

Else

        Wait  1 hour 

        $i.ISY_Uptime_Counter += 1

        $i.ISY_Uptime_Counter Init To $i.ISY_Uptime_Counter

        Run Program 'ISY Uptime' (Else Path)

 

This program will track the ISY Series Controllers operating uptime.It will increment every 

hour the controller is running. A e-mail will be sent upon the ISY being rebooted. This program

is set to run at start up and this is how it knows the controller has been rebooted.

 

The (init) value is set to (0) zero so it knows the system has been rebooted.

 

Posted

Thanks Teken/Xathros!  That's pretty slick.

 

While I will add that program, I'm still back to my original question.  How to get it to run at startup?  I see in the example above "[Run At Startup]", but I can't see where that would be declared.

 

No doubt I'm missing something obvious...

Posted

Thanks Teken/Xathros!  That's pretty slick.

 

While I will add that program, I'm still back to my original question.  How to get it to run at startup?  I see in the example above "[Run At Startup]", but I can't see where that would be declared.

 

No doubt I'm missing something obvious...

In the program summary tab you can right click on any program and see the option in the falldown menu.

Posted

Got it.  Thanks.

 

Couple more questions please.

 

For the Time Check program, how does sending that notification confirm the NTP sync was successful?

 

I'm assuming your "GMX" notification is an email?  Would you mind sharing the contents of your 'ISY - Clock Check' and 'ISY - Uptime Counter' notifications?  Just wondering how they were setup.

 

Always love learning new things about the ISY and the tips/tricks I learn here.

Posted

Got it.  Thanks.

 

Couple more questions please.

 

For the Time Check program, how does sending that notification confirm the NTP sync was successful?

 

I'm assuming your "GMX" notification is an email?  Would you mind sharing the contents of your 'ISY - Clock Check' and 'ISY - Uptime Counter' notifications?  Just wondering how they were setup.

 

Always love learning new things about the ISY and the tips/tricks I learn here.

 

NTP: When the ISY Series Controller sends you the email for what ever time you have defined. It will indicate the system time along with the email time stamp. If there was a time drift at all or the NTP sync did not complete the email will show the variance in time.

 

Mine is set to email me at 12:00 AM CST the worst drift I have seen is one second and that is easily explained by the fact I have 25 plus programs running at that time completing calculations and emailing the same to me for daily review.

 

Time Check: The subject simply states: *ISY Time Check / Test*

 

The body of the message is: ${sys.date}/${sys.time24}

 

Uptime Counter: The subject states: WARNING: ISY Uptime Counter Reset

 

The body of the message is: 

 

This message is being generated because the ISY has been rebooted. 
The following is the uptime hours the ISY has been operating since ${sys.time} reboot: ${var.1.330} Hours.
 
Please let me know if you require more insight or feedback . . .
  • Like 1
Posted (edited)

Just to complicate things....

 

I send a similar notice with the last known time ISY was running.

This takes V5.0.4 to record the time into a variable, and another variable to know if the notification has been sent and continue updating the $last_known_time variable.

 

The user can subtract the last known time from the message time to determine the length of power down time.

Edited by larryllix
Posted

Thanks again Teken.  That's just the info I needed.

 

larryllix - That gives me something to look forward to whenever I decide to upgrade to a 5.x release. 

Posted (edited)

 

The body of the message is: 

 

This message is being generated because the ISY has been rebooted. 
The following is the uptime hours the ISY has been operating since ${sys.time} reboot: ${var.1.330} Hours.
 
Please let me know if you require more insight or feedback . . .

 

 

Got this all setup and ran a test.  Works like a charm.

 

Just one nitpick.  The message should say "The following is the uptime hours the ISY had been operating before ${sys.time} reboot: ${var.1.330} Hours."  Technically, when the ISY reboots, its been operating 0 hours since the reboot.  The variable will hold the number of hours before (i.e. previous to) the reboot.

 

Also, how the heck do you have at least 330 variables?  Wow!!!

Edited by johnmsch
Posted

LOL . . .

 

Getting to 300 plus variables and programs didn't take very long with energy monitoring / management. Coupled with temperature & humidity tracking requires lots of vars to know what is happening so the controller can actively keep the home properly regulated and maintain energy targets.

 

 

=========================

 

The highest calling in life is to serve ones country faithfully - Teach others what can be. Do what is right and not what is popular.

  • 6 months later...
Posted (edited)

Got a new wrinkle to this issue. 

 

Last night we had some brief heavy storms/winds that rolled through and knocked down a bunch of trees, which took some power/cable/phone lines with them.  The power is not a problem, as I have a backup generator that restores full power within a few seconds.  However, it took hours for the cable (Comcast) to be restored.  That prevented me from getting the ISY reboot notification, as my internet connectivity was down.

 

Is there some way to get the ISY to check to see if it has an internet connection before attempting to send the message?  The only thing I can think of right now would be some way to ping a site, such as Google and check to see if it got a response.  This would have to be in a loop, or something that would execute every minute or two until successful, then send the notification.

 

Any ideas would be appreciated.

Edited by johnmsch
Posted

Hello Johnmsch,

 

Does the solution have to be free or is there a small budget available to complete the same?

Posted

Hello Johnmsch,

 

Does the solution have to be free or is there a small budget available to complete the same?

 

Ouch.  Sounds like there's not going to be some straightforward way to do this. 

Posted

Ouch.  Sounds like there's not going to be some straightforward way to do this. 

 

That depends entirely upon (IF) there is a budget to solve the problem(s). 

Posted

Many of us have isy slave RPis and or wc8 boards feeding data into our isy. It would be a simple job to detect the local LAN system and router is functioning inside isy.

 

Sent from a tiny keyboard. Response may be brief.

Posted

Very cool.  Thanks for the info.  I've been wanting to play with a RPi, so now I have a good excuse.

 

Would you be so kind as to explain what a "wc8" is?

Posted

Many of us have isy slave RPis and or wc8 boards feeding data into our isy. It would be a simple job to detect the local LAN system and router is functioning inside isy.

 

Sent from a tiny keyboard. Response may be brief.

Heck, with the new $10 wifi Pi Zero, it's a no-brainer.

Posted

Very cool. Thanks for the info. I've been wanting to play with a RPi, so now I have a good excuse.

 

Would you be so kind as to explain what a "wc8" is?

Wc8 is web control board by CAI. A small controller board with inputs, outputs, and anslogue inputs and can shoot values into isy's variables via the test interface.

 

Sent from a tiny keyboard. Response may be brief.

  • 4 months later...
Posted

Is there a way to be a little more granular in the time?

 

What I am trying to achieve is to be able to get a notification when power has been restored and then in that notification, know exactly how long the power has been out.

 

Thanks

Posted

Is there a way to be a little more granular in the time?

 

What I am trying to achieve is to be able to get a notification when power has been restored and then in that notification, know exactly how long the power has been out.

 

Thanks

 

The easiest method is to change the time interval from minutes to seconds. That same value would be saved as a Integer and then relayed to you via email. The only downside in going this route is (IF) you have lots of other programs this very short (second) counting may tie the ISY Series Controller up. 

 

Also keep in mind the ISY Series Controller would of course need to be placed on a UPS to keep counting. This program your reading about is to track when the controller has been rebooted. It's not intended to track when there is a power loss in the home for that you would need something else to monitor and track.

 

If you need a Insteon solution let me know . . .

Posted

Actually, what I want is to know how long the power has been out.  So, my thinking is to capture the time every minute and push it into the 'init' stage.  Then when the ISY goes down because of a power failure, then when it comes back up, I can take the 'init' variables and send that with a notification with the current time.  Just comparing the two times would give me the amount of time the power was out.

Guest
This topic is now closed to further replies.

×
×
  • Create New...