just checking to see if there has been any investigation on ui5/veralite
This could be very interesting indeed!
Sent from my SGSII CM9 with Tapatalk 2
Keep in mind that @Ap15e has ceased active participation in the forum, and access to the plug-ins was revoked.
So I know that all of the plug-ins are user created, but I am at a loss we can’t interface VERA with a UPS in 2013, after others were apparently able to do so in 2011.
Is anyone else monitoring an APC UPS via USB with current shareable code? I am sure some UPS with IP interfaces are working, but I have a giant APC S15 Power Conditioner & Battery Backup in my network closet, and after a scare earlier today, I want to make sure I can monitor it. The PC attached is used as a DVR, and is sleeping when not recording or playing back recordings…
We just need a generic HTTP screen scraper plugin, that supports simple authentication also. We can then adopt it for many devices that expose their admin interfaces via a web page.
Anyone working on a UPS plugin?
I see a real need to monitor if your power is out and if so… Can send push notifications and network commands via SSH to servers etc. while on UPS power.
I have been looking for a decent way to monitor if AC power is down at my office and to be notified.
All vital equipment is on UPS including network closet.
We wired in a manual transfer switch. I could not install a natural gas gen with auto transfer switch because our feed to the office suite is only 1/2" pipe. So I need to get alerted that we lost power… If I am not in the office and also. Need to shutdown a rack of servers on an APC 3000 UPS
Having vera do this would be great…
How to people monitor outages? I have a Cyperpower UPS, but would like some notification when power goes out.
I started a thread a while back about this…
so this is what I came up with and it is working great.
http://forum.micasaverde.com/index.php/topic,22330.msg149194.html#msg149194
I spent some time over the past few days parsing the output of apcupsd CGI stats page (APCUPSD User Manual) and came up with this. This is for UPS units not connected to the Vera. You need to setup a server running apcupsd to expose the cgi scripts.
After uploading the files attached the the vera, add a device with the following parameters:
Device type: urn:zyrenth-com:device:Ups:1
Device filename: D_ApcUps1.xml
Imp file: I_ApcUps1.xml
After creating the device, go to the device settings and set the url to the cgi script (ex. http://192.168.1.10/cgi-bin/upsfstats.cgi). Make sure you use the upsfstats.cgi script!
Let me know if there is anything you’d like me to add.
Wow, the plugin by kabili207 works great. I have it running on my Vera3 with three APC Back-UPS Pro.
UPS1: 700VA APC Back-UPS Pro attached to 192.168.0.100 (also hosting the apcupsd webserver, running Windows 8.1)
UPS2: 700VA APC Back-UPS Pro attached to 192.168.0.110 (apcupsd running on Windows 7)
UPS3: 1500VA APC Back-UPS Pro attached to 192.168.0.111 (apcupsd running on Windows 8.1)
The Windows 8.1 “server” machine is running the Apache2 HTTP server via Cygwin and is hosting the gci scripts. On the machine hosting the webserver, you add each of the other machines to the apcupsd hosts.conf file as follows:
MONITOR 127.0.0.1 “UPS1”
MONITOR 192.168.0.110 “UPS2”
MONITOR 192.168.0.111 “UPS3”
On the remote machines, you need to create an inbound rule in Windows Firewall to unblock TCP port 3551.
Then for each instance of the Vera UPS plugin, you add the appropriate URL from your web server, ie, for the example above:
http://192.168.0.100/cgi-bin/apcupsd/upsfstats.cgi
http://192.168.0.100/cgi-bin/apcupsd/upsfstats.cgi?host=192.168.0.110&temp=F
http://192.168.0.100/cgi-bin/apcupsd/upsfstats.cgi?host=192.168.0.111&temp=F
In order to be able to tell in Vera if there is a power failure, I used the App “Program Logic Event Generator” to monitor the “OnBattery” Device Property of each APC UPS. If any of them goes to “OnBattery == 1” then it will turn a Virtual Switch (App) to off, indicating a power failure. When all of the UPS OnBattery == 0, then the power is declared restored, and the Virtual Switch is turned on.
I’m using the Virtual Switch to trigger scenes for “power failure” and “power restored.” In those scenes, I send push notifications via the “Push Notifications” App to my Android phone.
It is working really well so far. A couple things I can think of to improve this plugin are as follows:
- Provide a “motion sensor” capability or make it a virtual switch (like the “Day or Night” app) .
- Add the ability to add an offset to the wattage meter. For example, my UPS says the load attached to it is 61W, but when I measure it with a power meter, it is really using 79W. I guess this is because the UPS itself is consuming some power.
- Add it to the Vera Apps store for easier download/install.
Thanks again for the useful plugin!
-Howard
@agilehumor, did you ever come up with a solution for this?
I probably should start a new topic, but I don’t want to confuse people given I’m posting a modified implementation file.
I got kabili207’s plug in working – the biggest hassle was getting IIS to work on my home network. I realized there’s not really a reason to have a web-server in the path since all the web-server does is access port 3551 on the individual machines to poll for UPS data. So, I rewrote the implementation file to access individual computers associated with a UPS directly.
I simply replaced socket.http with socket.tcp (along with some other sundry changes).
The file is attached – instead of specifying a URL on the control page (i.e. http://192.168.1.50/xxxx), just specify the IP address of the computer that is running apcupsd – i.e. 192.168.1.22 (just the IP, no http or anything else in the field). Make sure there is a firewall exception to allow access to that port on the target computer.
There is probably a good amount of cleanup to do, but it works – and in conjunction with altUI watches and veraAlerts, I can be notified of power failures.
Great but has anyone found a way to plug the USB directly into the Vera unit? Most modern (home) UPSes not only alert during a power outage but also provide power consumption data in WATTs. Even thought the energy monitoring on Vera is not all that great it would be nice to know what my equipment rack is using compared to the rest of the house.
Most energy monitors compatible with vera are switched, but I want something more passive so no one can accidently turn off my network equipment. It would simply be nice to be alerted of a power failure and have the device report power consumption.
[quote=“Scarab, post:53, topic:169161”]Great but has anyone found a way to plug the USB directly into the Vera unit? Most modern (home) UPSes not only alert during a power outage but also provide power consumption data in WATTs. Even thought the energy monitoring on Vera is not all that great it would be nice to know what my equipment rack is using compared to the rest of the house.
Most energy monitors compatible with vera are switched, but I want something more passive so no one can accidently turn off my network equipment. It would simply be nice to be alerted of a power failure and have the device report power consumption.[/quote]
See my post at http://forum.micasaverde.com/index.php/topic,38300.msg286318.html on this topic. To get APCUPS working with Vera would require a recompile of some USB drivers which would then have to be installed. That would only be step 1, with additional hurdles afterwards. It’s beyond my capabilities. To achieve what you are trying to do, I might try and hook up a BeagleBone or a RaspberryPi to the same UPS as my Vera to APCUPS. FYI: APCUPS only works on APC brand devices. I’m not sure if there are equivalents for other brands (i.e. CyberPower). Also, the lower end APCUPS devices do not report real-time power consumption.
Excellent tweak on an excellent plug in. Enabling IIS is not something I wanted to do.
I have the device set up, pointing to the computer the UPS is plugged into, 192.168.1.100. But Vera reports “Data URL is required”. I check the device and the URL under setting is blank. I enter 192.168.1.100 and it reports “error: invalid service”. I ensured port 3551 is open to all connections on the .100 computer. APCUPSD is running and I can see the data, but Vera is not being cooperative.
I re-uploaded the file in case that was the problem - still not working.
Am I overlooking something?
Excellent tweak on an excellent plug in. Enabling IIS is not something I wanted to do.
I have the device set up, pointing to the computer the UPS is plugged into, 192.168.1.100. But Vera reports “Data URL is required”. I check the device and the URL under setting is blank. I enter 192.168.1.100 and it reports “error: invalid service”. I ensured port 3551 is open to all connections on the .100 computer. APCUPSD is running and I can see the data, but Vera is not being cooperative.
I re-uploaded the file in case that was the problem - still not working.
Am I overlooking something?[/quote]
hmmm… I was trying to pull out the relevant LUA code that is the “secret sauce” so you could run it under something like altUI’s “Test LUA” page to see if you are actually talking with your APC. Much to my dismay, I’m getting some LUA error when running the code, but the plugin still seems to work fine.
If you want to give it a shot, paste this into the “test code” and change the string for the IP address on line #8. If it works, you should get a printout of the APCUPSD status dump.
[code]local socket = require(“socket”)
local apc = socket.tcp()
apc:settimeout(5)
local st = os.time()
print (st)
local stats = {}
apc:setoption(“tcp-nodelay”,true)
apc:connect(“192.168.1.xx”, 3551)
apc:send(“\00\06”)
for i = 1,100,1 do – there should not be more than 100 lines
local result = apc:receive(2) – the length comes first
local lineLen = 256* string.byte(result,1) + string.byte(result,2) – convert length into an integer
local v = apc:receive(lineLen - 1) – read the rest of the line less the newline
apc:receive(1) – dump the newline
local kk = v:match(“^(.-)%s*:”) – get the key
local vv = v:match(“^.-:%s*(.-)%s*$”) --get the value
stats[kk] = vv
if string.find(v,“END.*”) ~= nil then break end – did we get to the end?
end
apc:close()
print("fetchSensorData: exec=" .. (os.time() - st))
print(v)
return(true)[/code]
I really appreciate the help. The LUA code seems to run with no errors, but I do not see any “printout” on the screen nor can I figure out where to go to look at a file. Note: I do not use ALTUI.
In the meantime, trying to get IIS running but no luck getting CGI enabled. Tinkering with it I may have caused more damage to settings than anything else.
Quick follow up: I tested the APCUPSD installation and I am able to get data from a command prompt from another computer by running apcaccess status 192.168.1.100 so at least the app is reachable. Just not sure why Vera cannot get the same data using the plugin. ???
I finally figured out what happened. When I uploaded the new implementation file, Vera added the local path into the file name, C:\Users\Don\Desktop\I_ApcUps1.xml, so when I created the device, I was using the old file not the new one. Changed it to the long file name and viola! Working like a charm. I have a second UPS powering my network gear and NAS I’ll work on next.
This is a Sako 3000VA online UPS that powers all my HA equipment for 10-12 hrs. Cams, Vera, M1 Gold, network, etc.