home-assistant / android

:iphone: Home Assistant Companion for Android
https://companion.home-assistant.io/
Apache License 2.0
2.16k stars 608 forks source link

Shortcut URL Hash Support #4502

Closed Nerwyn closed 2 weeks ago

Nerwyn commented 2 weeks ago

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

Some custom cards (like bubble card) use URL hashes to display popups, which can be navigated to directly in desktop and mobile browsers. Unfortunately, the Home Assistant Android app shortcuts do not support hashes, and they are ignored if included in the Dashboard view or Dashboard field.

Describe the solution you'd like

Include URL hash in Dashboard view or Dashboard path for Home Assistant Android app shortcuts.

Describe alternatives you've considered, if any

Navigate to the page with the custom card and then navigate to it from there.

Additional context

The shortcuts setting page for reference.

dshokouhi commented 2 weeks ago

Are you sure the hash is ignored? If you load the URL in a new tab in Chrome for Android does it work?

Nerwyn commented 2 weeks ago

The URL with hash works in Chrome, Brave, and Firefox for Android. It does not work as a shortcut.

dshokouhi commented 2 weeks ago

ok are you at least being navigated to the correct dashboard?

Nerwyn commented 2 weeks ago

The shortcut is navigating to the correct dashboard when the hash is included.

dshokouhi commented 2 weeks ago

this is probably not limited to shortcuts probably also impacts clickAction in a notification. Also not seeing anything in our code that strips things after a hash so not sure how thats happening.

dshokouhi commented 2 weeks ago

if you enable chrome remote debugging and hook up to chrome do you see the hash still in the URL? looks like we are indeed saving the string as is and loading it as is so im curious if the browser still sees the hash there.

Nerwyn commented 2 weeks ago

Do you mean in Chrome for Android or the Home Assistant app? Chrome for Android reports the URL with hash. Screenshot 2024-07-09 232226

dshokouhi commented 2 weeks ago

Do you mean in Chrome for Android or the Home Assistant app? Chrome for Android reports the URL with hash. Screenshot 2024-07-09 232226

The HA app actually, you need to enable remote debugging in companion app settings to access it there. You should hopefully see the URL with the hash still there.

Nerwyn commented 1 week ago

Confirmed working in the latest beta! Thank you!