danielperna84 / hahomematic

Python 3 Interface for Home Assistant to interact with HomeMatic devices
MIT License
131 stars 21 forks source link

1.65.0b5 issues during config flow #1658

Closed ChristophCaina closed 2 months ago

ChristophCaina commented 2 months ago

I agree to the following

The problem

After installing the 1.65.0b5 the integration can't load anymore.

I do have the option to reconfigure the integration, but this will resolve in an internal server error 500 grafik

The log is showing the following error:

Logger: homeassistant.config_entries
Quelle: config_entries.py:943
Erstmals aufgetreten: 11:45:02 (1 Vorkommnisse)
Zuletzt protokolliert: 11:45:02

Error migrating entry RaspberryMatic for homematicip_local
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 943, in async_migrate
    result = await component.async_migrate_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/homematicip_local/__init__.py", line 189, in async_migrate_entry
    del data[CONF_SYSVAR_SCAN_ENABLED]
        ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'sysvar_scan_enabled'

I am not aware that there were issues with 1.65.0b4 - but a roll back to 1.65.0b4 caused the same error. For now, I installed 1.65.0b0 and this seems to work as expected atm.

What version of HomematicIP (local) has the issue?

1.65.0b5

What was the last working version of HomematicIP (local)?

1.65.0b0

What type of installation are you running?

Home Assistant OS

What type of installation are you running for your homematic backend?

RaspberryMatic Standalone

Which version of your homematic backend are you running?

No response

What hardware are you running for your system?

No response

Which config details do you use

Which interfaces do you use?

Diagnostics information (no logs here)

No response

Log file extract. Anything in the logs that might be useful for us? The log (Setting/System/Logs -> load full log) is the best source to support trouble shooting!

No response

Additional information

No response

SukramJ commented 2 months ago

Please add the diagnostic information

Baxxy13 commented 2 months ago

Also bei mir auf dem Test-HA läuft die 1.65.0b5 problemlos. Da ich mir gerade die frischen "unignore-Parameter" angucke habe ich schon mehrfach den Config-Flow durlaufen.

Baxxy13 commented 2 months ago

Kurioserweise ist nun plötzlich auch bei mir was faul:

Logger: homeassistant.config_entries
Quelle: config_entries.py:604
Erstmals aufgetreten: 17:43:46 (2 Vorkommnisse)
Zuletzt protokolliert: 17:43:46

