How to get an "integration" name for an entity?

There is a way to get a list of entities generated by some integration:

{{ integration_entities("asuswrt") }}  

But how to get an integration’s name for some entity?

Some info is kept in “core.entity_registry” file:

        "area_id": "kukhnia",
        "capabilities": {},
        "config_entry_id": "54c316c42dcdafa9cc77e015ce1df43f",
        "device_class": null,
        "device_id": null,
        "disabled_by": null,
        "entity_category": "diagnostic",
        "entity_id": "device_tracker.rpi_1",
        "hidden_by": null,
        "icon": null,
        "id": "ce92a5f147d0020d8e2bf9fe6df9d1b8",
        "has_entity_name": false,
        "name": null,
        "options": {},
        "original_device_class": null,
        "original_icon": "mdi:lan-connect",
        "original_name": "RPi_1",
        "platform": "asuswrt",
        "supported_features": 0,
        "unique_id": "b8:27:eb:01:06:2f",
        "unit_of_measurement": null
      },

Seems that I am interested in a “platform” value.

You will find some answers here…

Thank you for a reply.
Unfortunately, this is not a solution.
It was proposed to specify a custom attribute like “integration”.
But what I need is to know what some NEW entity is generated by.

Assume there is a new “device_tracker” registered - since I got several platforms it would be great to know which one is a cause; these new entities may be listed on some “auto-entities” card along with displaying their platforms.

Btw, that post is 2 years old, may be we got some fresh ways,

So if you want to know which integration an entity is part of… Go to parameters → Device and services (Appareils et services in my version), select on the top ENTITIES, type your entity on the top left to search for it and you will find which integration this entity is part of …

Yes, this is clear))
I meant - how to get an integration name in templates.

The answer was still the same in May 2021 (see below) and as far as I know there is no attributes of an entity giving the integration… but wait and see some other answers, who knows…

This post is old, but there is no other more recent about this topic, so I ask here.
How can I get the real integration name of an entity?
As usual, what is shown in the UI is not the same what HA uses internally. I want the real integration name, so I can filter by it in the auto-entities card

Look here

There are a set of functions now to access the device for an entity.

Which template gives a name of integration for a particular entity?
If you read the 1st post you can see that nothing is changed.
You still have functions like “”give a list of entities belonging to an integration”.
But there is no a function “give an integration of some entity”.

I believe you use this:

device_attr(device_or_entity_id, attr_name)

And the attribute is “integration”

But the core.device_registry file does not contain the “integration” attribute.
And a simple check in Dev tools → Templates shows that “device_attr” cannot be used exactly as you described.

Apologies. This is how you do it.

{{ device_attr("sensor.upstairs_thermostat_temperature","identifiers") }}

That gives you a dict back, with the integration in one of the elements.

2 Likes

I see.
Unfortunately, this seems to be a workaround, not an “official” way.
I wonder, is the 1st dict’s member is ALWAYS a name of integration…

Anyway - thank you for the hint!

The suggested template has limitations.

For example, the following temperature sensor is based on the MQTT integration.

The template reports None.

I believe it did that because the temperature sensor isn’t part of any device. Similarly it reports None if the entity’s integration is Template, History Stats, Utility Meter, REST, etc (i.e. anything that isn’t associated with a device … so that’s a lot of ineligible integrations). In contrast, the following climate entity is part of a device and the template reports the correct integration name:

Even when the entity is associated with a device, the reported integration name might be different than expected. For example, a sensor based on the Homekit Device integration (formerly known as Homekit Controller) reports this as the integration’s name:

homekit_controller:accessory-id

So your request for a template filter that reliably reports any entity’s integration is something that would make for a good Feature Request.

Here it is:

1 Like