HA ZWave controls stop working

Wasn’t really sure how best to word the title, but some time back, I migrated my ZWave over to ZWave JS UI running on a RPi and HA running in a Debian 11 virtual machine. After I got that migrated, it has been working flawlessly, until suddenly a month or two ago, all of the sliders on my dashboard ceased to function. They appeared to be greyed out, and the sensors I have on the dashboard that are supplied by a ZWave switch showed ‘unavailable’. When it first cropped up, no changes had been made recently and I had been running a 2022.5.5 and it had been solid. Just restarting the HA service brought it back up, functioning like normal. It’s since happened a few more times, and this weekend, I upgraded to 2023.1.7, which was as far as I could go with Debian 11 and the built-in version of Python.

A little bit after I upgraded to 2023.1.7, I found that 2023.4.6 would install on Debian 12 with Python 3.11, so I migrated my install from the Debian 11 machine to a new Debian 12 machine, and everything was functioning properly on 2023.4.6. But then last night, it did it again, and again, just restarting HA brought everything back to a functioning state.

Does anyone have any thoughts as to why it’s suddenly doing this? Anything specific I should be looking at?

Need your ZWaveJS log to even begin to answer.

Well, it seems I can’t paste in the entire logs that I found… it fails with a 502 error, and it seems only images can be attached… might be beneficial to allow .log files as well… But given that ZWaveJS is totally separate from HA, and only restarting HA gets everything working again, doesn’t it seem more likely that it’s an HA issue than a ZwaveJS issue?

On the log files, any suggestions on putting them up here without 16 posts to get the entirety posted up?

I would think you would only need the logs around the failure -a few minutes as opposed to the whole thing.

You can also use the “hide details” option to keep the post from being a mile long.

I had tried using ‘preformatted text’ so it would be contained in a box, but like I said, it tried to save then failed with a 502. I assume it’s too long.

What exactly should I be looking for if I’m looking for a failure? The only things I found when I searched them for ‘fail’ were a few entries that were related to some flakiness I had when I was replacing a previous switches with new ones and a few random ‘route failed here’ messages that don’t seem to be all that troublesome. And of course I can’t look to a time because I have no idea when it went sideways. It could have been at any time between 11pm or so last night and 7:30 this morning.

Edit: And I just noticed that it did it again here, and in the HA Logs, I found this:

# Home Assistant Core

Error doing job: Task exception was never retrieved

2:10:41 PM – (ERROR) components/zwave_js/update.py - message first occurred at 1:00:41 PM and shows up 15 times

Error setting up entry Z-Wave JS for update

12:55:41 PM – (ERROR) helpers/entity_platform.py

Unexpected exception: 1 validation error for ReadyEventModel nodeState -> values -> 5 -> metadata -> states -> __key__ value is not a valid integer (type=type_error.integer)

12:55:41 PM – (ERROR) Z-Wave - message first occurred at 12:55:10 PM and shows up 3 times

Config entry 'Z-Wave JS' for zwave_js integration not ready yet: Failed to connect: Cannot connect to host 192.168.**.**:3000 ssl:default [Connect call failed ('192.168.**.**', 3000)]; Retrying in background

12:54:35 PM – (WARNING) config_entries.py

Here’s what’s in the home-assistant.log:
Part 1

2023-06-21 12:54:35.561 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Z-Wave JS' for zwave_js integration not ready yet: Failed to connect: Cannot connect to host 192.168.**.**:3000 ssl:default [Connect call failed ('192.168.**.**', 3000)]; Retrying in background
2023-06-21 12:55:10.761 ERROR (MainThread) [homeassistant.components.zwave_js] Unexpected exception: 1 validation error for ReadyEventModel
nodeState -> values -> 5 -> metadata -> states -> __key__
  value is not a valid integer (type=type_error.integer)
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/__init__.py", line 765, in client_listen
    await client.listen(driver_ready)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 261, in listen
    await self.receive_until_closed()
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 329, in receive_until_closed
    self._handle_incoming_message(data)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 412, in _handle_incoming_message
    self.driver.receive_event(event)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/driver.py", line 83, in receive_event
    self.controller.receive_event(event)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/controller/__init__.py", line 813, in receive_event
    node.receive_event(event)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/node/__init__.py", line 416, in receive_event
    NODE_EVENT_MODEL_MAP[event.type](**event.data)
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for ReadyEventModel
nodeState -> values -> 5 -> metadata -> states -> __key__
  value is not a valid integer (type=type_error.integer)
