Node Red Notify URL URI from message

When referencing a node red message for a URL or URI, it doesn’t work for the ios notification to direct the app to a path. My path is /lovelace-control/cards. A message “notify_url” is set to a string of /lovelace-control/cards

{
    "message": "message",
    "title": "title",
    "data": {
        "url": "{{notify_url}}"
    }
}

You don’t say how exactly it doesn’t work.
You don’t show where notify_url is set. What you have posted - suggests that you have previously set msg.notify_url to the value you want, but you haven’t clarified that anywhere so we cannot know for sure.

ALWAYS use a debug node when things aren’t working properly and make sure you set it to dump all of msg, and not just msg.payload.

2 Likes

When using the “url”: “{{notify_url}}”, when clicking the notification, it opens the app, but not to the path. When using “url”: “/lovelace-control/firetablet”, when clicking the notification, it opens the app, and navigates to the the path “firetablet” on the dashboard “control”.
Here is my node red:

In code that I have that works - I am using 3 brackets, not 2:
This is for an MQTT publish call (hence the escaped " marks)

{
    "payload": "{\"device\": \"google-home\",\"speech\": \"{{{doorbell}}}\"}",
    "topic": "nptohc/notify/speech"
}

From the NodeRed manual - By default, Mustache will replace certain characters with their HTML escape codes. To stop that happening, you can use triple braces: {{{payload}}}. so by only using the 2 braces, your / in your URL will be becoming %2 when sent to the service call. So the full URL your app is receiving is %2Flovelace-control%2Ffiretablet

2 Likes

Thanks! The triple brackets worked!!!

1 Like

Took me a while to get to the bottom of it too, because I have some flows using double braces and some using triple. I knew there was a reason, but I had to go and Google to find out what the differences were.

Please consider marking my post as the solution, to help others.

1 Like

How do I mark your post as solution?

There is a grey bit of text that says “Solution” with a tick next to it, next to the part of the post where you like it, on the one that has the solution (ie use triple braces) - just click on the bit of text that says Solution.

I’m not seeing it…

It doesn’t exist in the node red forum

2 Likes

Ah I didn’t know that. I assumed it was forum wide.

No… by some reason it’s not possible to accept in some forums.
The reason there is an accept in the other forums is to make it easier to find answers, I find it odd that is not the case here.

1 Like

Agreed, since almost every thread in the Node Red forum is a request for help with a flow.

Thanks again Andrew!

1 Like

Thanks! Took me more then an hour to find your answer as its such a strange issue to google.

1 Like

We’re also in a very niche topic. There is a detailed guide for the HA nodes.

1 Like