Power Outage Detection

This is simple… I would have like a UPS monitoring plugin for the Vera to make it slick.

I used a Battery Operated Z-wave door/window magnetic door contact (Schlage RS100HC) with terminals for an external switch (so, not using the magnet and internal reed switch to actuate)

I hooked a 12v relay normally OPEN & Common to input terminals on the door sensor. and used an old wall wort 12v power supply.

My vera is on a UPS… and my Internet is Fiber so in a power loss situation they are both up… The vera is in the Network closet with all switches and POE plus Router all on UPS.

The wall wort is plugged into an outlet that is NOT on a UPS… so when unplugged the sensor tells vera and vera sends an Email via the SMTP plug in and also a Pushover notification via the Push Plugin (have not moved to Veralerts yet)

I have a scene that does the alert and one that says power has been restored when the relay is energized again.

this was needed for me because I have a Vera at my office running lights, locks and temp… but need to know if we lost power overnight etc… so I can get to the office and setup the generator etc.

It works great… my next task is to see if I can SSH into our 2 linux servers and perform a shutdown on them.
Running 2 ESXi servers.

will do a forum search for SSHing into devices and see if I can’t pull that off…

Awesome.

Does the UPS not have a USB interface? I have 6 UPS’s only 1 with a USB interface. The one with USB is plugged into my main server, when it detects it has lost power, it sends shutdown commands to everything else. So with a USB interface it would be a tad easier to “catch” the loss of power, also it could report battery percentage and time remaining on power, and only send shutdown commands when the battery is almost dead.

As I am still new Vera, I am not 100% sure on if vera can send command line, but I think so, also don’t know if Vera has a public key, but one could easily be created. You should be able to have Vera send the following command to the devices ESXI management IP.

ssh $IP 'shutdown -h now “Lost power, Vera sent shutdown command”

Also you would want to add Vera’s ssh public key to the authorized_keys file on the ESXI server.

Thanks!

I have a APC 3000XL on the servers… it has a USB interface and also an Option for a Network Management Card that can send commands to it’s own software (I think I will connect it via USB to the QNAP NAS device)
(expensive… not that I won’t spend the $, but it won’t pull off what I want without pulling teeth because of the setup I have)

But as far as I can see APC software does not support ESXi only the paid version of ESX.

I am really Ok trusting Vera to “do something” when my power monitoring setup gets triggered.

I’m pretty sure I read that some people have SSH to other servers via Vera… I need to setup a test ESXi server to play with (break)
and see if I can piece it together…

yeah… I need to figure out the whole public Key addition on the Linux box etc…

The power of search ;D

http://forum.micasaverde.com/index.php/topic,11663.0.html

I can not remember the name of the module/driver I use on my linux server to talk to my USB APC, but you could probably load it on ESXI since it is linux anyways. I will take a look when I get home.

Probably the apcupsd is what you have ?

But I have 2 ESXi servers to control… I mean I guess I could connect USB to one then send a command from that one to the non-connected.

or mess with NUT (http://www.networkupstools.org)

but I am liking my Vera dream better!

[quote=“jimpapa, post:6, topic:178740”]Probably the apcupsd is what you have ?

But I have 2 ESXi servers to control… I mean I guess I could connect USB to one then send a command from that one to the non-connected.

or mess with NUT (http://www.networkupstools.org)

but I am liking my Vera dream better![/quote]

I haven’t tried it, but a USB hub should work.

hmmm… That would require a USB A to A cable for the physical connections

But I don’t think you can have one (slave) USB device (the UPS) connected to 2 Masters (PC’s)

I have Tripplite Unit that has 2 USB’s and 2 Serials for multiple PC’s.

I could use it if I can’t figure out the Vera route.

Baby Steps… I have SSH to Vera and from vera, SSH to one of my production servers.
Logged in no problem.

(The Production servers (well… they are really backups to our Amazon hosted servers) are setup to only allow SSH connections from
our local IP’s)

so back to the SSH thread and following those docs I think I can pull off what I have hoped to do!

@jimpapa,

Thanks for the detailed instructions. I built and installed mine this weekend. It’s great to have some notice that the power is out when you’re 200 miles away (not that you can do anything about it – but it’s still nice to know).

right… but you can call someone… or in my case… I can shut down servers that are one UPS without corruption

I have it emailing 2 of us so we know to bring a Gas can for the generator also!