Add Area to entities attributes

Hoping to use the Area in backend logic, I re-discovered the fact we hardly can use the Area in HA.

usecase:
an alarm system which can use and activate Areas depending on family presence. Not switching of the triggering devices, but simply only activate the Alarm when triggered by devices in an activated Area.

As a second best option to that, an additional attribute Area to entities would be fine too:

battery_level: 60
sensitivity: 2
sensitivity_max: 2
friendly_name: Attic sensor motion
device_class: motion
icon: 'mdi:home-floor-a'
area: attic

we could then use templates to ensure the Alarm would only fire on those motion_sensors/cameras/etc would in the activated Areas.

setting an Area to a device would automatically set the attribute, no need for further user interaction

Thanks for considering

I guess you know this already, but you could add your own attributes to entities with customization.

1 Like

must confess I didn’t think of that. I’ll give that a try, but fear it is not as robust as a core attribute. Needing initialization upon loading and after restart…
thanks for a great thought

Have you solved this? I still find it a mystery how to access the area of a given entity.

no unfortunately not possible

Have you found a good way to automate this?
(So if a device changes area, the attribute would follow)

Sorry, no.

However, by accident recently told Google to turn on a switch. Since this switch is in a identically named area … google turned on everything in that area.

This is of course a mistake , and reason enough to rename some areas/entities, but it shows the possible power of an area…

Maybe you can play with that?

Thanks. I just might :slight_smile:

Though adding area as an attribute would be interesting. Would open up opportunities, but I guess there is a reason why it’s not there.

with 2021.9 we will see this: 2021.9.0: Beta release notes - Home Assistant

which is very nice indeed. Though, still not what I would have hoped for… unless I am misunderstanding it.
we can do {{area_name(trigger.entity_id)}} but still not a plain state_attr('binary_sensor.front_room_sensor_motion','area_name')}} for that matter. Hope this will become available too

1 Like

I really want the “Area attribute” as well. I name some of my entities the same but place them in different areas (for example smoke detectors). When they are parsed to InfluxDB i can’t filter on area which is a shame. Shouldn’t be that much work I would think…

The other critical use case here is to support a device that serves multiple areas where the device’s entities should be assignable via UI or config to an area.

There seems to be a similar recent request but for InfluxDB (Oct 2023): InfluxDB integration: Add Area (area_name) to the tag for exported data - Feature Requests - Home Assistant Community (home-assistant.io)