I have installed the nut package on my Ubuntu 20.04 system and believe I have it configured correctly. I can do a upsc command and see the attributes of my UPS. I have nut-server and nut-client running although there’s an issue with the pid file:
sudo service nut-client status
● nut-monitor.service - Network UPS Tools - power device monitor and shutdown controller
Loaded: loaded (/lib/systemd/system/nut-monitor.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2020-07-29 14:08:35 CDT; 11min ago
Process: 11220 ExecStart=/sbin/upsmon (code=exited, status=0/SUCCESS)
Main PID: 11223 (upsmon)
Tasks: 2 (limit: 19067)
Memory: 1.0M
CGroup: /system.slice/nut-monitor.service
├─11221 /lib/nut/upsmon
└─11223 /lib/nut/upsmon
Jul 29 14:08:35 automation-server systemd[1]: Starting Network UPS Tools - power device monitor and shutdown controller...
Jul 29 14:08:35 automation-server upsmon[11220]: fopen /run/nut/upsmon.pid: No such file or directory
Jul 29 14:08:35 automation-server upsmon[11220]: UPS: serverups@localhost (master) (power value 1)
Jul 29 14:08:35 automation-server upsmon[11220]: Using power down flag file /etc/killpower
Jul 29 14:08:35 automation-server systemd[1]: nut-monitor.service: Can't open PID file /run/nut/upsmon.pid (yet?) after start: Operation not permitted
Jul 29 14:08:35 automation-server upsmon[11221]: Startup successful
Jul 29 14:08:35 automation-server systemd[1]: nut-monitor.service: Supervising process 11223 which is not our child. We'll most likely not notice when it exits.
Jul 29 14:08:35 automation-server systemd[1]: Started Network UPS Tools - power device monitor and shutdown controller.
Ok, now to the problem. When I attempt the integration install in HACS, it opens a dialog and asks for hostname, port, user, and password. I put those in and I just get “Unknown error occurred” at the top of the dialog.
Looking in the home-assistant.log file, I see one of these for each attempt to integrate:
2020-07-29 14:13:02 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 418, in start
resp = await task
File "/srv/homeassistant/lib/python3.8/site-packages/aiohttp/web_app.py", line 458, in _handle
resp = await handler(request)
File "/srv/homeassistant/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
return await handler(request)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/real_ip.py", line 39, in real_ip_middleware
return await handler(request)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/ban.py", line 73, in ban_middleware
return await handler(request)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/auth.py", line 127, in auth_middleware
return await handler(request)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/view.py", line 129, in handle
result = await result
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/config/config_entries.py", line 145, in post
return await super().post(request, flow_id)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/data_validator.py", line 60, in wrapper
result = await method(view, request, *args, **kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/data_entry_flow.py", line 106, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/data_entry_flow.py", line 153, in async_configure
result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/data_entry_flow.py", line 201, in _async_handle_step
result: Dict = await getattr(flow, method)(user_input)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/nut/config_flow.py", line 174, in async_step_user
if self._host_port_alias_already_configured(self.nut_config):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/nut/config_flow.py", line 216, in _host_port_alias_already_configured
existing_host_port_aliases = {
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/nut/config_flow.py", line 217, in <setcomp>
_format_host_port_alias(entry.data)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/nut/config_flow.py", line 106, in _format_host_port_alias
host = user_input[CONF_HOST]
KeyError: 'host'
Has anyone seen and solved this problem before?