Manage Primary Integration for Devices

When I look at a Device that is “present” in multiple integrations, depending which integration starts first seems to “claim” the device in the Device list, which show which integrations identify that device. If it is possible to determine the Primary Integration for a given Device it would make visually scanning the list easier as the expected integration icon would be accurate. For example with Unifi identifying devices such as Sonos speakers, I don’t expect to see the Unifi Icon next to my PlayBar Device in the list.

The unifi integration supplies trackers. Not media players. Hence the unifi icon.

Your Sonos integration that supplies a media player should have the appropriate icon.

You can change the icon to whatever you want though.

Hi, Thanks for your response.

In the below attached in the integration column for the specific device, today the sonos integration is taking precedence, but there are other times (with nothing else changing in the network) the icon is unifi, and unifi is listed 1st in the integration column (therefore changing the associated device Icon to be the “U” from unifi integration.

While the Unifi integration is trackers for my network devices, Home Assistant seems to associate that device to Unifi prior to Sonos on occasion.

I am not sure if this is even getting to the media player entity level, but I am novice at best, so just speaking from what I have observed thus-far.

Type beam in the search field at the top of the devices list. What does it show?

I just installed the unifi integration and came across the same problem.
image
Most of my devices now show the unifi icon instead of the icon of their primary integration. The screenshot above shows only Shelly devices.
A manual way to set the order in a configuration would also be fine for me.

There are other integration besides unifi which have this problem. PowerCalc comes to mind.

1 Like

It looks like something can be done through the ‘device registry’, but I’m new to home assistant so I’m not ready to look at development of integration
https://developers.home-assistant.io/docs/device_registry_index/#categorizing-to-device-info

Same exact thing is occurring with me, specifically the Battery Notes integration icon randomly replacing my zigbee device icons. I noticed it usually changed around during HA restarts. I’m surprised this was the only thread/post I could find for this issue.

2 Likes

This is an issue of distinguishing what is the “primary” device within config entries.
Where a “supplementary” device is added you then have two config entries on the device, but there’s nothing in the device registry or config registry to indicate which platform domain the icon should come from.

Since there are few integrations that are supplementary I’d propose on those integrations a config value of “supplementary: true” is added to say not to use that icon and look at other domains within the same device.

HA must be currently cross referencing between the device registry and config entries to determine the domains, but it just gets a list with no way of working out what would be the best icon to use.

Extract from Device Registry

      {
        "area_id": null,
        "config_entries": [
          "b4e8a5d436613c370b502105c3c43cac", (supplementary device)
          "1094801961253fad52269e22fe7b7095" (the real device)
        ],
        "configuration_url": "http://xxx",
        "connections": [
          [
            "mac",
            "xxx"
          ]
        ],
        "disabled_by": null,
        "entry_type": null,
        "hw_version": null,
        "id": "751f57a5be98b7ff77198f014d7a384c",
        "identifiers": [],
        "manufacturer": "Espressif",
        "model": "m5stack-atom",
        "name_by_user": null,
        "name": "Esphm5Matrix01",
      }

Extract from Config Entries

      {
        "entry_id": "b4e8a5d436613c370b502105c3c43cac",
        "version": 2,
        "domain": "battery_notes",
        "title": "Esphm5Matrix01",
        "data": {
          "device_id": "751f57a5be98b7ff77198f014d7a384c",
          "battery_quantity": 1,
          "battery_type": "Rechargeable",
          "battery_low_threshold": 50
        },
        "options": {},
        "pref_disable_new_entities": false,
        "pref_disable_polling": false,
        "source": "user",
        "unique_id": "bn_751f57a5be98b7ff77198f014d7a384c",
        "disabled_by": null
>>>     "supplementary_device": true
      }
1 Like

+1 would like the primary to be LIFX and the supplementary to be NETGEAR in my example

+1

Any updates or workarounds for this?

I have the same problem with the FRITZ Box integration for my router. It seems to “claim” everything with a matching hostname.

1 Like

+1
As you can see only shelly devices, but most of them are unifi.
Other Integrations show similar behaviour.

The media player entity mentioned before of course is not from unifi, but we are more precisely speaking of DEVICES not ENTITIES.
DEVICES shouldn’t be using any DEVICE TRACKER Integrations for primary Integrations, those type of Integrations should always be supplementary, OR it should be a fixed manual setting per device.

Thanks in advance!

1 Like

Same issue with Battery Notes, random integrations order/icons;
did you find a solution or workaround?

Same… Making me nuts… messes with the integration filtering.

The next problem in this context arises on the dashboard. In my case, two cameras are primarily assigned to different integrations. The first camera has Reolink as its primary integration, the second has AVM Fritzbox as its primary integration. Both are integrated in the dashboard via a Picture glance card. The tap action is the default and therefore comes from the primary integration. If I tap on camera 1, the picture is enlarged = OK However, if I tap on camera 2, the presence from the Fritzbox is displayed = not interesting.
A setting on the device which is the primary integration would therefore be useful.