New apcupsd Hass.io add-on

Tags: #<Tag:0x00007f73b3299090>

There’s lots of issues that could be going on here, so please answer these questions so I can help troubleshoot:

Are you currently running apcupsd anywhere on your network?

Is the connection to the UPS over USB or does the UPS have its own network cable?

If the UPS communicates with USB…
    Is the USB cable plugged into the physical box that runs the Hass.io VM?
    Is the USB passed through to the Hass.io VM?
    Are you using the VirtualBox Extension Pack?

If the add-on isn’t starting, you need to try starting it then check the Hass.io supervisor logs to find out what’s going on. It should print an error. Post that. You can find this on the Hass.io page -> System tab -> System Log.

Thanks for the prompt response!

So, Apcupsd is running via USB on the host machine (Win10). APCupsd appears OK on the host machine-

image

I have never passed through the USB, but I’m happy to do this if it fixes things…
yes I’m running the Virtualbox extension pack.

Here are the logs from the Hass Supervisor:

19-09-01 23:39:28 INFO (SyncWorker_7) [hassio.docker.interface] Clean addon_a722577e_apcupsd application
19-09-01 23:39:31 ERROR (SyncWorker_7) [hassio.docker] Can't start addon_a722577e_apcupsd: 500 Server Error: Internal Server Error ("error gathering device information while adding custom device "/dev/usb/": no such file or directory")

Okay, that’s what I figured. You don’t need this add-on. This add-on is to let you run apcupsd using Hass.io. Since you already have apcupsd running, you just need to troubleshoot why Home Assistant can’t connect to your apcupsd instance.

What do you have configured as the host in your yaml configuration? And what’s the IP your apcupsd instance is hosted on?

Some networking modes in VirtualBox don’t allow communication between the VM and the host, so you may need to play with those settings so your VM can communicate with your apcupsd instance.

Gee this was a bit confusing, sorry for wasting your time! You were spot on… the problem was that the new VM network “Promiscous mode” was set to “Deny”, changed it to “Allow All” and now working perfectly. Don’t understand Promiscous mode but whatever!

I got confused when I seen the integration page mentioning the add-on :blush:

Thanks for your help. I am also using your caddy add-on which is awesome- Love your work. How can I buy you a beer?

@Aussybob Thanks, but send your money to the Home Assistant guys. They’re the ones that put in all the work.

@korylprince Firstly let me thank you for your work on developing this add-on, I find it very useful! Really thanks.
Would you please help me in troubleshooting this issue I have on this my configuration?

Had many issue at the beginning in starting up. I did a lot of try and it is now running, but there is no connection from apcupsd to USB port, with error similar to this one copied from the thread (don’t have a trace right now of mine):
18-01-23 03:35:31 ERROR (SyncWorker_18) [hassio.docker] Can’t start addon_a722577e_apcupsd: 404 Client Error: Not Found (“linux runtime spec devices: error gathering device information while adding custom device “/dev/usb/hiddev0”: lstat /dev/usb/hiddev0: no such file or directory”)

I discovered I have no /dev/usb devices files at all in my container, but I got:

[email protected]:/dev/bus/usb/001$ ls -la
total 0
drwxr-xr-x 2 root root 120 Aug 30 16:20 .
drwxr-xr-x 4 root root 100 Aug 27 19:34 …
crw------- 1 root root 189, 5 Sep 4 19:53 006
and the same from:

bash-5.0# lsusb
Bus 001 Device 006: ID 051d:0002

How do I and where I do the modification to let the add-on to install and run correctly with this configuration?
I see there is a config.json in the addons/a722577e/git/apcupsd folder with this entry:

"devices": ["/dev/usb/:/dev/usb/:rwm"]

I tried modifying it with my path but I get a lot of:
Sep 4 01:01:59 a722577e-apcupsd daemon.warn apcupsd[7]: Communications with UPS lost.

HASSIO is talking to the add-on in fact I see the sensors in HA but most of them are in unknown states

Could it be a problem with passing-through the USB port to HASSIO, has anyone had experience with this configuration and could help?

