Area related sensors in templates

When editing an area you can set related temperature and humidity sensors. Is there a way to retrieve those from a template?

I looked at the templating documentation, but didn’t find any functions that would allow one to read those configured sensors.

I’m thinking something like the following:

{{ states(area_temperature(‘area_id’)) }}

Any advice or pointers greatly appreciated!

The template function that is available is area_entities(area_name_or_id) this will return all the entities in the area.

You would then have to |select only temperature or humidity sensors from those returned by the function. Or |reject the unwanted entities.

Thank your for your response. I was interested in the two sensors that are configurable in the area edit menu specifically.

Here’s a screenshot of that UI for reference:

It seems like those sensors are used to render temperature and humidity in the area card:

I’d like to use them in a template. I think I’ll take a look at the area card code itself. That might be useful.

Did you find a way to do this? The area card is obviously able to get a reference, so surely there’s a way for other things to reference them?

I have not, but I have also not dug into it any more since. I’ve been busy with other stuff at the moment.

I would still take a look at the actual implementation of the area card, but my gut tells me that the actual card implementations don’t use the same template mechanism and get their data from somewhere else.

So while the data obviously is available somewhere, the fact that it is rendered in the area card, doesn’t necessarily mean that it’s available in templates.

I also saw another topic which reduced my optimism. It mentioned that the area card simply gets all sensors within the area (which are temperature related) and takes the average of them.

I’m actually not sure what the “related sensors” stuff is even for!