iOS Companion App doesn't support percent encoded URLs

I am using the tap_action of a button-card to open a URL when the button is pressed. The capability works fine when accessing HA from a browser, but not from the iOS HA Companion App.

I’ve found that if the URL is percent encoded, the browser (Chrome) doesn’t get launched, but without the percent encoding it works file.

For instance, with the iOS Companion App, the following button card will not launch the Google URL when the button is pressed.

type: 'custom:button-card'
tap_action:
  action: url
  url_path: http://www.google.com?q=home%20assistant
color_type: icon
entity: sensor.charger_voltage

But this one works fine.

type: 'custom:button-card'
tap_action:
  action: url
  url_path: http://www.google.com?q=home+assistant
color_type: icon
entity: sensor.charger_voltage

I’m actually using the capability to launch Grafana dashboards, and the percent encoded URL is what Grafana provides me for the desired page.

Does the URL need to be encoded in some other way for the iOS Companion App to launch the URL?

I’ve continued trying to get encoded URLs to work with the Companion App. The button_card action is supposed to launch a Grafana web page. One of the URLs that I’ve have for an action is:

/graph/d/DrRzXZRRz/ac-current?orgId=1&var-device=Charger%20Input

This is the URL that Grafana provided me to use. The %20 for the space is what’s causing the problem. I’ve tried using a “+” (without quotes) instead of %20 but that doesn’t work. I’ve also tried using the space character instead of the %20, no luck. I’ve tried placing the URL in single and double quotes also. Each time the web browser launching of the URL will work, but not from the iOS Companion App.

Any suggestions would be appreciated.

I’ve further determined that the issue of opening of percent encoded URLs (with a %20 in lieu of a space) only occurs when the “Open links in Chrome” option is enabled under App Configuration -> General.

With the option turned off, the URL successfully launches in Safari.

Ever find a workaround?

I am thinking some type of addon that could redirect an url (maybe apache or nginx? ) ?

No, although I’m currently running HA 0.114.1 and HA Companion 2020.5.2 (1) and opening the URLs with Chrome is working better but not completely.

I’m still opening URLs with Safari. I just tested with Chrome and of the half a dozen tap_actions I tried, most, but not all, opened up in Chrome. I haven’t yet figured out why as it’s not a high priority for me.

Safari is working great although I would prefer Chrome.

If you file a GitHub issue with some example cards/URLs that don’t work, it’ll help a lot in resolving any issues with the open-in-Chrome support.

Done.