I had issues starting mine as i already had a APCUPSD server running on the same machine, so it could not start because port was in use (error message: 3551: bind: address already in use).
Only found by using Docker Portainer to manually start as the hassio interface does not give error messages!
Error message before removing other server: 18-09-09 19:21:11 ERROR (SyncWorker_3) [hassio.docker] Can't start addon_a722577e_apcupsd: 500 Server Error: Internal Server Error ("driver failed programming external connectivity on endpoint addon_a722577e_apcupsd (77b4e8f39e7d0e20f99dc3f9e8b611fc5c13e354d74d94e445ea15d9fb120e03): Error starting userland proxy: listen tcp 0.0.0.0:3551: bind: address already in use")
Error message after removing other server: 18-09-09 19:27:55 ERROR (SyncWorker_0) [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")
Hello all. Iām sorry for the lack of activity here. Life has been pretty busy.
Iāve released version 1.6 which is really just version updates, but with it I also released a second version of the add-on for use with network UPSs. Just refresh the repository in your Hass.io dashboard and you should see the second add-on show up.
If you have issues with it, please create an issue on Github.
Iāve made the decision not to try and make multiple UPSs work in the add-on. You can technically use two (one USB and one network) if you run both add-ons (make sure to use different ports.)
Beyond that, I just donāt have the time to devote to making that work. Iāll happily accept a PR if someone wants to work on that feature
Hello and congrats on a great job!
I have just adquired an APC UPS, installed your add-on and everything seems to work perfect, thank you.
Where can I find the logic under the provided scripts for commfailure, offbattery, changeme, commok and onbattery. I assume everything is working fine as I can see the sensors and no error found in the logs, but realy donāt know what to expect on those events.
Sorry if the question is very basic, Iām quite newby.
Thank you very much for your quick answer, I will take a clorser look at the information and try to undestand how it works. Just one quick question to try get a better undestanding, does the add-on shutdown hassio or the host (rpi in my case) when any of the predeffined conditions are met? Which one?
Thanks again for the great add-on and your help!
Hello,
I have a problem with the deamon.
The shutdown of the machine is initiated five minutes aprox after I cut the power of the inverter.
But the inverter is new, battery is new, the load is very low (16 W on a 900 WUPS)
I donāt know what is the cause of the initiated shutdown?
I donāt overrided default apcupsd parameter.
When the machine is down the inverter provide output power.
I run apcaccess as you explain and all values are normal.
The autonomy is 340 min when the server shutdownā¦
Iām assuming youāre Vorms on Github. If so, please make sure you fix that issue first to see if it fixes your issue.
If you still have an issue after fixing that (and you are actually running this add-on on Hass.io), please cut the power, wait a couple of minutes, then copy the add-on logs so I can see whatās going on. Also please show the full add-on configuration.
hello,
Yes, i am the same person on github, sorry to spam you.
Yes, I run Hass.io
Yes the inverter is new.
I miss understanted how to configur the apcupsd deamon on hass.io.
So, in the configuration.yaml I have nothing but the declaration of the service (apcupsd:) and the sensors.
I can also display the remaining time and all value on the display, and the binary sensor.
I installad power chute on my windows pc with the same load, and after 10 minutes nothing special.
So, no shutdown is initiated.
I reconnect the usb cable to the linux machine and cut the power again, and after 5 minutes, the machine initiate the shutdown procedure.
Here is the result of the access command, connecting with ssh as you explain in this web page:
Here is the log of the deamon on the hass.io add on page:
Aug 20 20:30:18 a722577e-apcupsd syslog.info syslogd started: BusyBox v1.30.1
Aug 21 00:30:18 a722577e-apcupsd daemon.notice apcupsd[6]: apcupsd 3.14.14 (31 May 2016) unknown startup succeeded
Aug 21 00:30:18 a722577e-apcupsd daemon.info apcupsd[6]: NIS server startup succeeded
Aug 21 00:43:02 a722577e-apcupsd daemon.crit apcupsd[6]: Power failure.
Aug 21 00:43:08 a722577e-apcupsd daemon.crit apcupsd[6]: Running on UPS batteries.
send-mail: account default not found: no configuration file available
Aug 21 00:46:46 a722577e-apcupsd daemon.crit apcupsd[6]: Mains returned. No longer on UPS batteries.
Aug 21 00:46:46 a722577e-apcupsd daemon.alert apcupsd[6]: Power is back. UPS running on mains.
send-mail: account default not found: no configuration file available
Aug 21 00:53:44 a722577e-apcupsd daemon.crit apcupsd[6]: Power failure.
Aug 21 00:53:50 a722577e-apcupsd daemon.crit apcupsd[6]: Running on UPS batteries.
send-mail: account default not found: no configuration file available
Aug 21 01:08:44 a722577e-apcupsd daemon.crit apcupsd[6]: Mains returned. No longer on UPS batteries.
Aug 21 01:08:44 a722577e-apcupsd daemon.alert apcupsd[6]: Power is back. UPS running on mains.
send-mail: account default not found: no configuration file available
Aug 24 02:32:03 a722577e-apcupsd daemon.warn apcupsd[6]: Communications with UPS lost.
send-mail: account default not found: no configuration file available
Aug 24 02:49:01 a722577e-apcupsd daemon.warn apcupsd[6]: Communications with UPS restored.
Aug 24 02:49:02 a722577e-apcupsd daemon.crit apcupsd[6]: Power failure.
send-mail: account default not found: no configuration file available
Aug 24 02:49:07 a722577e-apcupsd daemon.crit apcupsd[6]: Running on UPS batteries.
Aug 24 02:49:07 a722577e-apcupsd daemon.crit apcupsd[6]: Mains returned. No longer on UPS batteries.
Aug 24 02:49:07 a722577e-apcupsd daemon.alert apcupsd[6]: Power is back. UPS running on mains.
send-mail: account default not found: no configuration file available
send-mail: account default not found: no configuration file available
Aug 24 03:05:57 a722577e-apcupsd daemon.crit apcupsd[6]: Power failure.
Aug 24 03:06:02 a722577e-apcupsd daemon.crit apcupsd[6]: Running on UPS batteries.
send-mail: account default not found: no configuration file available
Aug 24 03:14:18 a722577e-apcupsd daemon.crit apcupsd[6]: Mains returned. No longer on UPS batteries.
Aug 24 03:14:18 a722577e-apcupsd daemon.alert apcupsd[6]: Power is back. UPS running on mains.
send-mail: account default not found: no configuration file available
Blockquote
So in resume, in the hass.io apcupsd, the machine is executing the shutdown after 5 minute of power line down.
So, i would like to know the reason wich the shutdown is initiated.
Best regards and thank you very much for helping me !
You need to replace the http://hassio:8123 part with whatever you normally use to connect to home assistant. On that page, scroll down to the āConfigā section. Thatās where you set the add-on configuration.
Assuming that doesnāt have any weird options in it, it sounds like your UPS may be sending bad data randomly. This (very old) post shows some issues like that. If your configuration is correct, you may need to turn to the apcupsd mailing lists so they can help you diagnose and fix whatās going on.
If you just want to prevent the shutdown completely by this add-on, read the README.
Hello,
Yes, i undestand the config is on the addon page and not in the configuartion.yaml page.
I just have the default config.
I already write to the apcupsd mailing list and my request is pendingā¦
It seems with the powerchute windows software, the beahviour is correct.
Why it sound like the ups send bad data ?
I didnāt see the shtudown reason in any log.
Is that possible to have more detailled log ? changing the log level ?
Is that possible to have the log of the data from and to the ups ?
Many thanks for your help and best regards
Thierry
@korylprince I have been running apcupsd forever and recently found itās not working I run Hass in a Virtual box VM and have never used the apcupsd add-onā¦ I only now realised that a add-on exists (when looking at the integrations). Iām not sure what has gone wrong or maybe Iāve gone mad! Iāve gone back in the release notes just incase there was breaking changes but I canāt find anything.
I tried running the add-on and it wonāt start, and no info in the add-on log.
really confused here and unsure how to progress.
I did very recently rebuild hass in a new vm and restored the config- maybe related to thisā¦
from the homeassistant log:
2019-09-01 23:57:45 WARNING (MainThread) [homeassistant.setup] Setup of apcupsd is taking over 10 seconds.
2019-09-01 23:58:05 ERROR (SyncWorker_0) [homeassistant.components.apcupsd] Failure while testing APCUPSd status retrieval.
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/apcupsd/__init__.py", line 51, in setup
DATA.update(no_throttle=True)
File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 240, in wrapper
result = method(*args, **kwargs)
File "/usr/src/homeassistant/homeassistant/components/apcupsd/__init__.py", line 88, in update
self._status = self._get_status()
File "/usr/src/homeassistant/homeassistant/components/apcupsd/__init__.py", line 83, in _get_status
return self._parse(self._get(host=self._host, port=self._port))
File "/usr/local/lib/python3.7/site-packages/apcaccess/status.py", line 37, in get
sock.connect((host, port))
socket.timeout: timed out
2019-09-01 23:58:05 ERROR (MainThread) [homeassistant.setup] Setup failed for apcupsd: Integration failed to initialize.
2019-09-01 23:58:05 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform apcupsd.sensor: Unable to set up component.
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.
So, Apcupsd is running via USB on the host machine (Win10). APCupsd appears OK on the host machine-
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
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?