Setting Up Personalized Greetings in Home Assistant - Need Advice

Hello everyone,

I’m hoping to get some guidance on an exciting project I’m working on. I’d like to set up my Home Assistant to deliver a personalized greeting when either myself or my partner return home. The idea is for the Assistant to say “Welcome Home Andreas” or “Welcome Home Laura”, depending on who is entering the house.

Has anyone here implemented personalized greetings like this? I’m not sure how to do that.

Thanks in advance for your help and suggestions!

Best
Andy

What do you currently have?
What would be “entering the house” in HA terms?
The greeting would be using the TTS notification, I guess

trigger:
  - state:
    entity_id: person.andreas
    to: home
    not_from: 
      - unavailable
      - unknown
  - state:
    entity_id: person.laura
    to: home
    not_from:
      - unavailable
      - unknown
condition: []
action:
  - wait_for_trigger:
      - platform: state
        entity_id:
          - binary_sensor.front_door
        to: "on"
    continue_on_timeout: false
    timeout:
      hours: 0
      minutes: 5
      seconds: 0
      milliseconds: 0

  - service: tts.speak
    data:
      cache: true
      media_player_entity_id: media_player.andylaptop_honor
      message: >-
        Welcome Home {{ (trigger.to_state.name).split(" ")[0] }}

Something like that.
That waits for the state of your person entity to change to home, and then gives you 5 minutes to open the front door. It takes the name of the person that triggered the automation by returning home, and splits it with a " " so that if people are saved with a full name, it will only speak the first name.

Thank you both so much! I’m currently using the Home Assistant app and have installed a Nuki smart lock on my door. With these in place, my plan is to set up the following:

If Nuki is unlocking +. Laura was not at home for over >2 hours, then the Sonos should play an mp3.

Is this the correct code for that?

alias: Laura Greeting
description: ""
trigger:
  - platform: device
    device_id: 20d38f45d51fc9353fc7c1bf76664543
    domain: lock
    entity_id: f6425b094afe5b4c498357787bb643df
    type: unlocking
    for:
      hours: 0
      minutes: 0
      seconds: 20
condition:
  - platform: device
    device_id: 2e84eae3f678ff2dc8dcaa631e00454d
    domain: device_tracker
    entity_id: 655341cb8e67b9dbee707f8d3f22045es
    type: enters
    zone: zone.home
action:
  - service: media_player.play_media
    target:
      entity_id: media_player.kitchen
    data:
      media_content_id: >-
        media-source://media_source/local/036d20a3-ea23-4a40-aeb1-b4ffdb6cba5a.wav
      media_content_type: audio/x-wav
    metadata:
      title: 036d20a3-ea23-4a40-aeb1-b4ffdb6cba5a.wav
      thumbnail: null
      media_class: music
      children_media_class: null
      navigateIds:
        - {}
        - media_content_type: app
          media_content_id: media-source://media_source
mode: single

Thank you so much in advance!!