Intent to visit URL?

Using notify.mobile_app I managed to get this working:

message: "Waze"
title: "Drive home"
data:
  actions:
    - action: "URI"
      title: "Open Waze"
      uri: "https://waze.com/ul?favorite=home&navigate=yes"

Which gives me a actionable button to click to go home.
Now I’m thinking perhaps this can be done even better?

If I trigger on screen interactive, time, position and connected with bluetooth to my bluetooth receiver in the car then I know I’m about to go home from work (and drive to work in the morning).
So can I broadcast this as an intent for chrome to visit the URL?

I tried:

message: "command_broadcast_intent"
title: "https://waze.com/ul?favorite=home&navigate=yes"
data:
  channel: "com.android.chrome"

But it did not work.
Is there some way to launch Waze without clicking a button? (that didn’t sound lazy did it?)

In case anyone is looking for a good bluetooth receiver I highly recommend this one https://www.aliexpress.com/item/32878241482.html
Just to clarify, by this one I mean that board not seller. I bought it locally and have no clue about this seller.

try looking at logcat to see whats going on, thats really the only way to troubleshoot intents

Also you want to do command_activity for something like this

Examples from Google: https://developer.android.com/guide/components/intents-common#ViewUrl

1 Like

That did it! Thank you!

In case anyone else wants this, this is what worked:

message: "command_activity"
title: "https://waze.com/ul?favorite=home&navigate=yes"
data:
  channel: "com.waze"
  tag: "android.intent.action.VIEW"

That opens Waze with navigation home

1 Like

did you base that off this? https://developers.google.com/waze/deeplinks

I found the way from somewhere else. But that page has some good info.
I did not find that when I was googling.

Here is the automation to go to work, and it worked perfectly.

alias: Waze to work
description: ''
trigger:
  - platform: template
    value_template: >-
      {{ "7D:76:93:CE:2D:FF" in
      states.sensor.andreas_bluetooth_connection.attributes.connected_paired_devices
      }} 
  - platform: state
    entity_id: binary_sensor.andreas_interactive
    to: 'on'
condition:
  - condition: time
    after: '05:00:00'
    before: '07:30:00'
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
  - condition: state
    entity_id: binary_sensor.andreas_interactive
    state: 'on'
  - condition: template
    value_template: >-
      {{ "7D:76:93:CE:2D:FF" in
      states.sensor.andreas_bluetooth_connection.attributes.connected_paired_devices
      }} 
  - condition: state
    entity_id: person.andreash
    state: home
action:
  - service: notify.mobile_app_andreas
    data:
      message: command_activity
      title: 'https://waze.com/ul?favorite=work&navigate=yes'
      data:
        channel: com.waze
        tag: android.intent.action.VIEW
mode: single

and this is going home, but it’s still untested.
(I have set the time condition to just after I expect to the latest arrive at work since I have small kids that could need to be picked up from preschool)

alias: Waze to home
description: ''
trigger:
  - platform: template
    value_template: >-
      {{ "7D:76:93:CE:2D:FF" in
      states.sensor.andreas_bluetooth_connection.attributes.connected_paired_devices
      }} 
  - platform: state
    entity_id: binary_sensor.andreas_interactive
    to: 'on'
condition:
  - condition: state
    entity_id: binary_sensor.andreas_interactive
    state: 'on'
  - condition: template
    value_template: >-
      {{ "7D:76:93:CE:2D:FF" in
      states.sensor.andreas_bluetooth_connection.attributes.connected_paired_devices
      }} 
  - condition: state
    entity_id: person.andreash
    state: Arbete
  - condition: time
    after: '09:00:00'
    before: '16:30:00'
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
action:
  - service: notify.mobile_app_andreas
    data:
      message: command_activity
      title: 'https://waze.com/ul?favorite=home&navigate=yes'
      data:
        channel: com.waze
        tag: android.intent.action.VIEW
mode: single
2 Likes

By some reason this has stopped working.
Since I use the beta version I had to switch the tag and channel.
The service call now looks like this:

service: notify.mobile_app_andreas
data:
  message: command_activity
  title: https://waze.com/ul?favorite=home&navigate=yes
  data:
    intent_package_name: com.waze
    intent_action: android.intent.action.VIEW

I’m not sure if this stopped working because of HA or Waze or something else.
But the app opens but the navigation does not start.
Reading the documentations for Waze it should work. How to use Waze Deep Links  |  Google Developers

Anyone that has it working still?

Change title to command and move it to data like the other intent_* parameters

The example on the docs site mentions this too. Only the message parameter is used for commands now everything else changed.

Just a short update on this as I was exactly looking for this automation. In my case using a NFC tag, but the action code works now as follows:

action:
  - service: notify.mobile_app_yourphonename
    data:
        message: command_activity
        data:
            intent_uri: https://waze.com/ul?favorite=Home&navigate=yes
            intent_package_name: com.waze
            intent_action: android.intent.action.VIEW
1 Like