Bottom line: The ZWave integration will NOT install on a fresh HA system on a barebones Pi4.
(This is related to this topic but with more information and looking at it with a different point of view.)
Do I have to have a ZWave dongle on my system for the integration to install? I can’t get the integration to install at all on a new Pi4 system with no extra hardware.
More details:
I have a Pi4 that worked okay with ZWaveJS2MSQTT with an Aeotec ZStick 7. I changed that system to Home Assistant and added the ZWave integration with no problem. But, for various reasons, I wanted a fresh install of HA on that system. I write out a new HA image to an SD card, turned off the Pi4, then put in the new HA image and started it up. Whenever I added the ZWave integration, I’d get vague and useless errors. I’ve had problems, in the past, with the device nodes being unreadable in some programs, and it meant I had to write a udev rule to make sure the ZWave node in /dev was accessible to the program. (I think that happened to me a good while back in HA, when I first started it, but I’m not sure. I know it did happen to me last week with openHAB.)
That made me wonder if the dev node file could be an issue, so I pulled the USB ZStick and wrote a new HA image to a new SD card and put that in.
So this is a Pi4 with no extra hardware. It’s a brand new install of HA, updated, and it won’t install the ZWave integration. Note, also, that previously, I could install ZWave with no problem. So something must have happened to this Pi4 hardware that makes it suddenly unable to install this.
Here’s screenshots. I go to Settings->Integrations->Add Integration:
I pick the ZWave integration, the one that’s selected, the 2nd one in the list and, on a fresh system, I get this:
I continue with the box checked (which is what worked in the past and works on my other HA system). Then I get this:
I wait and watch. Then I get a flicker as a dialog box comes up, but disappears in an instant. It’s larger than the status box saying installation of the add-on has started, but I can’t see anything on it because it’s almost instantly replaced by this:
So I go back to the start and try installing again. I get the dialog asking if I’m using the ZWaveJS add-on again. I proceed as before and now, since the ZWaveJS add-on is installed, I get this:
So if I install fresh, I get “Error.” If I install with the ZWaveJS add-on already on my system, I get “Unknown Error Occurred.”
I have tried this with the USB Z-Stick on the system. No difference.
This appears to be the error message (I have log levels set to debug in configuration.yaml) and stack trace:
2022-09-17 16:43:59.050 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 82, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 169, in get
return await super().get(request, flow_id)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 96, in get
result = await self._flow_mgr.async_configure(flow_id)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 280, in async_configure
result = await self._async_handle_step(
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File "/usr/src/homeassistant/homeassistant/components/zwave_js/config_flow.py", line 609, in async_step_configure_addon
ports = await async_get_usb_ports(self.hass)
File "/usr/src/homeassistant/homeassistant/components/zwave_js/config_flow.py", line 144, in async_get_usb_ports
return await hass.async_add_executor_job(get_usb_ports)
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/zwave_js/config_flow.py", line 128, in get_usb_ports
usb_device = usb.usb_device_from_port(port)
File "/usr/src/homeassistant/homeassistant/components/usb/utils.py", line 13, in usb_device_from_port
vid=f"{hex(port.vid)[2:]:0>4}".upper(),
TypeError: 'NoneType' object cannot be interpreted as an integer