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') }}!"