Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95925

How to get friendly name of location of person when it changes

$
0
0

@rednas wrote:

Currently I have this automation:

- alias: 'Device State Change Alert'
  trigger:
    platform: state
    entity_id: person.P1, person.P2
  condition:
    condition: template
    value_template: '{{ trigger.to_state.state != trigger.from_state.state }}'
  action:
    - service: notify.notify
      data_template:
        message: >
          {{ trigger.to_state.attributes.friendly_name }} is at {{ trigger.to_state.state }}.
        title: ""

How can I change trigger.to_state.state to a value where it returns the friendly name? Currently it returns the correct name for custom zones, however for the home zone it returns “home” and when not at home it return “not_home”. I would like to have the friendly names returned instead of “home” and “not_home”.
How can I change this?
It’s not trigger.to_state.attributes.friendly_name as this returns the name of the person, which is quite strange I would say.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>