Author Topic: APC UPS Backup - Now just needs a plugin  (Read 23603 times)

Offline Ap15e

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2000
  • Karma: +11/-0
Re: APC UPS Backup - Now just needs a plugin
« Reply #30 on: September 28, 2011, 05:19:46 am »
IIRC if your're running on batteries, STATUS is ONBATT.

Offline Ap15e

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2000
  • Karma: +11/-0
Re: APC UPS Backup - Now just needs a plugin
« Reply #31 on: October 01, 2011, 06:54:38 am »
Would you mind adding

Code: [Select]
        if value ~= nil
         then
          luup.variable_set("urn:kristopher-us:serviceId:APC1", tostring( identifier ) .. '_VALUE', tostring ( value ), PARENT_DEVICE )
         end

to your plugin? Reason: The dataMine plugin doesn't support regular expressions to extract the numbers from the status variables.

Offline Ap15e

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2000
  • Karma: +11/-0
Re: APC UPS Backup - Now just needs a plugin
« Reply #32 on: October 01, 2011, 06:19:47 pm »
AUC (APC UPS Companion) is available from http://forum.micasaverde.com/index.php?topic=7989.0.

Offline ChrisAZ

  • Jr. Member
  • **
  • Posts: 99
  • Karma: +1/-0
Re: APC UPS Backup - Now just needs a plugin
« Reply #33 on: October 04, 2011, 01:35:20 am »
I followed the instructions for adding the USB support and daemon to Vera.  Everything worked fine until I got to the last step:

root@MiOS:/etc/apcupsd# apcaccess status
Error contacting apcupsd @ localhost:3551: Connection refused

In the apcupsd.conf file I changed the cable type to USB and UPS type to usb and left device blank.  I didn't make any other changes to the conf file.

Any idea what could be wrong?

Offline Ap15e

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2000
  • Karma: +11/-0
Re: APC UPS Backup - Now just needs a plugin
« Reply #34 on: October 04, 2011, 07:25:58 am »
Is the apcupsd running?

Offline ChrisAZ

  • Jr. Member
  • **
  • Posts: 99
  • Karma: +1/-0
Re: APC UPS Backup - Now just needs a plugin
« Reply #35 on: October 04, 2011, 08:51:38 pm »
It must not have been.  I restarted it and was able to get some status...but some fields are 0 that shouldn't be (like line voltage - see the data dump at the bottom).

The display on the Vera webpage isn't working - it has nil for the values.  (see attachment)

When I go into the properties, APCUPSInformation has bad data.  (see attachment)




root@MiOS_18558:/etc/apcupsd# apcaccess status
APC      : 001,043,1048
DATE     : Tue Oct 04 17:35:45 MST 2011
HOSTNAME : MiOS_18558
VERSION  : 3.14.7 (1 August 2009) unknown
UPSNAME  : ups1
CABLE    : USB Cable
MODEL    : Back-UPS CS 350
UPSMODE  : Stand Alone
STARTTIME: Tue Oct 04 17:04:45 MST 2011
STATUS   : ONLINE
LINEV    : 000.0 Volts
LOADPCT  :  34.0 Percent Load Capacity
BCHARGE  : 100.0 Percent
TIMELEFT :  30.8 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes
MAXTIME  : 0 Seconds
OUTPUTV  : 115.0 Volts
SENSE    : Medium
DWAKE    : 000 Seconds
DSHUTD   : 000 Seconds
LOTRANS  : 000.0 Volts
HITRANS  : 136.0 Volts
RETPCT   : 000.0 Percent
ITEMP    : 29.2 C Internal
ALARMDEL : Always
BATTV    : 13.5 Volts
LINEFREQ : 59.0 Hz
LASTXFER : Low line voltage
NUMXFERS : 0
TONBATT  : 0 seconds
CUMONBATT: 0 seconds
XOFFBATT : N/A
SELFTEST : NO
STATFLAG : 0x07000008 Status Flag
SERIALNO : 4B0944P40555 
BATTDATE : 2009-11-01
NOMOUTV  : 000 Volts
NOMINV   : 120 Volts
NOMBATTV :  12.0 Volts
NOMPOWER : 210 Watts
FIRMWARE : 805.q8.D USB FW:q8
APCMODEL : Back-UPS CS 350
END APC  : Tue Oct 04 17:35:51 MST 2011