Thanks for your help!

There is a known issue with USB devices being populated from Synology onto hassio. But if you get something it is populated but timeouts due to something else.

Let me know if you find anything that makes it more reliable and I’ll add it to the Synology thread.

@gerosaf The issue is definitely related to the Synology not putting the /dev/usb/* stuff in place (or at least the docker daemon isn’t able to see it.)

As I have no experience with Synology and no way to test it, there’s not much help I can provide.

Thanks @fredrike and @korylprince for you prompt answers

I’ll send you a pm tomorrow morning (CEST) with some suggestions on how to fix it. (we need to copy some udev rules from the hassio-container to the Synology)

big problem here on a Cyberpower PR1500ELCD.
is there someone who can help?

Thanks @fredrike, I’ll wait for your PM.
Are you talking about the fix_usb_device () function?

I’m sorry for the late reply.

Yes I’m thinking that perhaps can the lines 8-9 help.

Thanks @fredrike, I did a try, but nothing change from my site. Still no way to see in /dev or /dev/usb my UPS connected via USB. Don’t understand how Synology manage such a device, putting it in /dev/bus/usb/001. I cannot see any udev.rule to manage it, so I can’t try to do any modification.
Do you have another clue?
And, thanks a lot for your HASSIO on Synology. It works GREAT!

Running plain hassio on a NUC. Sounds like same problem, can’t find device. Can I help with any information from here?

19-10-08 23:22:30 ERROR (SyncWorker_6) [hassio.docker] Can’t start addon_a722577e_apcupsd: 500 Server Error: Internal Server Error (“linux runtime spec devices: error gathering device information while adding custom device “/dev/usb/”: no such file or directory”)

Hi there,

i have an even more complicated setup: Proxmox running a Debian virtual machine on which I installed Hass.io.
Great flexibility but difficult access to external interfaces: can someone point me to some hints how to integrate apcupsd add-on into my system?

Hello,
I’m using the NET version of your addon and have it connected and pulled the ups_status sensor. It currently reads ‘ONLIVE SLAVE’. Unfortunately, when I attempt to initiative a power loss event, the sensor changes state not quite immediately, can I tweak the polling interval? I believe it’s POLLTIME, right, which can be changed via the “extra” parameter?

"extra": [
     {"key": "POLLTIME", "val": 30}
  ]

seems to be giving me an error:

not a valid value for dictionary value @ data['options']. Got {'name': 'APC UPS', 'cable': 'ether', 'type': 'net', 'device': '192.168.x.xxx:3551', 'extra': [{'key': 'POLLTIME', 'val': 30}]}

but

"extra": [
     {"key": "POLLTIME", "val": "30"}
  ]

works…

Also, the time seems to be off in the container. Aside from that thanks for your work.

Hi,

Thanks for this addon!

I think i might need some help configuring this addon to shutdown my esxi host. Yes, i have hassio running virtual on a bare metal esxi host among with some other small vm’s. The APC ups is connected to the host through USB. This addon is working fine and is seeing my UPS.
If im not mistaken i should be able to shutdown/ reboot my esxi host instead of the “hassio host”???

What do i need to do?

Hello. I run hassio on a VM Wsre inside windows server. I have powershute business with my UPS connected with usb. I’ve installed the addon on HA but it keeps saying connection lost… I’m using pcnet type… anyone can help with config of this setup?
I use powershute in host since I want to shutdown other PCs that are on the same UPS via network.
Thanks!

@Dansker You’re getting that message because the hassio supervisor is not detecting an APC UPS USB device. If you are sure the device is plugged in and is supported by apcupsd, you need to make sure you have udev rules set up to create the devices in /dev/usb/.

@mspinolo See above. Ultimately you’ve got to pass the USB devices into the VM running the hassio, and use udev rules there to create the devices in /dev/usb/.

@joelones You’re getting that error because you’re trying to use 30 as an integer. You need to quote it so it’s a string like {"key": "POLLTIME", "val": "30"}

@kurniawan77 Check out this part of the manual for such situations.

@zejulio Have you checked out this part of the manual?