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.
Is there any way to do this or should I open a feature request?
Yup, that just returned the identifier, i.e. main for the floor named Main.
And yes, the docs did seem to indicate that it was for sorting and it appears to sort the floors in the UI. Even getting them back sorted from floors would suffice for my purposes. Unfortunately, they appear to come back in a different order. (It’s perhaps creation order which I could probably hack to make work for my purposes, but that may not be stable long term and I’d prefer not to rely on it.)
I think my main use case for this at the moment is to turn all the lights off on the floors above (or below) the switch that activates an automation.
Where the 1 would actually be a variable. That’s the idea, but without the level attribute, I have to hard code things and probably duplicate values (which will eventually down the line lead me to making a mistake most likely).
That is if you can’t use the Floor_ID, and are concerned whether you might “mixed up” your “areas” , “labels” or “Entities”, or Group of same, or i.e domain.light !
I don’t know where you got the idea that Floors, or Areas for that matter, has attributes ?
Whats the difference between a Floor_ID and a Floor_ID_Level_Attributes , in the end ain’t it just an Unique Identifier for the same “object” ?
Ok, thou i doubt an FR can help you on that part
Ofcause i don’t know how many Floors(or Levels, if you only use it as physical objects) you have, but people use i.e the (UI) level-sort-order in variation ways.
You Accessing a Floor by it’s unique_id ( Floor_ID )
Or you could use a “for - loop” ( for lights in light, select floor_id ) Where ID = Variable(somewhere from)
Or simple name your Floor Level_1, Level_2 etc, Thou Any Name would be the Unique_ID anyways
Or You could also just make a light-group for each floors, if that is your “Major” purpose