Discovering entities belonging to a device

I’m building a blueprint so that I can easily set up automations to control the TRVs in my home.

Each TRV is a device in home assistant, I am interested in these entities:

  • climate.FOO
  • number.FOO_valve_closing_degree
  • number.FOO_valve_opening_degree

I can pass these to the blueprint as separate inputs for each entity, but I want to be able to give it a list of multiple TRVs to work on, and passing in 3 entities for each TRV is going to get messy.

Is there any way that I can just give the blueprint a list of devices and have it work out the entities for each device itself?

Yes you can have a device selector to select devices.

Using templates and device_entities() you can get all the entities associated with each device.

1 Like

Thanks for this. I’ve actually hit a stumbling block that it doesn’t appear to be possible to trigger an automation on a change to a climate device’s set temperature. I could trigger on the climate entity itself, but I don’t think that it would be possible to use device_entities() to find that entity in the triggers: section of the automation?

Use a template trigger and get the entity name with a trigger_variable statement. Trigger_Variables - variables that are available when attaching a trigger & Automation Trigger - Home Assistant

1 Like