Add a template function to access a floor's level

As noted in this discussion:

With the 2024.04 release, we got floors as an added feature. The floor has a level attribute, but it doesn’t seem like there’s a way to access that in templates.

Before this, I had some configuration defining floors and their level/area_ids, so this new feature is close to replacing all of that. The only thing I need access to is the level in templates.

Can we add access to the level of a floor in templates?

Don’t forget to vote for your own request…

1 Like

This was in from day 1. Not a Feature request. Jump link to the Docs.
Templating - Home Assistant.

Please demonstrate how to access the level of a floor. I don’t think it’s readable.

I have a floor called upstairs that I created with level 1. I can see the floor, get its name, read the entities associated with it, but I cannot see how to read the level that I associated with it when I created it.

image

Should be reverted to Feature Request if you cannot demonstrate this. EDIT: have now changed it back.

The code shows the level being managed in the registry:

1 Like

I don’t believe the level of a floor is accessible either. I’m far from an expert, but tried diligently.

2 Likes