Track multiple people / zones - 228 automations reduced to 3!

Thank you so much

some of the above is incorrect as to what each service does.

Hello, I am a bit confused as to what to put in replace of notify.alexa_media_living_room_echo_dot
I dont have any aleax devies in my house only google speakers but I dont understant what serive the notify.alexa is and if it is combatible with google

Another noob here would like to use this blueprint, can someone please let us know the correct syntax to use for google tts.
Specifically, I am asking about:

I have tried a bunch of different variations when creating the automation from this blueprint, but I’m just guessing and they are not working.

1 Like

I had the same Issue not to sure what to put.

Figured it out, the problem for me was in the action part.

have adjusted and will repost the blueprint that now works for me and google tts example

blueprint:
  name: 1 Person Multi-Zone Change - Audio Notification
  description: Send a notification to a device when a person enters a different zone.
  domain: automation
  input:
    # Person/Device that will be tracked
    person_entity:
      name: Person
      description: Person/Device that will be tracked.
      selector:
        entity:
          domain: person
    # Service to call for device that will be notified - have to type manually as can't select from a dropdown yet
    notify_device_1_1:
      name: Media Player Notification Service
      description: "Notifier service for Media Player to receive audio/tts notifications.  Example: tts.cloud_say"
    # Media device that will be notified
    notify_device_1_2:
      name: Media Player to notify
      description: Media Player to receive audio/tts notifications.
      selector:
        entity:
          domain: media_player

trigger:
  platform: state
  entity_id: !input person_entity

variables:
  # This is the state of the person when it's in this zone
  person_entity: !input person_entity
  person_name: "{{ states[person_entity].name }}"

condition:
  # Check that the old and new states(zones) are different
  condition: template
  value_template: "{{ trigger.from_state.state != trigger.to_state.state }}"

action:
  # Send the message to the media device with the chosen settings using tts
  - service: !input notify_device_1_1
    data:
        entity_id: !input notify_device_1_2
        message: "{{ person_name }} has entered {{ states.zone[trigger.to_state.state].name }}"

One ‘problem’ I am having is the automation doesn’t like zones that are two words.

Hi, sorry for noob question but if i good understand, this code i put to this file?

/config/blueprints/automation/homeassistant/notify_leaving_zone.yaml

or i create new file?
thx

1 Like

Were is the Blueprint url to be imported on HA?

Just found it.
Just past this url on your import blueprint field Track multiple people / zones - 228 automations reduced to 3! - #2 by Dean_James

Moved from {{ states.zone[trigger.from_state.state].name }}  to {{ states.zone[trigger.to_state.state].name }}

Does not work for me when the state is equal to not_home. All zones look nice, home is displayed as Home, but instead of not_home I get just nothing. So my notifications then look like "Moved from Home to " and “Moved from to Work”.

Moved from {{ trigger.from_state.state }} to {{ trigger.to_state.state }}

Works, but it is ugly - “Moved from home to not_home” and “Moved from not_home to Work”. Is there any simple way to make it nicer?

@hubikj - I’ve got a sensor which deals with this exact thing, it also works with zones to show the zone name nicely:

platform: template
sensors:
  xxx_location:
    friendly_name: xxx
    entity_picture_template: "{{ state_attr('person.xxx', 'entity_picture') }}"
    value_template:  >
      {% if is_state('device_tracker.iphone', 'home') %}
        Home
      {% elif is_state('device_tracker.iphone', 'not_home') %}
        {% if state_attr('sensor.iphone_geocoded_location', 'Sub Locality') != 'N/A' %}
          {{ state_attr('sensor.iphone_geocoded_location', 'Thoroughfare') }}, {{ state_attr('sensor.iphone_geocoded_location', 'Sub Locality') }}
        {% else %}
          {{ state_attr('sensor.iphone_geocoded_location', 'Thoroughfare') }}, {{ state_attr('sensor.iphone_geocoded_location', 'Locality') }}
        {% endif %}
      {% else %}
        {{ states('device_tracker.iphone') }}
      {% endif %}

is this abandoned? Im having an issue for the past few months of the condition failing.

Executed: March 29, 2022, 2:53:26 AM
Result:
result: false
entities: []

the condition:

condition: template
value_template: '{{ trigger.from_state.state != trigger.to_state.state }}'

any ideas whats going on here?

edit: looks like its related to this Notify Entering Zone - #13 by DigitalFeonix

my zone.home is Home and the person.xx is home.

need to regx that template or soemthing, make it all the same case for Home. i just dont know how.