Suggestion for adding location data to entity attributes to help with future apps and scripting. Imagine apps or scripts that can organize entities by their location. You can turn all the lights off in a room or level instead of one by one. Have music or announcements play near the closet motion detected. Have maps that show you were activity is happening or what entities are still on.
Step 1
First easy, I’d like to see entities that are assigned areas have that area appear in their attributes similar to how icon: appears. This is an easy fix and would help with custom apps and programs like appdaemon that could control and gather data based on entity attribute area. Such as automatically assigning an entity to a room.
Step 2
Give all entities points. This would be like entity attribute friendly_name: or icon:. The default is (0,0). You can choose to define a base plane for your local home assistant like ((0,0),(50,50)) or just use GPS coordinates. Each light or sensor could have a point, example (17,32) or (7, 5). You can control entities with scripts like “everything between x=11 and x=21 and between y=26 and y=35” or all((11,26),(21,35)).
Step 3
Give all entities geometric data types similar to postgres’ Geometric Types. This would pave the way for easily implementing complex automations based on an entity’s location. You could define a square for an area and Homeassistant could assign any entity with a location inside that square to that area. You could have automations that “turn_on.” that could turn on all entities in that area. More complex would be “turn_off..light” that could turn off all domain.light in an area. Drawing and controlling entities on a map would become much easier and Homeassistant having a core “floorplan” would be a great direction to head to.
I’m aware you can do this in a customized yaml and I do, but being able to easily input things in the front end for my 300+ entities would really help. I am also aware we could always make this more complex. What about a Z plan or polygon shapes or a 360-direction plan for motion detectors or cameras?
In conclusion, your home and entities exist in 3 dimensional space, shouldn’t you be able see and control that?