I am trying to get an Android to be sent from home assistant which includes an address and sets google maps to navigation mode. I have found documentation here:
however I can’t seem to get it to work. Here is my attempt:
anyone able to guide me in the right direction. The intent sends however, the phone says “Unable to send activity intent, please check command format”
One things I don’t know how to do is made the address have URL encoded format (ie “New%20York%20Airport”) from the attribute of sensor.google_alarm_event
I have implemented a similar thing that works, I had a difference in the url used. In mine it was:
service: notify.{{states('sensor.prefered_notification_method')}}
data:
message: >-
#insert your message here
data:
#below is optional, but doesn't hurt
car_ui: true
ttl: 0
priority: high
actions:
- action: URI
title: GPS Guidance
uri: >-
https://www.google.com/maps/dir/?api=1&travelmode=driving&dir_action=navigate&destination={{states('whatever_variable_you_want_to_user_as_a_url_encoded_format_here)}}
To get a url encoded version of a string it is actually quite simple in home assistant. I found it in some random documents, but its just as simple as taking a {{states('example')}} and adding
You can’t launch an app and have a title - you have to send 2 notifications. If you want the user to confirm they want the address before sending the notification with the address you want to do something a little bit different - like this:
sequence:
- service: notify.mobile_app_nathaniel_s23u
data:
message: Time to Leave
title: >-
{{ as_timestamp(now()) | timestamp_custom('%H:%M') }} Do You Wish to
Navigate to {{ state_attr('sensor.google_alarm_event', 'address') }}?
data:
actions:
- action: google_alarm_navigate_address
title: "Yes"
- action: noop
title: "No"
tag: google_alarm_address
channel: google_alarm_address
priority: high
ttl: 0
timeout: 300
Change the timeout to whatever, or omit it if you don’t need it.
The sending to google maps for location works beautifully fine. However it’s the other two that I can’t seem to understand how it works. I think I’ve completly misunderstood what you were meaning:
alias: Request Navigation to Mobile
sequence:
- service: notify.mobile_app_nathaniel_s23u
data:
title: Time to Leave
message: >-
Event starts at {{ state_attr('sensor.google_alarm_event', 'time') }} Do
You Wish to Navigate to {{ state_attr('sensor.google_alarm_event',
'address') }}?
data:
actions:
- action: google_alarm_navigate_address
title: Send Location
tag: google_alarm_address
channel: google_alarm_address
priority: high
ttl: 0
timeout: 300
mode: single
icon: mdi:map-marker-radius
I can’t say I understand the need for two triggers? or how this is working. The message on the phone comes up perfectly fine, but when I click Navigage on the phone it does nothing at all.