HASS integration - First logon
perhusaas opened this issue · comments
I'm trying to connect with the HASS integration, and created a new user (Role: User) for this.
I added one room to test it with.
I the logged on from an "incognito" chrome window, and retrieved the token from "use current token" under "my settings".
I removed the "/" in front of the token and used the host IP address. No connection.
I would suggest to have a way to just use username and password at first login from HA, and then get the token after first logon mabye?
My Z-way system is running in a docker (image "perhu/z-way-server:3.2.2), and i've tried to connect both from a local(in a different docker on the same host) HA system and one on a different host..
Noticed that HASS log shows this error then i try to start the integration with address and UUID:
2022-03-05 17:21:12 ERROR (Thread-62) [websocket] error from callback <bound method ZWaveMe.on_close of <zwave_me_ws.ZWaveMe.ZWaveMe object at 0x7efe56dce430>>: on_close() missing 1 required positional argument: '_'
Please use this fix to the Z-Way: cc62fa2
And don't remove the leading / in the token
I've applied the patch before the previous tests.
in the IP field i've tried the host IP and the internal docker network IP (both HASS and Z-Way share a docker network, but ports are also exposed on the host)
..with theseways of entry in the IP field:
192.168.0.1
wss://192.168.0.1
http://username:pwd@192.168.0.1:8083
and the UUID with and without leading /.
some times, the IP field is not there in the dialog:
does that mean that the entered IP is correct, but the token isn't?
A little update here:
I see if i try "192.168.0.1:8083" way of writing the address, the error message in HASS log is different, and much more elaborate:
2022-03-20 11:12:11 ERROR (Thread-17) [websocket] error from callback <bound method ZWaveMe.on_message of <zwave_me_ws.ZWaveMe.ZWaveMe object at 0x7f16d49b0f40>>: on_message() missing 1 required positional argument: 'utf'
2022-03-20 11:12:11 ERROR (Thread-17) [websocket] error from callback <bound method ZWaveMe.on_message of <zwave_me_ws.ZWaveMe.ZWaveMe object at 0x7f16d49b0f40>>: on_message() missing 1 required positional argument: 'utf'
2022-03-20 11:12:16 ERROR (Thread-17) [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'
So it's in this case missing the last argument - "UTF"?
We are updating the message: home-assistant/core#68456
I'm still no closer to connecting HASS, now tried with z-way 3.2.3 and HASS 2022.4.6.. Same log response as before..
Any ideas?
I still wonder if the initial login should be a user/password as the token stuff seems complicated?
This is interesting,
I set up z-way and HASS in dockers on a different machine, clean installs without any sensors. They connected together with no problem!
This instance worked with my production z-way system as well, so i guess the issue is with the config files in my production hass install. I Will try a fresh install there too.
(issue can be closed)