2023-06-21 12:55:33.084 ERROR (MainThread) [homeassistant.components.zwave_js] Unexpected exception: 1 validation error for ReadyEventModel
nodeState -> values -> 5 -> metadata -> states -> __key__
  value is not a valid integer (type=type_error.integer)
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/__init__.py", line 765, in client_listen
    await client.listen(driver_ready)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 261, in listen
    await self.receive_until_closed()
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 329, in receive_until_closed
    self._handle_incoming_message(data)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 412, in _handle_incoming_message
    self.driver.receive_event(event)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/driver.py", line 83, in receive_event
    self.controller.receive_event(event)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/controller/__init__.py", line 813, in receive_event
    node.receive_event(event)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/node/__init__.py", line 416, in receive_event
    NODE_EVENT_MODEL_MAP[event.type](**event.data)
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for ReadyEventModel
nodeState -> values -> 5 -> metadata -> states -> __key__
  value is not a valid integer (type=type_error.integer)
2023-06-21 12:55:41.043 ERROR (MainThread) [homeassistant.components.zwave_js] Unexpected exception: 1 validation error for ReadyEventModel
nodeState -> values -> 5 -> metadata -> states -> __key__
  value is not a valid integer (type=type_error.integer)
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/__init__.py", line 765, in client_listen
    await client.listen(driver_ready)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 261, in listen
    await self.receive_until_closed()
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 329, in receive_until_closed
    self._handle_incoming_message(data)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 412, in _handle_incoming_message
    self.driver.receive_event(event)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/driver.py", line 83, in receive_event
    self.controller.receive_event(event)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/controller/__init__.py", line 813, in receive_event
    node.receive_event(event)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/node/__init__.py", line 416, in receive_event
    NODE_EVENT_MODEL_MAP[event.type](**event.data)
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for ReadyEventModel
nodeState -> values -> 5 -> metadata -> states -> __key__
  value is not a valid integer (type=type_error.integer)
