Author Topic: Alert if Vera offline  (Read 10796 times)

Offline integlikewhoa

  • Master Member
  • *******
  • Posts: 5559
  • Karma: +149/-366
Alert if Vera offline
« on: April 20, 2014, 01:57:48 pm »
I have multiple Vera's. One at a vacation home. I just found out the other day the vacation home is offline. I haven't been out there yet to see whats going on. 
I don't check that Vera Daily and I have no Idea when it went offline. My question is

Whats the easiest way to check in on that Vera and send me an alert when It looses online connection to me.

Can I have one Vera ping the other and send me an alert if the other doesn't respond? If so how would that be done?

Offline clippermiami

  • Hero Member
  • *****
  • Posts: 1382
  • Karma: +27/-6
Re: Alert if Vera offline
« Reply #1 on: April 20, 2014, 02:21:51 pm »
I have multiple Vera's. One at a vacation home. I just found out the other day the vacation home is offline. I haven't been out there yet to see whats going on. 
I don't check that Vera Daily and I have no Idea when it went offline. My question is

Whats the easiest way to check in on that Vera and send me an alert when It looses online connection to me.

Can I have one Vera ping the other and send me an alert if the other doesn't respond? If so how would that be done?

I don't have a remote Vera but I do have my local Vera setup to ping some important connections such as my Internet router, my ISP's Gateway, the Alarm System Gateway, my SysLog server, the tablets around the house used for home control, etc. Depending on the function these are polled from every 15 seconds to every 60 seconds using the Ping Sensor Plugin. Notifications are sent depending on the criticality of the connection.

