What the heck it is not possible to use area in automations

It’s not possible to check in automations what area the entity comes from. For example, we have a Motion sensor XYZ device, which is assigned to the Kitchen area and it has an entity binary_sensor.motion_xyz. It would be nice to have a template that would return the area where the entity comes from. For example:

{{ area('binary_sensor.motion_xyz') }} -> 'Kitchen'

Usage example:

- id: abc
  alias: "ABC"
  trigger:
    platform: state
    entity_id:
      - binary_sensor.motion_xyz
      - binary_sensor.motion_foo
    state: "on"
  action:
    service: notify.notify
    data_template:
      message: "Motion detected in {{ area('trigger.entity_id') }}!"

Oh that would be nice actually. Or if area available as a field in the entity state object like last_changed and last_updated.

1 Like

Area as object of entity state is even better idea than mine.

I brought this up on GitHub a while ago BTW.

Any update on this?

Great idea