2023-06-21 12:55:41.746 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Z-Wave JS for update
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/config_entries.py", line 383, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/update/__init__.py", line 117, in async_setup_entry
    return await component.async_setup_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/helpers/entity_component.py", line 177, in async_setup_entry
    return await self._platforms[key].async_setup_entry(config_entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/helpers/entity_platform.py", line 267, in async_setup_entry
    return await self._async_setup_platform(async_create_setup_task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/helpers/entity_platform.py", line 304, in _async_setup_platform
    await asyncio.shield(task)
asyncio.exceptions.CancelledError
2023-06-21 13:00:41.783 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/update.py", line 209, in _async_update
    await self.driver.controller.async_get_available_firmware_updates(
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/controller/__init__.py", line 772, in async_get_available_firmware_updates
    data = await self.client.async_send_command(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 114, in async_send_command
    await self._send_json_message(message)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 420, in _send_json_message
    raise NotConnected
zwave_js_server.exceptions.NotConnected
2023-06-21 13:05:41.783 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/update.py", line 209, in _async_update
    await self.driver.controller.async_get_available_firmware_updates(
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/controller/__init__.py", line 772, in async_get_available_firmware_updates
    data = await self.client.async_send_command(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 114, in async_send_command
    await self._send_json_message(message)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 420, in _send_json_message
    raise NotConnected
zwave_js_server.exceptions.NotConnected
2023-06-21 13:10:41.782 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/update.py", line 209, in _async_update
    await self.driver.controller.async_get_available_firmware_updates(
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/controller/__init__.py", line 772, in async_get_available_firmware_updates
    data = await self.client.async_send_command(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 114, in async_send_command
    await self._send_json_message(message)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 420, in _send_json_message
    raise NotConnected
zwave_js_server.exceptions.NotConnected
2023-06-21 13:15:41.782 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/update.py", line 209, in _async_update
    await self.driver.controller.async_get_available_firmware_updates(
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/controller/__init__.py", line 772, in async_get_available_firmware_updates
    data = await self.client.async_send_command(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 114, in async_send_command
    await self._send_json_message(message)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 420, in _send_json_message
    raise NotConnected
zwave_js_server.exceptions.NotConnected
2023-06-21 13:20:41.783 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/update.py", line 209, in _async_update
    await self.driver.controller.async_get_available_firmware_updates(
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/controller/__init__.py", line 772, in async_get_available_firmware_updates
    data = await self.client.async_send_command(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 114, in async_send_command
    await self._send_json_message(message)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 420, in _send_json_message
    raise NotConnected
zwave_js_server.exceptions.NotConnected
2023-06-21 13:25:41.782 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/update.py", line 209, in _async_update
    await self.driver.controller.async_get_available_firmware_updates(
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/controller/__init__.py", line 772, in async_get_available_firmware_updates
    data = await self.client.async_send_command(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 114, in async_send_command
    await self._send_json_message(message)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 420, in _send_json_message
    raise NotConnected
zwave_js_server.exceptions.NotConnected
2023-06-21 13:30:41.784 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/update.py", line 209, in _async_update
    await self.driver.controller.async_get_available_firmware_updates(
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/controller/__init__.py", line 772, in async_get_available_firmware_updates
    data = await self.client.async_send_command(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 114, in async_send_command
    await self._send_json_message(message)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 420, in _send_json_message
    raise NotConnected
zwave_js_server.exceptions.NotConnected
2023-06-21 13:35:41.784 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/update.py", line 209, in _async_update
    await self.driver.controller.async_get_available_firmware_updates(
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/controller/__init__.py", line 772, in async_get_available_firmware_updates
    data = await self.client.async_send_command(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 114, in async_send_command
    await self._send_json_message(message)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 420, in _send_json_message
    raise NotConnected
zwave_js_server.exceptions.NotConnected
2023-06-21 13:40:41.783 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/update.py", line 209, in _async_update
    await self.driver.controller.async_get_available_firmware_updates(
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/controller/__init__.py", line 772, in async_get_available_firmware_updates
    data = await self.client.async_send_command(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 114, in async_send_command
    await self._send_json_message(message)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 420, in _send_json_message
    raise NotConnected
zwave_js_server.exceptions.NotConnected
2023-06-21 13:45:41.783 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/update.py", line 209, in _async_update
    await self.driver.controller.async_get_available_firmware_updates(
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/controller/__init__.py", line 772, in async_get_available_firmware_updates
    data = await self.client.async_send_command(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 114, in async_send_command
    await self._send_json_message(message)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 420, in _send_json_message
    raise NotConnected
zwave_js_server.exceptions.NotConnected
2023-06-21 13:50:41.783 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/update.py", line 209, in _async_update
    await self.driver.controller.async_get_available_firmware_updates(
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/controller/__init__.py", line 772, in async_get_available_firmware_updates
    data = await self.client.async_send_command(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Part 2

  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 114, in async_send_command
    await self._send_json_message(message)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 420, in _send_json_message
    raise NotConnected
zwave_js_server.exceptions.NotConnected
2023-06-21 13:55:41.783 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/update.py", line 209, in _async_update
    await self.driver.controller.async_get_available_firmware_updates(
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/controller/__init__.py", line 772, in async_get_available_firmware_updates
    data = await self.client.async_send_command(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 114, in async_send_command
    await self._send_json_message(message)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 420, in _send_json_message
    raise NotConnected
zwave_js_server.exceptions.NotConnected
2023-06-21 14:00:41.782 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/update.py", line 209, in _async_update
    await self.driver.controller.async_get_available_firmware_updates(
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/controller/__init__.py", line 772, in async_get_available_firmware_updates
    data = await self.client.async_send_command(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 114, in async_send_command
    await self._send_json_message(message)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 420, in _send_json_message
    raise NotConnected
zwave_js_server.exceptions.NotConnected
2023-06-21 14:05:41.783 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/update.py", line 209, in _async_update
    await self.driver.controller.async_get_available_firmware_updates(
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/controller/__init__.py", line 772, in async_get_available_firmware_updates
    data = await self.client.async_send_command(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 114, in async_send_command
    await self._send_json_message(message)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 420, in _send_json_message
    raise NotConnected
zwave_js_server.exceptions.NotConnected
2023-06-21 14:10:41.784 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/update.py", line 209, in _async_update
    await self.driver.controller.async_get_available_firmware_updates(
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/controller/__init__.py", line 772, in async_get_available_firmware_updates
    data = await self.client.async_send_command(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 114, in async_send_command
    await self._send_json_message(message)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 420, in _send_json_message
    raise NotConnected
zwave_js_server.exceptions.NotConnected
2023-06-21 14:16:04.497 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140287137361040] Error handling message: Unknown error (unknown_error) dave from 192.168.41.114 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36)
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
    await func(hass, connection, msg)
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/api.py", line 483, in websocket_network_status
    controller.update(await controller.async_get_state())
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/controller/__init__.py", line 678, in async_get_state
    data = await self.client.async_send_command(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 114, in async_send_command
    await self._send_json_message(message)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 420, in _send_json_message
    raise NotConnected
zwave_js_server.exceptions.NotConnected
2023-06-21 14:16:04.549 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140287137361040] Error handling message: Unknown error (unknown_error) dave from 192.168.41.114 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36)
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
    await func(hass, connection, msg)
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/api.py", line 360, in async_handle_failed_command_func
    await orig_func(hass, connection, msg, *args, **kwargs)
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/api.py", line 311, in async_get_entry_func
    await orig_func(hass, connection, msg, entry, client, driver)
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/api.py", line 1897, in websocket_data_collection_status
    ENABLED: await driver.async_is_statistics_enabled(),
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/driver.py", line 140, in async_is_statistics_enabled
    result = await self._async_send_command(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/driver.py", line 96, in _async_send_command
    return await self.client.async_send_command(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 114, in async_send_command
    await self._send_json_message(message)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 420, in _send_json_message
    raise NotConnected
zwave_js_server.exceptions.NotConnected
2023-06-21 14:16:04.553 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140287137361040] Error handling message: Unknown error (unknown_error) dave from 192.168.41.114 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36)
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
    await func(hass, connection, msg)
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/api.py", line 360, in async_handle_failed_command_func
    await orig_func(hass, connection, msg, *args, **kwargs)
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/api.py", line 311, in async_get_entry_func
    await orig_func(hass, connection, msg, entry, client, driver)
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/api.py", line 962, in websocket_get_provisioning_entries
    provisioning_entries = await driver.controller.async_get_provisioning_entries()
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/model/controller/__init__.py", line 358, in async_get_provisioning_entries
    data = await self.client.async_send_command(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 114, in async_send_command
    await self._send_json_message(message)
  File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 420, in _send_json_message
    raise NotConnected
zwave_js_server.exceptions.NotConnected
2023-06-21 14:16:16.154 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Z-Wave JS for sensor
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/config_entries.py", line 539, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/sensor/__init__.py", line 137, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/helpers/entity_component.py", line 184, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2023-06-21 14:16:16.201 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Z-Wave JS for button
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/config_entries.py", line 539, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/button/__init__.py", line 72, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/helpers/entity_component.py", line 184, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2023-06-21 14:16:16.223 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Z-Wave JS for sensor
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/config_entries.py", line 539, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/sensor/__init__.py", line 137, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/helpers/entity_component.py", line 184, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2023-06-21 14:16:16.225 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Z-Wave JS for button
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/config_entries.py", line 539, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/button/__init__.py", line 72, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/helpers/entity_component.py", line 184, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2023-06-21 14:16:16.226 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Z-Wave JS for switch
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/config_entries.py", line 539, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/switch/__init__.py", line 89, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/helpers/entity_component.py", line 184, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2023-06-21 14:16:16.239 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Z-Wave JS for fan
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/config_entries.py", line 539, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/fan/__init__.py", line 175, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/helpers/entity_component.py", line 184, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2023-06-21 14:16:16.262 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Z-Wave JS for binary_sensor
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/config_entries.py", line 539, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/binary_sensor/__init__.py", line 175, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/helpers/entity_component.py", line 184, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2023-06-21 14:16:16.283 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Z-Wave JS for light
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/config_entries.py", line 539, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/light/__init__.py", line 636, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/helpers/entity_component.py", line 184, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2023-06-21 14:16:16.291 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Z-Wave JS for number
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/config_entries.py", line 539, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/number/__init__.py", line 120, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/helpers/entity_component.py", line 184, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2023-06-21 14:16:16.321 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Z-Wave JS for update
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/config_entries.py", line 539, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/update/__init__.py", line 123, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/helpers/entity_component.py", line 184, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!

This bug was fixed. You should update HA to the latest.

Do you happen to have any info on the bug so I can look into it? And any thoughts as to why it worked perfectly for months on 2022.5.5 and then it randomly popped up with not having had any changes pretty much since I upgraded to 2022.5.5?

You never once updated Z-Wave JS in that time?

No. According to the release info at the time, ZWaveJS was quite a bit ahead of where it needed to be for HA, and according to ZWaveJS UI now, the version I’m running is still the latest in the stable channel.

zwave-js-ui: 8.18.1.6b838b5
zwave-js: 10.23.2

refresh-date: today at 06:57 CDT
channels:
  latest/stable:    v8.18.1 2023-06-21 (195) 147MB -
  latest/candidate: v8.19.0 2023-06-21 (198) 148MB -
  latest/beta:      ↑                              
  latest/edge:      v8.19.0 2023-06-20 (198) 148MB -
installed:          v8.18.1            (195) 147MB -

Z-Wave JS UI 8.18.1 was released 2023-06-12, barely over a week ago, so it’s impossible to say that you have had no changes for months. Upgrading Z-Wave JS will always have the potential of affecting HA behavior, whether or not you upgrade HA.

There was a change in Z-Wave JS v10.20.0 that caused the exception in HA. The HA python library was patched, and then HA pulled in the patch in 2023.5.4. Based on that, it’s clear that your problems started after you upgraded Z-Wave JS UI to a version that included driver Z-Wave JS v10.20.0. Now upgrading HA to 2023.5.4 or later should fix that particular “Unexpected exception”.

Good catch, I somehow missed that… I have not actively updated/upgraded anything from when I got HA running on 2022.5.5 and connecting to the external ZWaveJS instance on a RPi until this weekend, and it ran for several months like that without issue, so ZwaveJS must be automatically upgrading without external input - something I HATE - I’ll have to see if that can be disabled. Automatic updates are a great way to break things and not have a clue what the heck happened, nor have a way to revert to a previous version if something goes sideways.

Edit: in case anyone else is running something similar and is interested, you can hold automatic updates of the ZWaveJS UI Snap package using the command ‘snap refresh --hold zwave-js-ui’