Passing sensor state to push notifications

I cannot seem to figure this out. I have sensor [sensor.me_to_destination] that uses the Waze travel timer to calculate the travel time between me (tracker) and a few destinations. The state value is numeric in number of minutes. How do I pass this sensor value in a push notification. I’ve tried this but it’s not working:

  - service: notify.iphone
    data:
      title: Travel Time Estimate
      message: Estimated duration {{state.sensor.me_to_destination}}
      data:
        push:
          badge: 5

{{ states.sensor.me_to_destination.state }}

And I think you need to use data_template: instead of data: in your service call

1 Like

Ah that did the trick, thank you!

I also now see that all the different state variables are coming back. How would I pick a specific value out of all the states, such as route?

{
  "attribution": "Data provided by the Waze.com",
  "duration": 41.46666666666667,
  "distance": 52.787,
  "route": "I-66 E; Fairfax County Pkwy",
  "unit_of_measurement": "min",
  "friendly_name": "Me to destination",
  "icon": "mdi:car"
}

{{ states.sensor.me_to_destination.attributes.__________ }}

e.g.
{{ states.sensor.me_to_destination.attributes.route }}

you the best :wink: thank you!