Z-Wave-Me / home-automation

Z-Way Home Automation engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HASS Integration worked for four days - now all devices show unavailable

perhusaas opened this issue · comments

As the topic says. I restarted HASS, no effect.

Home Assistant logs show an error that i saw earlier as well, some websocket issue?

2022-05-05 22:03:04 ERROR (Thread-3) [websocket] error from callback <bound method ZWaveMe.on_message of <zwave_me_ws.ZWaveMe.ZWaveMe object at 0x7f0c62705b20>>: on_message() missing 1 required positional argument: 'utf'
2022-05-05 22:04:02 ERROR (Thread-3) [root] Uncaught thread exception
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/websocket/_app.py", line 305, in run_forever
dispatcher.read(self.sock.sock, read, check)
File "/usr/local/lib/python3.9/site-packages/websocket/_app.py", line 53, in read
if not read_callback():
File "/usr/local/lib/python3.9/site-packages/websocket/_app.py", line 269, in read
return teardown()
File "/usr/local/lib/python3.9/site-packages/websocket/_app.py", line 230, in teardown
if thread and thread.isAlive():
AttributeError: 'Thread' object has no attribute 'isAlive'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.9/threading.py", line 910, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.9/site-packages/zwave_me_ws/ZWaveMe.py", line 137, in init_websocket
self._ws.run_forever(ping_interval=5)
File "/usr/local/lib/python3.9/site-packages/zwave_me_ws/WebsocketListener.py", line 56, in run_forever
websocket.WebSocketApp.run_forever(
File "/usr/local/lib/python3.9/site-packages/websocket/_app.py", line 311, in run_forever
teardown()
File "/usr/local/lib/python3.9/site-packages/websocket/_app.py", line 230, in teardown
if thread and thread.isAlive():
AttributeError: 'Thread' object has no attribute 'isAlive'
2022-05-05 22:04:03 ERROR (Thread-7) [websocket] error from callback <bound method ZWaveMe.on_message of <zwave_me_ws.ZWaveMe.ZWaveMe object at 0x7f0c5a2c94f0>>: on_message() missing 1 required positional argument: 'utf'

This is not an issue with the integration. You need to upgrade your HA and site-packages.

isAlive was deprecated in Python 3.9 in favor of is_alive.

Please fix:
File "/usr/local/lib/python3.9/site-packages/websocket/_app.py", line 230

Or better upgrade the websocket package to match Python 3.9

Ok, but i'm left with a few questions:
Why did this problem emerge after days of operation if the websocket package was old/wrong?
HASS installation is in docker published by HASS, so packages should be up to date?

In any case i will install an updated package. Thanks.

I think the code never reached this point for four days. Anyway, this is inside websocket package. The only thing we can do is to bump the version of websocket package to depend on.

For future reference to docker users - this problem was solved by changing to network_mode: "host" for the HASS container.