planbnet / livisi_unofficial

Unofficial fork of the home assistant livisi integration without dependencies on the abandoned aiolivisi lib
Apache License 2.0
36 stars 5 forks source link

Login Error with Livisi Unofficial Integration #125

Closed akustikrausch closed 5 months ago

akustikrausch commented 6 months ago

System Health details

Versions Used:

Livisi Unofficial Integration: Version 1.10.0 and 1.11.0 Home Assistant: Latest Version Hardware: Raspberry Pi 4 SHC: SHC Classic Generation 1 Central Unit

Checklist

Describe the issue

I encounter an error in all use cases when entering the IP and password for the Livisi Unofficial Integration

Expected Behavior: The Livisi Unofficial Integration should allow a successful login when the IP and password are entered.

Actual Behavior: The login fails in all the described use cases.

Reproduction steps

  1. The official Livisi integration was installed. Then I tried to install the unofficial integration and complete the migration. Login failed.

  2. Deleted everything and retried the official integration. Login works without issues. Then tried the unofficial integration again and encountered a login error (token problem from log file).

  3. Deleted everything again and tried installing the unofficial integration from scratch without the previous official Livisi integration. Encountered the same error again.

Debug logs

Here is an excerpt from the log file describing the error:

2024-05-28 16:50:04.233 ERROR (MainThread) [custom_components.livisi] 'access_token'
  File "/config/custom_components/livisi/__init__.py", line 106, in async_migrate_entry
  File "/config/custom_components/livisi/coordinator.py", line 61, in async_setup
    self.aiolivisi = await livisi_connect(
  File "/config/custom_components/livisi/livisi_connector.py", line 40, in connect
  File "/config/custom_components/livisi/livisi_connector.py", line 68, in connect
  File "/config/custom_components/livisi/livisi_connector.py", line 144, in _async_retrieve_token
KeyError: 'access_token'

Diagnostics dump

No response

planbnet commented 5 months ago

This is caused be a non-iso-latin-1 char in the password. I have no idea which encoding livisi expects - I tried multiple combinations but the SHC does not seem to adhere to the Content-Type header. I'm simply giving up here, with the workaround to change the password.