Welcome home master when i enter my house after being gone

Is there a way to make a greeting that plays ONLY when my phone has been gone and has recently come back into my home zone?

For example. When my front door opens (which i have a sensor on) i want to welcome myself home by name on a speaker. I know how to fire the greeting, i just want to know how to fire it only once after my phone has entered back into my home zone. If that makes sense? I’m guessing this will have to do with the conditions section in automations… Just didn’t know what to put.

When your phone state changes from not_home to home, you want to enable a greeting automation that will be triggered by the door sensor. Then once the door is opened or a timeout of 15 minutes later, disable the automation.

What have you tried so far? (post the properly formatted code…)

What part isn’t working?

trigger when you phone entre the zone
wait for the trigger of the door

mine is Something like that:

alias: retour from absence
description: ''
  - platform: state
    entity_id: group.master_presence
    to: home
    from: not_home
condition: []
  - wait_for_trigger:
      - type: opened
        platform: device
        device_id: c705c8229eda0ab7baa2e25fac66e858
        entity_id: binary_sensor.porte_fermer_ias_zone
        domain: binary_sensor
  - scene: scene.before_absence
  - scene: scene.lumos_cuisine
  - service: script.turn_on
      entity_id: script.retour_speech
mode: single


alias: retour speech
  - service: media_player.volume_set
      volume_level: 0.42
      entity_id: media_player.stereo_cuisine
  - service: tts.google_cloud_say
      entity_id: media_player.stereo_cuisine
      message: '{{states(''input_text.welcome_home'') }}'
mode: single

the input text randomly change every hour and it’s a separate script so I can and more detail later

sometime it bug because I open the door before my cell connect to the wifi though

great, thanks guys. i was basing this off the geolocation of my phone which has the HA app on it. Wouldn’t this theoretically be a better solution than waiting for it to talk to wifi? by the time i was on wifi i’m guessing the door would already have been entered. also, i notice the state on my location entity is “away” when i’m gone, not the “not-home” that you guys are using. which one should i go with?

1 Like

The “away” is only used in the frontend for display purposes. the actual state of a device tracker is either “home” or “not_home”.

Oh I’m using the wifi because I did not have much data on my phone so the 3G is closed most of the time.
So the zone event is not send before the wifi is connected anyways :joy:.

If you use the enter zone trigger you don’t have to use the from: not_home anyways

You can check that with the developer tool or the history