Send notification with arrival time

This is above my knowledge how to get this to work so is there anyone here that can help me?

I would like HA to send a notification with the time I get home when I am leaving work. Is there possible somehow that when I am exiting “zone work” it takes the travel time from google travel sensor and send a notify that I´ll be home xx:xx?

I have this running currently. It does not give you the time in which you will arrive but the duration.

- alias: Leaving work
  trigger:
    platform: state
    entity_id: device_tracker.ryans_iphone_app
    from: 'work'
    to: 'not_home'
  action:
    service: notify.ios_ryans_iphone_app
    data_template:
      title: "You are leaving work!"
      message: >
        And will arrive in {{ states("sensor.device_ryan_to_home") }} minutes.
1 Like

Thanks, is sensor.device_ryan_to_home a Google Maps Travel Time?

yes

- platform: google_travel_time
  name: device_ryan_to_home
  api_key: !secret google_api
  origin: device_tracker.ryans_iphone_app
  destination: zone.home

Thanks, I will try this when I get home tonight

some jinga2 magic

{{ ( as_timestamp(now()) + (states("sensor.device_ryan_to_home") | int) * 60 ) | timestamp_custom("%H:%M %p") }}

gives me 11:36 am

So you could try.

- alias: Leaving work
  trigger:
    platform: state
    entity_id: device_tracker.ryans_iphone_app
    from: 'work'
    to: 'not_home'
  action:
    service: notify.ios_ryans_iphone_app
    data_template:
      title: "You are leaving work!"
      message: >
        and will arrive home at {{ ( as_timestamp(now()) + (states("sensor.device_ryan_to_home") | int)  * 60 )  | timestamp_custom("%H:%M %p") }}.

That works beautiful @rabittn Is there any way in the cod to remove the PM/AM? Here in Sweden we use 24H clock so the notifications said “arrive home at 22:01 PM” So the PM do not ad anything for me

just remove the %p from the timestamp_custom

you can look here for other options.
https://docs.python.org/3/library/time.html#time.strftime

Works like a charm! Many thanks @rabittn

This seems to work like a charm, thank you. Is there a way to convert to 12hr format instead of 24hr? Thanks

Figured it out, change %H:%M %p ti %I:%M %p