loopj / home-assistant-vantage

Home Assistant integration for Vantage InFusion home automation controllers.
MIT License
9 stars 4 forks source link

Client does not reconnect after login failure #61

Closed ptr727 closed 1 year ago

ptr727 commented 1 year ago

System Health details

System Information

version core-2023.8.4
installation_type Home Assistant Container
dev false
hassio false
docker true
user root
virtualenv false
python_version 3.11.4
os_name Linux
os_version 6.2.16-8-pve
arch x86_64
timezone America/Los_Angeles
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4971 Installed Version | 1.32.1 Stage | running Available Repositories | 1336 Downloaded Repositories | 3
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | January 31, 2024 at 4:00 PM relayer_connected | true relayer_region | us-east-1 remote_enabled | true remote_connected | true alexa_enabled | false google_enabled | false remote_server | us-east-1-6.ui.nabu.casa certificate_status | ready can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Dashboards dashboards | 1 -- | -- resources | 0 views | 20 mode | storage
Recorder oldest_recorder_run | August 19, 2023 at 9:02 AM -- | -- current_recorder_run | August 25, 2023 at 2:03 AM estimated_db_size | 1010.11 MiB database_engine | mysql database_version | 10.11.4

Checklist

Describe the issue

Network client does not reconnect after a controller firmware update.
Log contains repeated aiovantage.errors.LoginRequiredError: "Requires Login" errors.

Reproduction steps

Update controller firmware:

  1. Use DesignCenter v4.6 and update controller firmware from v4.5 to v4.6.
  2. After controller update the password is reset to controller serial number.
  3. Use DesignCenter and restore the password to the original value.
  4. Observe that logs are full of aiovantage.errors.LoginRequiredError: "Requires Login" errors.

Reproduce as follows:

  1. Use DC to change the password.
  2. Drop the controller network connection.
  3. Restore the controller network connection.
  4. Use DC to restore the password.
  5. Observe that logs are full of aiovantage.errors.LoginRequiredError: "Requires Login" errors.

Debug logs

2023-08-25 12:09:50.316 DEBUG (MainThread) [aiovantage.command_client.commands] Sending command: INVOKE 62 CurrentSensor.GetCurrentHW
2023-08-25 12:09:50.317 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.current_sensor_line_d_5 fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 699, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 938, in async_device_update
    await self.async_update()
  File "/config/custom_components/vantage/sensor.py", line 77, in async_update
    await self.client.omni_sensors.get_level(self.obj.id)
  File "/usr/local/lib/python3.11/site-packages/aiovantage/controllers/omni_sensors.py", line 61, in get_level
    response = await self.command_client.command("INVOKE", vid, method)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiovantage/command_client/commands.py", line 122, in command
    raw_response = await self.raw_request(request, connection=connection)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiovantage/command_client/commands.py", line 184, in raw_request
    raise self._parse_command_error(response_line)
aiovantage.errors.LoginRequiredError: "Requires Login"

Diagnostics dump

vantage.zip