You could do the same with your remote Vera assuming it has a fixed IP or a Dynamic DNS configured. You could then send an alert to yourself using SMTP, Twilio (SMS or voice), Pushover, or some combination using Vera Alerts (which it's what I use)

Two Vera Plus UI7 Linked via HTTP, 90+ Devices. PlugIns: PLEG, DSC, Blue Iris, MySensors,  AutoVera, ImperiHome, VeraAlerts, EventWatcher

Offline BulldogLowell

  • Hero Member
  • *****
  • Posts: 1576
  • Karma: +191/-85
Re: Alert if Vera offline
« Reply #2 on: April 20, 2014, 02:30:38 pm »
Or have it send you something (an alert or notification attached to something that happens daily) every day.

No alert that day, you may have a problem.

Offline integlikewhoa

  • Master Member
  • *******
  • Posts: 5559
  • Karma: +149/-366
Re: Alert if Vera offline
« Reply #3 on: April 20, 2014, 03:26:21 pm »
I don't have a remote Vera but I do have my local Vera setup to ping some important connections such as my Internet router, my ISP's Gateway, the Alarm System Gateway, my SysLog server, the tablets around the house used for home control, etc. Depending on the function these are polled from every 15 seconds to every 60 seconds using the Ping Sensor Plugin. Notifications are sent depending on the criticality of the connection.

You could do the same with your remote Vera assuming it has a fixed IP or a Dynamic DNS configured. You could then send an alert to yourself using SMTP, Twilio (SMS or voice), Pushover, or some combination using Vera Alerts (which it's what I use)

Didn't know there was a Ping Sensor Plugin, I think that is exactly what I'm looking for. Going to play with it now. Thanks

Offline integlikewhoa

  • Master Member
  • *******
  • Posts: 5559
  • Karma: +149/-366
Re: Alert if Vera offline
« Reply #4 on: April 20, 2014, 04:31:55 pm »
Well I haven't been known to be the brightest bulb..... But for some reason I can't get this to work right. I went back to just testing a local ip of my main computer which is 192.168.1.100.  I set poll sec. To 15. And I'm not really sure what to set time out sec. It was at 0 then I set it at 15. It never seems to change for me. Always red. I do have it on armed and normal. Any thoughts? I'm sure it's a simple mistake.

Offline clippermiami

  • Hero Member
  • *****
  • Posts: 1382
  • Karma: +27/-6
Re: Alert if Vera offline
« Reply #5 on: April 20, 2014, 04:48:50 pm »
Try setting it to "Invert", all of mine are set that way and everything is fine.
Two Vera Plus UI7 Linked via HTTP, 90+ Devices. PlugIns: PLEG, DSC, Blue Iris, MySensors,  AutoVera, ImperiHome, VeraAlerts, EventWatcher

Offline integlikewhoa

  • Master Member
  • *******
  • Posts: 5559
  • Karma: +149/-366
Re: Alert if Vera offline
« Reply #6 on: April 20, 2014, 09:47:03 pm »
Try setting it to "Invert", all of mine are set that way and everything is fine.

Thanks, I did figure out I like the Invert on colors seem better for me that way.

My real problem is right now is looks like I can't ping a port.

So while I'm away my WAN IP is only one number. But with port forwarding I have access to each camera, Each wireless Access point, Blueiris and much more. The way it's working now I can only tell if my WAN is up or not and not if a particular device is running.

If I had 2 Veras in one location and one went down this would work. But 2 devices in one location and modem or router down I would get no alert. So doesn't help me much.

Anyone Have any Ideas?  I don't really don't want to get an "OK" message everyday just to see if its up. 

Offline garrettwp

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6376
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: Alert if Vera offline
« Reply #7 on: April 20, 2014, 10:47:40 pm »
First be very careful of Port forwarding! Second, it may be easier to create a scene on each Vera to write a variable say a time stamp to the other Vera. Have a scene check that time stamp if it's older than a certain time.

- Garrett


Offline clippermiami

  • Hero Member
  • *****
  • Posts: 1382
  • Karma: +27/-6
Re: Alert if Vera offline
« Reply #8 on: April 21, 2014, 07:03:53 am »
Try setting it to "Invert", all of mine are set that way and everything is fine.

Thanks, I did figure out I like the Invert on colors seem better for me that way.

My real problem is right now is looks like I can't ping a port.

So while I'm away my WAN IP is only one number. But with port forwarding I have access to each camera, Each wireless Access point, Blueiris and much more. The way it's working now I can only tell if my WAN is up or not and not if a particular device is running.

If I had 2 Veras in one location and one went down this would work. But 2 devices in one location and modem or router down I would get no alert. So doesn't help me much.

Anyone Have any Ideas?  I don't really don't want to get an "OK" message everyday just to see if its up.

Unfortunately that's the way PING works :-) You might be able to work out something using HTTPS requests in LUA code talking directly the device or via MiOS forwarders?
Two Vera Plus UI7 Linked via HTTP, 90+ Devices. PlugIns: PLEG, DSC, Blue Iris, MySensors,  AutoVera, ImperiHome, VeraAlerts, EventWatcher

Offline integlikewhoa

  • Master Member
  • *******
  • Posts: 5559
  • Karma: +149/-366
Re: Alert if Vera offline
« Reply #9 on: August 08, 2014, 05:41:22 pm »
Anyone have a new or better idea on this? Had power go out at the vacation house last week sometime.

I would like to get an alert when it goes offline rather then finding out a week or more later when I happen to physically log into vera and can't get a connection.

Offline BOFH

  • Sr. Hero Member
  • ******
  • Posts: 2396
  • Karma: +112/-139
Re: Alert if Vera offline
« Reply #10 on: August 08, 2014, 06:56:04 pm »
The problem is that when the power goes out, so most likely does your vera and router. Ergo, no power, no notification.
At one time, someone made a plugin for UI4 that allowed Vera to communicate with a UPS. Which would be just what you need.
Vera and internet router on UPS. If power fails, UPS signals Vera who sends you a notification. hopefully before the UPS dies ;)
If power returns and UPS is till powering Vera she could send a 'power back' notification. Not sure how you coudl do that if the outage is longer than your UPS battery lasts.

I'm unsure where that plugin went and if it's even compatible with UI5 or even UI6.

I tought about this some more and came up with the below scenario:

If you have a DD-WRT router at your vacation, you can use it, the geo-fencing script for those and an IP device (eg a camera)
Have Vera, your internet router and the DD-WRT router on UPS but have the IP camera directly connected to the mains. Using the geofencing script, if the camera disconnects from the routee, you can assume power failed. The script will trigger a (multi)switch plugin on Vera which can then send you a notification. An added benefit would be that you can use the camera to look at your vacation home.

I use this solution with my cell so Vera knows when I come home and leave. It also pings my main server and my ISP's DNS server.
I'm gonna add one of my camera's so I can use it as a 'power outage' detector as described above.

Required hardware:
1 UPS
1 DD-WRT (atheros) compatible router (These can be had pretty cheaply recertified)
1 IP Camera (Vera compatible)


« Last Edit: August 08, 2014, 07:05:29 pm by BOFH »
Vera3 UI5 UI7 Edge Plus
Trane TZEMT400AB32 | Schlage BE369 FE599 | GE 45601 45602 45603 45604 45606 45609 45631 | Intermatic HA01C HA03C HA05C HA07C CA600 CA3000 | Aeon DSC06106 | Telguard GDC1 | Foscam FI8910W FI8905W FI9821W | D-Link 930L | Wanscam JW0011 | ZModo ZPIBH13W

Offline integlikewhoa

  • Master Member
  • *******
  • Posts: 5559
  • Karma: +149/-366
Re: Alert if Vera offline
« Reply #11 on: August 13, 2014, 10:59:43 pm »
The problem is that when the power goes out, so most likely does your vera and router. Ergo, no power, no notification.
At one time, someone made a plugin for UI4 that allowed Vera to communicate with a UPS. Which would be just what you need.
Vera and internet router on UPS. If power fails, UPS signals Vera who sends you a notification. hopefully before the UPS dies ;)
If power returns and UPS is till powering Vera she could send a 'power back' notification. Not sure how you coudl do that if the outage is longer than your UPS battery lasts.