Offline bmeyer29

  • Sr. Newbie
  • *
  • Posts: 29
  • Karma: +0/-0
Re: APC UPS Backup - Now just needs a plugin
« Reply #36 on: October 04, 2011, 11:33:54 pm »
@Kristopher

Great job! I have an APC Back-UPS ES 550 and just got your plugin working on my Vera2. Looks very nice and I look forward to seeing future tweaks you may do. This is really handy for those of us that don't have a PC or server on 24x7.

@Ap15e

I like your companion tool a lot. Lots of info in a compact display. (I just wish there was a way to see the info on my iphone. I'm using the free smartphone tool from MCV.)

@ChrisAZ

I had the same results you've displayed initially. Make sure you have Kristopher's APC plugin working correctly, first. (See his apc.zip file and install details further up in this thread). It should display the load level and remaining time. When I installed Ap15e's companion (AUC), I put the wrong device number in the APCUPSDevID field on the AUC Advanced tab. Once I put the device number for the APC device into the AUC's APCUPSDevID field, then AUC worked as expected.

Offline Ap15e

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2000
  • Karma: +11/-0
Re: APC UPS Backup - Now just needs a plugin
« Reply #37 on: October 05, 2011, 05:17:39 pm »
Kristopher,

If the apcupsd dies, apcaccess returns "Error contacting apcupsd @ localhost:3551: Connection refused" and your code errors out with "function refreshCache failed [string "..."]:63: attempt to concatenate local 'currentTimeleft' (a nil value)" - and doesn't update LastUpdate and AUC is able to display a warning message.  :)

If you're going to fix it, please don't update LastUpade if apcaccess returns an error.
« Last Edit: October 05, 2011, 05:22:05 pm by Ap15e »

Offline Ap15e

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2000
  • Karma: +11/-0
Re: APC UPS Backup - Now just needs a plugin
« Reply #38 on: October 05, 2011, 05:50:18 pm »
AUC (APC UPS Companion) V0.2 beta is available from http://forum.micasaverde.com/index.php?topic=7989.0.

Offline JOD

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1978
  • Karma: +4/-0
Re: APC UPS Backup - Now just needs a plugin
« Reply #39 on: January 20, 2012, 10:48:32 am »
Is anyone using this on V3/UI5?

JOD.
I'm sorry, my responses are limited. You must ask the right questions.

Offline bmeyer29

  • Sr. Newbie
  • *
  • Posts: 29
  • Karma: +0/-0
Re: APC UPS Backup - Now just needs a plugin
« Reply #40 on: July 06, 2012, 10:51:58 pm »
just checking to see if there has been any investigation on ui5/veralite

Offline Grain

  • Sr. Newbie
  • *
  • Posts: 41
  • Karma: +0/-0
Re: APC UPS Backup - Now just needs a plugin
« Reply #41 on: July 07, 2012, 01:30:51 am »
This could be very interesting indeed!

Sent from my SGSII CM9 with Tapatalk 2

Offline oTi@

  • Beta Testers
  • Master Member
  • *****
  • Posts: 4045
  • Karma: +30/-6
  • UI what ?!
Re: APC UPS Backup - Now just needs a plugin
« Reply #42 on: July 07, 2012, 05:51:04 am »
Keep in mind that @Ap15e has ceased active participation in the forum, and access to the plug-ins was revoked.
Dezwaved at the moment...

Offline wilme2

  • Hero Member
  • *****
  • Posts: 951
  • Karma: +18/-11
Re: APC UPS Backup - Now just needs a plugin
« Reply #43 on: October 02, 2013, 04:17:50 pm »
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...
« Last Edit: October 02, 2013, 04:19:37 pm by wilme2 »
Long Live UI5!

Offline bobk

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +0/-0
Re: APC UPS Backup - Now just needs a plugin
« Reply #44 on: October 05, 2013, 08:39:57 am »
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.