URL Notification Link

Great feature request, will be out in the next version :slight_smile:

EDIT: BTW, the reason it’s not working is because attachment is expected to be an image, audio or video file. You will need to tweak the format slightly to open URLs.

1 Like

Awesome! Love the app you have built and glad to see you keep improving it. Figured it was looking for some type of file association with the attachment, but wanted to try all the possible combinations before posting.

Looking forward to the next release!

This has been included in the forthcoming 1.1.1 which I just submitted to Apple. It should be released tomorrow. Thanks for the feature request!

3 Likes

Perfect! Thanks for getting it implemented so fast.

has this been implemented yet? i still cannot get this to work…

Yes, it is working for me. How do you have the notification setup? Below is my notification to open waze and start navigating if there is heavy traffic.

action:
  service: notify.ios_michael_iphone
  data:
    title: "Work Detour"
    message: "Navigate using detour?"
    data:
      url: waze://?favorite=work
1 Like

Just curious in the trigger for that automation @shire210

The trigger is set to send the notification if I leave my house between 6:30-7:00 on a weekday if “alternate route” is turned on. For the alternate route sensor, I have a google travel time sensor set up and compare the distance listed in that sensor to the usual commute distance. If those two numbers are different, it turns “alternate route” ON.

trigger:
  platform: state
  entity_id: input_boolean.ios_home
  to: 'off'
condition:
  condition: and
  conditions:
    - condition: time
      after: '06:30:00'
      before: '07:00:00'
      weekday:
        - mon
        - tue
        - wed
        - thu
    - condition: state
      entity_id: binary_sensor.alternate_route
      state: 'on'
action:
  service: notify.ios_michael_iphone
  data:
    title: "Work Detour"
    message: "Navigate using detour?"
    data:
      url: waze://?favorite=work

i wrote it as:
action:
service: notify.ios_phone
data:
title: ‘New Version of Home Assistant Available!’
message: ‘Check the release notes here.’
data:
attachment:
url: https://www.home-assistant.io/blog/

well i’m not sure why that didn’t copy correctly…

action:
  service: notify.ios_scotts_iphone
  data:
    title: 'New Version of Home Assistant Available!'
    message: 'Check the release notes here.'
    data:
      attachment:
        url: https://www.home-assistant.io/blog/

Do regular notifications work (ones without links)? I would try removing the “attachment” portion and using double quotes.

action:
  service: notify.ios_scotts_iphone
  data:
    title: "New Version of Home Assistant Available!"
    message: "Check the release notes here."
    data:
      url: https://www.home-assistant.io/blog/

I just tested it by going to the “Services” section under developer tools. Under “Service” select notify.ios_scotts_iphone and under service data, I used the following:

{"title":"'New Version of Home Assistant Available!'","message":"Check the release notes here.","data":{"url":"https://www.home-assistant.io/blog/"}}
1 Like

ok. i got that working… is there any way to do that with an actionable notification? so i have set up options for ‘update’, ‘read release notes’, ‘stop reminding me’, and ‘remind me later’. i would like it to just open the release notes when i click that option, but instead from what i can tell it would just have to send another notification to do so

I believe you are correct. I am not aware of any way to do that without having it send a new notification.

Is this still working for you? I am trying to set up the exact same automation but can’t get the URL to pass either using Google, Waze or Apple maps. The notification just ignores it.

Yes, it is still working perfectly for me. Not sure why it wouldn’t be working for you. If you can post your code, I can take a look at it and see if everything was set up correctly there. If you are getting the notification on your phone, you can just paste the “Action” piece.

Here’s the code in question. I’ve not gotten as far as building out the automation with triggers/conditions (at present I’ve just set it to go at a time of day, and am triggering it via automation.trigger to test it). I’ve commented out the other services I’ve tried to implement, none of these are working. iOS simply shows the title/message and no map.

I’ve tried using data: attachment: and that has no change.

action:
  - service: notify.ios_matt
    data:
      title: 'Commute Update'
      message: 'Here's an update for you...'
      data:
        #url: waze://?favorite=work
        url: http://maps.apple.com/?saddr=Cupertino&daddr=San+Francisco
        #url: 'comgooglemaps://?saddr=Cupertino&daddr=San+Francisco&directionsmode=driving'

Okay. I pasted that into an automation and it worked perfectly. What happens when you click on the notification? Does it take you into the Home Assistant app or does it do nothing at all?

Ahhh ok - I’d not followed it through HA previously as I’d assumed it would direct me straight to Waze/Google/Apple etc. I can click the notification and it takes me into HA and then I can click again for directions. Problem solved - the error was the user!

Glad you got it sorted out. If you click on the settings button (Gear in bottom right) in the HA app, scroll down to “Notification Settings”, you can turn off “Confirm before opening URL”. If you do that, when you click on the notification, it will open HA and then switch right over to the correct app. It skips you having to click again to get the directions.

That’s awesome, thanks for the heads up. Next step is to send a dynamically generated google map that shows the directions as a thumbnail attachment – nearly there with this piece of the puzzle.