I'm unsure where that plugin went and if it's even compatible with UI5 or even UI6.

I tought about this some more and came up with the below scenario:

If you have a DD-WRT router at your vacation, you can use it, the geo-fencing script for those and an IP device (eg a camera)
Have Vera, your internet router and the DD-WRT router on UPS but have the IP camera directly connected to the mains. Using the geofencing script, if the camera disconnects from the routee, you can assume power failed. The script will trigger a (multi)switch plugin on Vera which can then send you a notification. An added benefit would be that you can use the camera to look at your vacation home.

I use this solution with my cell so Vera knows when I come home and leave. It also pings my main server and my ISP's DNS server.
I'm gonna add one of my camera's so I can use it as a 'power outage' detector as described above.

Required hardware:
1 UPS
1 DD-WRT (atheros) compatible router (These can be had pretty cheaply recertified)
1 IP Camera (Vera compatible)

I think your on the wrong track. I don't need the vera that's down to report to me. I have more then one vera in different locations. Would be easier to use the vera that has power and internet to check in with the other and if no response report to me.

Internet down the communication to UPS wouldn't help me.

I have posted many times in the DDWRT post and currently use that on multiple routers in both houses for home away.

What I really need is a way to use my DDWRT from one house to ping the vera from the other house. Problem like above is a can't ping anything but the router as you can't ping ports. Anyone know away (script) to use the MIOS servers to try and see if the vera is online. 

Offline SOlivas

  • Sr. Member
  • ****
  • Posts: 281
  • Karma: +1/-1
Re: Alert if Vera offline
« Reply #12 on: August 15, 2014, 09:27:28 pm »
There are quite a few different ways you could go about this, but most involve things like playing with advanced networking concepts, VPN protocols, etc. 

