How to go from Device to Entity

I feel a little dumb. I understand that devices can have multiple entities. If I go to settings > devices and select one, I can any activity has been logged. Those logs in the device pane list the entities.

But how ç%&ç&%ç do I find all the entities that belongs to a device?

Background.
Velux covers re-imported though homekit integration have reused entities so cover.steves_office and button.landing_blind_3_identify are associated with Steve’s Office blind. Easy to rename the entities, but would love to see a list of a devices entites.

That’s an HA integration? If so go to the integration page, click on velux. The next page will have the devices and entities associated with that integration.

I don’t think the Velux integration can be configured in the UI (not if it’s this one, anyway) so that card is not available.

If you go to Settings | Devices & Services and click on the Entities tab, you’ll get a list of all your entities. If you then type Velux in the search field you should get a list of all the entities in the Velux integration.

In this example I have searched for entities in the Wireless Tag integration - you can see that they all come up, even though some of them have names without “wireless” in them.

I don’t think you can list the entities belonging to a particular device, though - you have to deal with that by naming them appropriately.

device_entities(device_id) returns a list of entities that are associated with a given device ID. Can also be used as a filter.

Interesting, but where is the device_id exposed?

{{ device_entities("Bedroom Blind") }}

returns

[]

so I guess I need to find an internal ID for each device.

Goto device page, in Automation div click plus button, choose “Do something when this device turns on or off” (or something like this). This will follow you to creating automation page with trigger on your device. Click three dots, choose “Edit in YAML” - you will see device_id and entity_id of this device.

Execellent!

It’s a bit hacky - perhaps a feature request is needed.

I started to create an automation for the Bedroom Blind, got the device id and used the template:

{{ device_entities("dfbe04482c0d775336964673db6857ca") }}

returns

['button.jacquies_office_blind_identify', 'cover.bedroom_blind']

I verified if I press jacquies_office_blind_identify the bedroom blind jogs.

A little while back the Velux gateway crashed and needed to be reset and re-added to HA - looks like the HomeKit integration is somehow reusing entity ids…

Thanks for the help, I can now rename the entities.