Feature Request: UPS Awareness for Vera

I wish…

Vera could hook up to USB-enabled (and perhaps other) uninterruptible power supplies (UPS) so as to share “Power Failure” information … and potentially send (as well as store, and send again later, after power resumes) a message stating when the power was lost, for how long, etc.

All doable, eh MCV? Programmers?

Libra,
It will really depend upon what UPS you have, and what [prioritized] features you most want out of such a device interface.

This one is on my TODO list, since I plan on UPS’ing Vera and the other components in my Structured Wiring Closet so that I can send alarms when the House Power, or Alarm Power, goes down.

For me, I only need to know if the UPS is operating on it’s internal battery or not, so if I implement it’ll only have simple capabilities.

What’s really needed to drive this is an ordered list of specific “wishlist” item(s) of data from the UPS.

To get a sense of the potential “what if’s” of the data collected, here’s some loose doc on the API of my UPS (a model from APC):

http://www.networkupstools.org/protocols/apcsmart.html
http://www.wsrcc.com/wolfgang/ups/

To do this, you’d going to need MCV’s “raw” protocol defn instead of the more typical “crlf” or “cr” since it’s all coming in as a continuous sequence of stuff (assuming you have the same type of UPS)

That’s great idea!
Any info of APC UPS notification protocol?
Might be tricky as it registers as HID in Windows if I’m not mistaken…

Hey 325, APC’s UPS Protocol is [loosely] outlined in the two URL’s listed above. It’s extremely terse, so it’ll likely need the “raw” format, and a state-variable, to keep track of where things are at in the “stream” coming from the USB device.

If I get time, I’ll plug mine into Vera tonight and see what it really does :wink:

Oh, I didn’t realize you have APC too :slight_smile:
Let us know your findings.

I would definitely love to see this happen, I am going to need to go out and buy a UPS for my network setup anyways so if one particular brand is definitely working over another, that would probably sway my purchase. The other option I could think of would be using a USB->RS232 and using a UPS that still uses RS232. May be a little easier to decode what is going on.

Also, taking a quick look around, it looks like the CyberPower brand still includes serial ports on their UPS’s, some with s USB adapter.

oh, the adventure…

So my APC UPS model is controlled by a USB-HID Interface, so you really no longer access it like a Serial port. Instead, you need to load a bag of drivers and software into Linux, things like:

[tt]kmod-usb-hid[/tt]
[tt]apcupsd[/tt]

Unfortunately, the [OpenWrt] mechanisms to do this appear not to work in Vera (I have another thread open on that elsewhere).

Without these, we likely aren’t going anywhere with this type of interface, at least not direct-attached to Vera…

To get a little further, I converted my Linksys NSLU2 to use OpenWrt, and added the above modules, their respective Depends, and a few kernel modules to support USB in general.

Attached the APC UPS module to the Linksys and can successfully “see” the UPS Device as an attachment so I got ready to configure [tt]apsupsd[/tt] (with the thinking that I’d write a remote-Lua driver for it) only to find that I need [tt]apsupsd_3.14.5[/tt] in order to pickup support for USB Cabling, per this checkin report:

apcupsd-3.14.2-3.14.5.patch on Ticket #2157 – Attachment – OpenWrt

Doh!

Unfortunately, these dont appear to be readily available in the 8.09.1 Kamakazi release (3.14.2 instead of 3.14.5) and my attempts to load others from:

Index of /feeds/optware/openwrt-ixp4xx/cross/unstable/

errored out.

At this point, I’ve gone about as far as I can without some extras from the Vera dev team. Given their more mainstream priorities right now, I don’t think this will make it anytime soon…

Side-comment: What did we do before Google? :slight_smile:

I was looking at APC UPS’s today, and was wondering if anything ever came of this.

Nope, need CJ or someone to fixUp the OpenWRT package loading routine so we can load standard extensions, without that, or a remote OpenWRT, were kinda out of luck for anything requiring kernal drivers.

I’ve wondered if this setup is a violation of the OpenWRT license but haven’t checked that yet. :slight_smile:

First post to the forum - I apologize if I missed another thread that addresses this.
I just ordered a Vera, and I intend to use it mostly as a remote monitoring device. I ordered a thermostat to track the temperature (and send an alert if it is dropping to freezing levels to prevent pipes bursting), but the problem would be if a power failure also takes down Vera.
Is there a way to receive a notification of a power failure so that I can ensure pipes don’t freeze?
I ordered this UPS device: APC Back-UPS ES 8 Outlet 550VA 120V
It sounds like this feature thread would address my situation by enabling Vera to know when the UPS device is drawing on battery power.
Am I on track, and is there any progress? If not, does someone have a robust solution for my situation?

Thanks.

@gezeu, this is still not fixed in a way that would enable Vera to “load” the required libraries. Without that, the Luup driver really can’t be written. Folks who had an “older” UPS, one interfaced with a RS-232 (not USB-HID), could go an write the Luup code, since that should work.

With some Luup code you might, in an indirect way, be able to detect that the power is out.

A few examples:

[ul][li]If there’s another “web based” device in the house, that’s not attached to a UPS, use the Ping Plugin to poll it.
When the Ping fails, the device is likely offline (either power down, hung etc) and a notification can be sent. A number of Ethernet-connected devices have built in WebServers, so any one would do. I have a SIPURA SPA-3000 (VOIP) box that would suffice if I wanted to go this route, but I’m sure other Web-enabled devices are floating around the house also (DVR, TV, etc)
[/li]
[li]there are various “Last Update” Variables in each Device’s Advanced settings.
Vera updates things like the Route for ZWave devices periodically. If these ZWave devices are down (like a Wall-Wart Leviton or similar) then I’m assuming these Variables wont get updated. I haven’t tried this, but if that all works then you could determine the Delta between the last Route update, and “now”, and then trigger an Alert when that gap becomes too large.
[/li][/ul]

Thanks for the reply - appreciate it.
I will have a Dalton Thermostat connected to Vera which is not on the UPS, so I will see if I can figure out how to determine if the thermostat is not available/responding/updating/etc. before the UPS runs out. I do not intend to have other web based devices running in the house since this is monitoring a remote house.

I hope to have the equipment in a week and install it all this month, so I’ll respond if I have a working solution…

Just found, these guys managed to integrate APC UPS into Linux based system… They don’t reveal details, but we know someone have done it.
http://wiki.mikrotik.com/wiki/UPS_scripts#version_for_ROS_3.x

And here’s the serial protocol… You got to use APC special cable though