Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register another URL in Companion App to open itself via https:// URL #4410

Closed
bilogic opened this issue May 17, 2024 · 13 comments
Closed

Register another URL in Companion App to open itself via https:// URL #4410

bilogic opened this issue May 17, 2024 · 13 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@bilogic
Copy link

bilogic commented May 17, 2024

Is your feature request related to a problem? Please describe.

Yes, I cannot form any https://... URL link that will open my CA. https://my.home-assistant.io opens up in browser instead of companion app (CA). This is because the CA expects the URL to start with homeassistant://... which creates another problem because many apps/software do not render homeassistant://... as a clickable link

Describe the solution you'd like

I would like to have a https://... link that will open my companion app.
An easier solution, but not within my control is to have add another registered URL in the CA e.g. direct.home-assistant.io, thus, when I click on https://direct.home-assistant.io/{where-the-user-wanna-go}, it redirects to homeassistant://navigate/{where-the-user-wanna-go}

Describe alternatives you've considered, if any

Update the form on https://my.home-assistant.io to accept homeassistant://navigate/{where-the-user-wanna-go}. Currently when I try to set my URL as homeassistant://navigate/{where-the-user-wanna-go}, it becomes homeassistant://

Additional context

None

WORKING SOLUTION

  1. Tested Location: homeassistant://navigate/{where-the-user-wanna-go} on Chrome, did not work
  2. This actually works
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=homeassistant://navigate/{where-the-user-wanna-go}">
@bilogic bilogic added the enhancement New feature or request label May 17, 2024
@dshokouhi
Copy link
Member

We already are registering the my home assistant links. Did you turn it off by chance?

Screenshot_20240516-201429.png

@dshokouhi dshokouhi added the question Further information is requested label May 17, 2024
@bilogic
Copy link
Author

bilogic commented May 17, 2024

How do I do that? I tried logging out and in again on the companion app and no effect.

@bilogic
Copy link
Author

bilogic commented May 17, 2024

Wait, do you mean it is fixed to https://my.home-assistant.io only? What if I have https://ha.abc.com?

@dshokouhi
Copy link
Member

Wait, do you mean it is fixed to https://my.home-assistant.io only? What if I have https://ha.abc.com?

No we don't register for your own URL.

@bilogic
Copy link
Author

bilogic commented May 17, 2024

Ok,

  1. I formed the URL https://my.home-assistant.io and have it sent to telegram
  2. Clicking on the telegram link leads me to some sort of browser where I enter my custom URL
  3. I added my URL and clicked on it, it loads from my domain in that browser, does not jump to companion app

@bilogic
Copy link
Author

bilogic commented May 17, 2024

So, I tested

  1. OK - https://api.whatsapp.com/............
  2. Not OK - https://my.home-assistant.io
  3. Not OK - https://www.home-assistant.io

OK = opens in WhatsApp app
Not OK = does not open in companion app, instead opens in a page powered by Chrome

Taken together it tells me telegram isn't the one blocking these URLs from the respective app, my logical conclusion is to point at the companion app, all permissions already given and I can see URLs 2 and 3 under Supported web addresses in the Set as default.

If this is an existing feature, then this issue will be a bug report

@dshokouhi
Copy link
Member

If this is to be a bug report then we need much more information like app version, device info, logs. What URL you are actually using. A my home assistant link is usually configured in a manner like you see on the HA website.

@bilogic
Copy link
Author

bilogic commented May 17, 2024

I tested on another android, same issue: no URL leads to companion app (CA) and I don't think it can happen, here's why:

  1. If CA is installed properly, https://my.home-assistant.io should open CA immediately (like WhatsApp) since it appears in Supported web addresses
  2. It should never lead to a webpage asking for my custom URL
  3. But for some reason, it does not open the CA on both my devices, instead leads to the webpage asking me to input my custom URL
  4. Since custom URL is not registered by any app nor CA, it will always open in Chrome

Perhaps can point out where if my understanding and deduction is incorrect?
My 2 devices are both Samsung, 1 tablet, 1 phone.

@bilogic bilogic changed the title Register to handle my URL on Android Open Companion App via URL May 17, 2024
@bilogic bilogic changed the title Open Companion App via URL Open Companion App via https:// URL May 17, 2024
@bilogic
Copy link
Author

bilogic commented May 17, 2024

@dshokouhi

Alright, I got it figured out. We were talking about 2 very different things.

  1. I wanted a https:// that opens the companion app (CA)
  2. You were referring to URLs that the CA registered
  3. In typical apps that I have seen, registered URLs lead to the app opening itself, but this is currently not the case for CA
  4. In order to open the CA, the URL has to be homeassistant://navigate/... and this is not https://...
  5. Adding a https://... option is helpful because most apps don't render homeassistant://navigate/... as a URL
  6. Thus, this will remain a feature request and I have updated my OP

@bilogic bilogic changed the title Open Companion App via https:// URL Register another URL in Companion App to open itself via https:// URL May 17, 2024
@jpelgrom
Copy link
Member

The app needs to include the URLs it wants to register for to deep link (open app directly) in the manifest file, which is included when the app is built. So overriding your Home Assistant URL won't be possible.

Deeplinks for HA, also for apps, are handled via my.home-assistant.io. If you need this we should add it there instead of making it Android specific. Going to close this as a duplicate of home-assistant/my.home-assistant.io#172.

Not OK - https://my.home-assistant.io

The landing page won't work. A specific page like https://my.home-assistant.io/redirect/energy should open the app.

@jpelgrom jpelgrom closed this as not planned Won't fix, can't repro, duplicate, stale May 17, 2024
@bilogic
Copy link
Author

bilogic commented May 17, 2024

@jpelgrom

I found and implemented a working solution on my own domain. HA can implement this for the community too.

@bilogic
Copy link
Author

bilogic commented May 17, 2024

@jpelgrom

How do I go to a specific page of mine? https://my.home-assistant.io/redirect/lovelace results in 404 page not found

@jpelgrom
Copy link
Member

The issue I linked to as duplicate is a request to allow arbitrary pages with my. Currently you can only use the predefined destinations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants