Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IKEA TRADFRI integration appears unable to handle multiple gateways #134497

Open
cs12ag opened this issue Jan 2, 2025 · 1 comment · May be fixed by #136060
Open

IKEA TRADFRI integration appears unable to handle multiple gateways #134497

cs12ag opened this issue Jan 2, 2025 · 1 comment · May be fixed by #136060

Comments

@cs12ag
Copy link

cs12ag commented Jan 2, 2025

The problem

Re-logging #112114

I have two Tradfri gateways, with multiple devices connected to each gateway. I am able to set up both gateways successfully in HomeAssistant, but it would appear that HomeAssistant is erroneously combining the list of devices from both gateways under certain conditions. This leads to an incomplete list of devices across both gateways and confusion in the display of friendly names. Please see the screenshot of the device list:
309551330-efff24e9-5f2a-409d-b44a-83f9a3667efe

I believe I have identified and solved this issue. It looks like the software on the Tradfri gateway is issuing unique identifiers to the devices associated to it from its own numeric sequence. However, it also looks like the firmware on each gateway that issues the unique identifiers starts from roughly the same starting-point in the numeric sequence (which is probably expected; the gateways are the same hardware and running the same version of the firmware).

As an example, gateway 1 has light A associated to it and has issued light A the unique ID of 65538. Gateway 2 has light B associated to it and has also issued light B the unique ID of 65538.

Because of the way the device identifiers are generated in /homeassistant/components/tradfri/entity.py, multiple devices from different Tradfri gateways could end up with the exact same set of derived identifiers when adding devices to core.device_registry, causing unexpected updates of existing devices instead of adding new devices as expected. This leads to devices being related to multiple config entries and essentially changing display within Home Assistant UI depending on which of the multiple instances of the Tradfri integration was loaded last.

This is not an issue if there is only one Tradfri gateway being used in the IKEA TRADFRI integration in a Home Assistant.

What version of Home Assistant Core has the issue?

2024.12.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

IKEA TRADFRI

Link to integration documentation on our website

https://github.com/home-assistant/core/tree/dev/homeassistant/components/tradfri

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Jan 2, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants