Multiple ones really would be neat to have a “dashboard” of all the UPSs across the network. In my case I don’t need Hass.io to care about the UPS at all (my hypervisor will shut down the VMs and itself if it goes to battery) but being able to have a log of what all of them are doing would be amazing to analyze and monitor in one place.
The big “gotya” for me getting the first one working was I didn’t realize the ‘device’ line is different from normal apcupsd, I was putting ‘192.168.1.1:3551’ like what seems to work properly on my various Linux install, but instead I had to put just ‘192.168.1.1’ in the hass.io addon configuration without the port.
You might look into documentation for ‘apctest’, I don’t know that there is a function to command it back on again in apcupsd but if there is, it’s probably in the apctest app. In my experience, the “kill” is usually used to power off the UPS after graceful shutdown and it powers back on by itself when mains power returns.
Is there a way to adjust how rapidly this responds to events?
I tried pulling the plug on my UPS and it was nearly a full minute (about 55 seconds) before the status updated showing line voltage 0.0V and similarly long when I plugged it back in. And the status for ONLINE SLAVE/ONBATT SLAVE takes a full 90 seconds to update.
I tried to add the expected key to make it react faster but it told me its invalid. Failed to save addon configuration, not a valid value for dictionary value @ data['options']. Got {'name': 'APC UPS', 'cable': 'smart', 'type': 'net', 'device': '192.168.1.1', 'extra': [{'key': 'ONBATTERYDELAY', 'val': 1}]}
Every other system I have that monitors the same UPS over the network with apcupsd is able to tell within ~5 seconds at the longest that it’s lost power. I don’t understand why this isn’t updating?
I might look at adding multiple UPS support eventually, but I just don’t have the time to do it now.
A few things… Your config is invalid because you used 1 as the value. You need to use "1" (i.e. wrap the value in quotes.) This is because the add-on config parser doesn’t support multiple types.
This add-on just runs the apcupsd process. You’ll need to figure out if it’s apcupsd that’s slow to respond to status changes, or Home Assistant that’s slow to update from apcupsd.
I would try triggering the event, then using apcaccess (i.e. run apcaccess <your HassOS ip>) immediately after to see if apcupsd sees the new status. If it doesn’t then apcupsd probably needs additional configuration options. If apcaccess is showing the updated status, but Home Assistant isn’t, you need to investigate why it’s taking Home Assistant so long to update. (Are you running on an older Pi or is the CPU maxed out?)
Ok - it does seem to react in ~5 seconds looking at apcaccess -h <hassio_name> watching the stats, like I see with other hosts and VMs.
I’m running it on a x86-64 server (Intel® Xeon® E-2176G CPU @ 3.70GHz) with 8GB of RAM for Hassio (HassOS using the Intel-NUC image), I don’t know exactly what I’d look at. Nothing else is slow to update on my dashboard or in the developer states display.
Oh wow, that’s quite a bummer. While some (like on-battery on-mains) could be done with the apcupsd scripts a lot of the metrics would probably require polling.
Seems like the interval should be configurable, with a beefy enough machine I don’t see why every 1s would be an issue. Since it already can import all the readings it seems silly to have to invent my own script to poll, parse, publish, then import, parse, and create sensors.
Hello,
I have latest HassOS 3.13 on fresh RPi4. I have difficulties to integrate UPS APC Back-UPS 950VA (BX950U-FR) with HA. As per basic “lsusb” I see it is visible on RPI:
# lsusb .
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 003: ID 0451:16a8
Bus 001 Device 002: ID 2109:3431
Bus 002 Device 001: ID 1d6b:0003
Bus 001 Device 005: ID 051d:0002 <--------
however on Supervisor -> System -> Hardware tab it is not included.
May 21 21:22:32 a722577e-apcupsd syslog.info syslogd started: BusyBox v1.30.1
May 21 19:22:32 a722577e-apcupsd daemon.notice apcupsd[7]: apcupsd 3.14.14 (31 May 2016) unknown startup succeeded
May 21 19:22:32 a722577e-apcupsd daemon.info apcupsd[7]: NIS server startup succeeded
APCUPSD included in configuration.yaml:
# APC UPS
apcupsd:
Did anyone face any issue like this before? I turned off and unplug from AC main UPS but unfortunately issue is still present. Appreciate help, thank you.
EDIT: My Fix was to reinstall hass.os, it worked for 2nd time. Only concern is that this addon is checking APC status each 1 minute, it would be nice to have this value user configurable, lets say every 10 or 20 secs.
Hey, great add on. I have it working fine with USB, however my UPS has a AP9630 network card in it. Firmware’s have all be updated and the network card even supports Modbus…
Anyway, I have installed the apcupsd_net version of this add-on to try to eliminate a USB cable going to the raspberry pi. What am I missing in the config file? I have the below config:
Hello, everyone. Due to a lack of time I’ve decided to archive this add-on. I suggest migrating to the NUT add-on which is well-supported and better integrated into Home Assistant. You can read more in the README.
Thank you to everyone who has helped me support this add-on over the past few years.
Hi Kory,
NUT does not provide so many information, and for some reason, it is inaccurate for me.
Is there anyway to download your custom apcupsd, even you archived ?
PS: I had it before, and worked very fine. I changed my environment, and unfortunately did not saved.
thanks in advance,
well, thank you dave. i have nut for my other apc, which is brazilian standard. But NUT does not work so well. apcupsd has many more information and it is more precise.
that is why I asked.
The repository is still available here, I’m just not updating it. I was able to follow my old instructions and install the network version of the add-on. I didn’t try the USB version since NUT is managing the USB for me.