As I have a Rasberry Pi running a web server and openLuup I took a bit of a different route. I installed NUT on the Pi and created the attached plugin to parse the upsc command response. This plug in looks like a standard Door/Windows sensor. Benefit of that is that Vera and apps can better deal with it. The only thing is that the Alerts will trigger a door open notification.
When using it on a Vera you still need a Pi or other server with NUT installed as that cannot run on the Vera it self.
This is tested with an APC UPS attached to a Synology NAS and NUT on a Rasberry Pi.
- Follow these instructions to install NUT https://www.domoticz.com/forum/viewtopic.php?t=2266
(installing just the nut-client package may suffice, not tested)
- test the installation using the command : upsc ups@(your NAS IP)
When on Vera you need a remote server to run the upsc command.
Put this php script in the default sever directory. Configure the IP address of your NAS.
For a Pi with Apache and default settings this is /var/www/html
$nas_ip = '192.168.x.x';
$output = shell_exec('upsc ups@'.$nas_ip);
When you have installed on openLuup you do not need the php script, but then you need to set the Remote variable to 0.
The plugin is pending approval on the Vera app market, but is available on the ALTUI App Store if you have ALTUI. You can also force an install on your Vera with this URL http://<your vera IP>:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreatePlugin&PluginNum=8866&Version=32851
Install the plugin by uploading the D_UPSSensor1.xml and I_UPSSensor1.xml files to your Vera. Then manually create a device using these two files.
The device is a default door/windows sensor so it will behave as such. Extra variables will be set with all parameters from the upsc command and others like Watts, just have a look.
The only configuration required is to set the IP address for the web server running the script in the ip attribute.
When running local on openLuup you must enter the IP address of your NAS and set the Remote variable to 0.
Some more background information
GitHub repository https://github.com/reneboer/vera-UPSSensor
variables possible http://networkupstools.org/docs/user-manual.chunked/apcs01.html
status details APC http://www.mathstat.dal.ca/~selinger/ups/backups.html