Error while setting up tradfri platform for light

After upgrade to 2024.3.0 my trådfri integration seems to have failed. I’m using the older trådfri controller, not the new one if that matters.

I have tried to reload the integration and also to restart it. I have the same error with the switches but the battery sensors seems to work for some reason.

Here is the log output:

Logger: homeassistant.components.light
Källa: helpers/entity_platform.py:358
integration: Lampa (dokumentation, ärenden)
Inträffade först: 11:54:21 (1 händelser)
Senast loggade: 11:54:21

Error while setting up tradfri platform for light
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 358, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 609, in async_add_entities
    for entity in new_entities:
  File "/usr/src/homeassistant/homeassistant/components/tradfri/light.py", line 40, in <genexpr>
    TradfriLight(
  File "/usr/src/homeassistant/homeassistant/components/tradfri/light.py", line 64, in __init__
    super().__init__(
  File "/usr/src/homeassistant/homeassistant/components/tradfri/base_class.py", line 64, in __init__
    sw_version=info.firmware_version,
               ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pytradfri/device/__init__.py", line 177, in firmware_version
    return self.raw[ATTR_DEVICE_FIRMWARE_VERSION]
           ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: '3'

Here is my system info:

Core
2024.3.0
Supervisor
2024.02.1
Operating System
12.0
Frontend
20240306.0

Seems this is a known issue fixed in v13 of the api but HA integration seems to use v9.

1 Like

Thank you, that explains why I have had to restart the gateway a few times before aswell, lets just hope we can upgrade the API?