WTH can't I interract with all entities in an area

I understand area is currently only a characteristic of devices. But devices have entities.

Why can’t I have an automation that says when movement in area.bedroom, turn on all lights in area.bedroom?

I struggle to find in the data model how to detect what entities belong (through inheritance) to an area.

I am also unaware of being able to call services for an area (inferring all entities belonging to devices in the area would be in the criteria)

Happy to be enlightened if I have missed a concept!

I agree. To extend it even more I think Home Assistant should be able to identify what entities are in the Area so we can call services like. Turn off all lights in the Area, play/stop music in an Area or whats the temperature in an Area. So far I have had no use at all for Areas and I have a hard time understanding what they are good for.
Sure we still have groups but I thought that Areas would grow to be “smart”-groups.

This is possible, if undocumented.

You can call:

- service: switch.turn_off
  area_id: 7b583d45d74b43e664d63d7e2711fe77

for instance, and this will turn off all switches that belong to a device in that area.

You have to find the ID from the Area panel, and then the cog in the top right.

3 Likes

Hey look at that! Thanks for bringing this to my intention. Lets try to get that in the documentation. To be honest the documentation does not cover areas at all right now.

Cool

But can I use area as a criteria in a trigger for an automation?

Ideally - if movement in an area, turn on all lights in the area.

And can I determine what area an entity belongs to?

I don’t think so, but there’s been no documentation at all and what little I know was found by lots of searching and poking around.

Ah so if it’s possible, I’d say we should add this as a type to the automation/script action UI then, unless there are unintended consequences of this?

There shouldn’t be, but it’s remained undocumented since introduced and has had some bugs in the past (like when turning off switches in an area would turn off every switch).

Unfortunately it seems to be a feature that was introduced and semi-abandoned, which is why I up-voted this suggestion.

1 Like

It isn’t abandoned, but never really designed from a YAML perspective.

We need something to get rid of those horrible UUIDs that are used for area’s

1 Like

I have also struggled to find the data structure

Is there a domain (might be wrong term) for areas (like states?) eg areas.device_platform.device_name.area - so we can derive areas inside jinga2/scripts/automations?

Or can we have area as an attribute of an entity? (although you then run the risk of it being removed by other attribute/state updates for the entity I guess)

1 Like

Related request here.

Currently I have automations to send notifications when my leak sensors (around ten) detect something, and being able to access the area in a template would allow me to group them and great simplify things.