Error setting up entry RaspberryMatic_96 for homematicip_local
Error setting up entry RM-Test-Pi3Bplus-27 for homematicip_local
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/homematicip_local/__init__.py", line 68, in async_setup_entry
    control = ControlConfig(
              ^^^^^^^^^^^^^^
  File "/config/custom_components/homematicip_local/control_unit.py", line 572, in __init__
    self.sysvar_scan_enabled: Final = data[CONF_ADVANCED_CONFIG].get(
                                      ~~~~^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'advanced_config'

Wo findet man denn die geforderte "diagnostic information"?

Edit: gefunden, aber nicht verfügbar wenn die Integration nicht geladen wird.

SukramJ commented 2 months ago

Mich interessiert der config_entry. Alternativ findet man den auch unter /config/.storage/core.config_entries Da die entsprechende Instanz heraussuchen und hier anhängen. Bei @ChristophCaina denke ich, daß das wan mit den Beta Versionen zu tun hat. Da hatte ich ggf. zwischendurch ein Problem mit der Migration.

SukramJ commented 2 months ago

1.65.0b6 sollte @Baxxy13 's Problem lösen

Baxxy13 commented 2 months ago

Ja, mit 1.65.0b6 läuft's wieder. Danke und Sorry für's reingrätschen.

ChristophCaina commented 2 months ago

Hi, Sorry für die verspätete Rückmeldung...

Ich habe jetzt die 0b6 geladen - auch hier bekomme ich den Migrationsfehler.

Ich bekomme zudem einen fehler vom AIOHTTP in welchem homematicip_local auftaucht

Logger: aiohttp.server
Quelle: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:427
Erstmals aufgetreten: 09:11:26 (1 Vorkommnisse)
Zuletzt protokolliert: 09:11:26

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 456, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 537, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 210, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 262, in post
    return await super().post(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
    return await method(view, request, data, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 77, in post
    return await self._post_impl(request, data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 84, in _post_impl
    result = await self._flow_mgr.async_init(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 331, in async_init
    flow = await self.async_create_flow(handler, context=context, data=data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2657, in async_create_flow
    return handler.async_get_options_flow(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/homematicip_local/config_flow.py", line 334, in async_get_options_flow
    return HomematicIPLocalOptionsFlowHandler(config_entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/homematicip_local/config_flow.py", line 343, in __init__
    self._control_unit: ControlUnit = entry.runtime_data
                                      ^^^^^^^^^^^^^^^^^^
AttributeError: 'ConfigEntry' object has no attribute 'runtime_data'

Die Debug Protokollierung zeigt im Log zudem noch folgendes:

2024-08-25 09:11:21.094 DEBUG (MainThread) [custom_components.homematicip_local.config_flow] Homematic(IP) Local SSDP discovery SsdpServiceInfo(ssdp_usn='uuid:upnp-BasicDevice-1_0-3014F711A000041F2995E611::upnp:rootdevice',
                ssdp_st='upnp:rootdevice',
                upnp={'UDN': 'uuid:upnp-BasicDevice-1_0-3014F711A000041F2995E611',
                      'UPC': '123456789002',
                      'deviceType': 'urn:schemas-upnp-org:device:Basic:1',
                      'friendlyName': 'HomeMatic Central RaspberryMatic',
                      'manufacturer': 'EQ3',
                      'manufacturerURL': 'http://www.homematic.com',
                      'modelDescription': 'HomeMatic Central '
                                          '3014F711A000041F2995E611',
                      'modelName': 'HomeMatic Central',
                      'presentationURL': None,
                      'serviceList': {'service': {'SCPDURL': None,
                                                  'controlURL': None,
                                                  'eventSubURL': None,
                                                  'serviceId': 'urn:upnp-org:serviceId:dummy1',
                                                  'serviceType': 'urn:schemas-upnp-org:service:dummy:1'}}},
                ssdp_location='http://192.168.52.57/upnp/basic_dev.cgi',
                ssdp_nt=None,
                ssdp_udn='uuid:upnp-BasicDevice-1_0-3014F711A000041F2995E611',
                ssdp_ext='',
                ssdp_server='HomeMatic',
                ssdp_headers={'CACHE-CONTROL': 'max-age=5000', 'EXT': '', 'LOCATION': 'http://192.168.52.57/upnp/basic_dev.cgi', 'SERVER': 'HomeMatic', 'ST': 'upnp:rootdevice', 'USN': 'uuid:upnp-BasicDevice-1_0-3014F711A000041F2995E611::upnp:rootdevice', '_host': '192.1**.**.**', '_udn': 'uuid:upnp-BasicDevice-1_0-3014F711A000041F2995E611', '_location_original': 'http://192.1**.**.**/upnp/basic_dev.cgi', 'location': 'http://192.1**.**.**/upnp/basic_dev.cgi', '_timestamp': datetime.datetime(2024, 8, 25, 9, 10, 18, 196808), '_remote_addr': ('192.1**.**.**', 1900), '_port': 1900, '_local_addr': ('0.0.0.0', 0), '_source': <SsdpSource.SEARCH: 'search'>},
                ssdp_all_locations={'http://192.1**.**.**/upnp/basic_dev.cgi'},
                x_homeassistant_matching_domains={'homematicip_local'})

Anbei noch das Diagnose-File - habe jetzt die 0b1 geladen, mit der funktioniert es wieder... Muss mich also nach und nach ggf. heran tasten, um zu schauen, mit welcher Beta genau das anfing... :-/

config_entry-homematicip_local-236b39f0e3f07857ae95742385e22965.json

SukramJ commented 2 months ago

Versuch mal die 1.65.0b7

ChristophCaina commented 2 months ago

sieht gut aus :)

SukramJ commented 2 months ago

Das schliess ich das issue mal