One idea that does come to mind (mind you this is a half-baked idea I have not played with and doesn't require you to modify your router settings to setup port forwarding):

1. Go get yourself a very cheap VPS host (I'm a FreeBSD person myself, but places like vr.org will give you a basic VPS server for $10/month).

2. Setup some user accounts, generate some user key(s)

3.  On your vacation home's Vera 3, setup a cron job that fires off a script that connects to the VPS host with SSH and updates the timestamp/data of a file on the system.

4.  On your system at home, setup another cron job to fetch this remote file and compare timestamps.  If the timestamps are off than say x+y minutes (x = the update interval of the Vera in your vacation home, y = how much of a time difference you are willing to tolerate before generting an alert), raise an alert.


Mind you, this assume that:

1.  You know *nix and how to do shell scripting
2.  Have logged into your Vera via SSH and know how to setup cron jobs
3.  Are willing to pay $10 (or whatever nominal fee) for a VPS host to basically act as a file server for a single file.


--

Other fun ideas (don't recommend trying unless you really know what you are doing):

Setup tunneling between your two networks (home and vacation house). 
You can use a VPN protocol and put the networks on separate subnets.

Use EoIP (Ethernet over IP) to transport Ethernet frames over IP packets to basically glue your two networks together (don't do this).  www.youtube.com/watch?v=Sj8I7J3J0Ek




« Last Edit: August 15, 2014, 09:30:30 pm by SOlivas »
Vera 3 (1.5.622) / 9x GE/Jasco 45609 / 2x GE/Jasco 45612 / 2x GE/Jasco 45614 / 1x MIMO Lite
1x Twine (http://forum.micasaverde.com/index.php/topic,15617.0.html), DSC Security System, Honeywell  YTH8320ZW1007 Thermostat, 1x Fortrezz WWA-01, 1x CA9000 Wireless PIR Sensor

Offline integlikewhoa

  • Master Member
  • *******
  • Posts: 5559
  • Karma: +149/-366
Re: Alert if Vera offline
« Reply #13 on: August 17, 2014, 01:05:34 pm »
There are quite a few different ways you could go about this, but most involve things like playing with advanced networking concepts, VPN protocols, etc. 

One idea that does come to mind (mind you this is a half-baked idea I have not played with and doesn't require you to modify your router settings to setup port forwarding):

1. Go get yourself a very cheap VPS host (I'm a FreeBSD person myself, but places like vr.org will give you a basic VPS server for $10/month).

2. Setup some user accounts, generate some user key(s)

3.  On your vacation home's Vera 3, setup a cron job that fires off a script that connects to the VPS host with SSH and updates the timestamp/data of a file on the system.

4.  On your system at home, setup another cron job to fetch this remote file and compare timestamps.  If the timestamps are off than say x+y minutes (x = the update interval of the Vera in your vacation home, y = how much of a time difference you are willing to tolerate before generting an alert), raise an alert.


Mind you, this assume that:

1.  You know *nix and how to do shell scripting
2.  Have logged into your Vera via SSH and know how to setup cron jobs
3.  Are willing to pay $10 (or whatever nominal fee) for a VPS host to basically act as a file server for a single file.

Never used VPS before. May or may not be over my head at this point. I'm still thinking that there has to be an easier way and or a way without a monthly hosting fee. Going by your theory of time stamps and such. I'm thinking of a new idea.

What about a having one vera flip a virtual switch on the the other vera every so often. Then using pleg to say if this switch doesn't get flipped (ture) after more then X minutes then its down.

Other thing would also be a count down timer. I use Richards timers already. I would have the timer set to so many min. and the other vera needs to keep reseting it, if it fails to reset it then time runs out and sends me an alert.

I ofcourse would like to know as soon as possible when its down so I don't know whats a good check in time. 24 hours seems ideal for load, but of course I would like every min.
Maybe have a scene trigger every hour to send a HTTP command threw mios to the other Vera to flip the switch?

Offline integlikewhoa

  • Master Member
  • *******
  • Posts: 5559
  • Karma: +149/-366
Re: Alert if Vera offline
« Reply #14 on: August 18, 2014, 09:46:48 pm »
Well I did it. I'm not sure repercussion is doing it the way I did, but it works. Maybe resource hog? Looking for opinions, other options and comments on this. 

So on my vacation house VERA I setup a scene to run every 5 min. and it runs this luup code which turns on a virtual multiswitch on my other vera.

Code: [Select]
luup.inet.wget("https://fwd2.mios.com/[b]USER[/b]/[b]Password[/b]/[b]Vera Serial[/b]/data_request?id=lu_action&DeviceNum=81&serviceId=urn:dcineco-com:serviceId:MSwitch1&action=SetStatus7&newStatus7=1")
On my daily home vera I used an existing multiswitch (Device #81 and button #7) and set the multiswitch to PULSE button #7 (flip it back off as soon as it turns on).

Then I used PLEG to send me an alert if Button #7 hasn't been turned on (or been off more then) within the last 5.5min.

I'm instrested to see or know the negative effects on running a scene or HTTP every 5 min. If there is none I would like to bump it up to 1 min. Is there is strain then I could knock it down to every hour or 24 hours.