Trigger Area name

Hi,

i have the following question:
Is it possible to get the area from the device which triggered an automation?

I have the following:

service: notify.mobile_app_imopp
data_template:
  title: "{{ trigger.to_state.name }}"
  message: test

Problem: All my entities have the name generic friendly name and the entity_id is way to long. Because every sensor related to a room(or arena in home assistant) i would like to have a notitication like: “Sensor from room {{trigger.to_state.area}} alerted” … From the documentation i found, this seems to to be possible. Any other idea? (And no, i dont want to rename all the entities, because this causes longer names in Apple HomeKit etc etc…)

  title: "{{ area_name(trigger.entity_id) }}"

Third last example here https://www.home-assistant.io/docs/configuration/templating/#areas-examples

2 Likes

Was looking on the wrong pages, never had the idea that there might be a function to get the arena of a antitiy ID… big thanks <3

1 Like