-
Notifications
You must be signed in to change notification settings - Fork 605
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
Unable to connect to Home Assistant error when playing video opened from notification #2684
Comments
Duplicate of #1672 |
Can you please explain how this is duplicated? This issue is regarding opening /api in app not /media When I open This issues is not about the content not loading, its about an error message appearing over the content even though there is no error preventing the content from loading. |
I have now confirmed that This further confirms that this issue is not a duplicate as |
Ok before I reopen can you try using a standard HA API instead of one built by a custom component? Try camera proxy please. |
Gave it a go, was about to figure out why I was receiving a 401 error for the camera proxy when the following showed up several seconds after the 401. In this case my URL is I then figured out how to auth the camera proxy (stole an API key from the UI) URL is as follows: The result is it loads then you get this lovely error. |
Looks like you used the incorrect format for the API, see the docs for proper format https://companion.home-assistant.io/docs/notifications/notification-attachments#automatic-snapshots There is no need to add auth here as the app already does that part. How long does it take for the pop-up to show up? 10 seconds after loading? |
Gave it a go, I now get a 404 error, I tried with multiple cameras and tried the direct IP instead of my reverse proxy. All the same
Yes, I just timed it and it looks to be about 10 seconds. Worth noting that every once in awhile its almost instantaneous. |
The reason why the pop-up here shows up is because the app is dependent upon the HA frontend notifying the app that it is connected via the external bus. When the API is used we may not get that message but that also means if a user had an invalid API call we may miss not showing them that we can't connect. I do not think its the correct approach to avoid showing this pop-up if a user is on an API page. I wonder if we detect an API call if we should just load it up in the browser instead of the apps own webview activity to avoid this. The code for showing this pop-up is here: android/app/src/main/java/io/homeassistant/companion/android/webview/WebViewActivity.kt Lines 1316 to 1325 in f4eea70
|
I do not think this is a good approach. You can already do this by specifying the absolute path with the FQDN to open in the browser. It only opens in app when using the relative path. Having the ability to open a video in app adds to the app UX making it feel more polished (save for the current error). |
Its not the same though, relative path forces the app add authentication. Opening in the browser requires the user to do so, we would just be adding auth to the request and opening it that way. It makes sense for the app to open a relative lovelace path, but not an API path which has no frontend UI.
There is no app UX though, our webview activity is plain without any UI added. Any UI you see is from the HA frontend. The benefit of a browser is that the user can close the tab, you can't do that in our app as there are no tabs. |
I'm having the exact same issue. Funny enough it only happens on one of my Android devices (my personal). Following this thread, it looks like there wasn't a consensus on whether viewing videos from the App UI vs Browser is the right approach. I use Frigate on top of HAOS. The combo is great, but this annoying banner is really taking away from the experience. Any update on this would be awesome! |
I think @dshokouhi is right, I don't like having the video open in the browser but I think that the best option (unless Frigate provides an integrated UI as part of their HACS add-on). I've been meaning to look into how to make it so it opens in the browser but I have not had the time. |
sorry to poke the bear, but any news on this? |
I moved to iOS and the issue is not there because Frigate elects to open video links in Safari, which does not have the issue. Wonder if Android can just have the option to open in browser, so we don't get these pesky and annoying error messages. |
I still intend to work on this at some point especially now that I have Frigate running in production. I just have not had the time to sit down and take a look at it. |
I'm having this exact same issue as well. No reverse proxy or anything like that, and I also get the error when viewing both recordings and snapshots. If anyone needs debug data or triaging, I'm happy to assist! |
Just plain ol |
Any update on this issue, I have exact same issue with Frigate notifications. |
Any update on this. Getting this on Android. |
So I looked into trying to resolve this issue over my Christmas Holiday but unfortunately I could not figure out the logic needed. If someone with more experience wants to give it a go, all theirs. I can also help if wanted. |
Hey everyone took an attempt to fix the issue. For anyone who wants to test the fix please download the artifact from https://github.com/home-assistant/android/actions/runs/3933174642 and extract and install the debug apk. You will need to enable the persistent connection to send a test message with the video or whatever else you sent when you got the error, firebase messaging does not work in debug builds. I also recommend giving a unique name during onboarding so you can easily tell which service call to use. The debug builds are designed to be installed side by the production one and are safe to remove after testing. If you do still encounter an issue please share the YAML of the service call so we can see what the URL looks like |
Just tested this morning and it works well. |
Home Assistant Android version:
beta-2484-0e0994de-full
Android version:
Android 12
Android 13 (Beta)
Phone model:
Pixel 4a (5G)
Pixel 5 (in a VM)
Home Assistant version:
2022.7.5
Last working Home Assistant release (if known):
N/A
Description of problem:
When playing a video clip opened from a notification I receive the error "Unable to connect to Home Assistant" The video continues to play behind the error message
The issue is present on my primary Pixel 4a (5G) running Android 13 Beta 4 and the beta release of HA. This issue was present when I was running Android 12
The issue is also present on a Pixel 5 VM running Android 12 stable
To further clarify, the issue happens when accessing a video from /api. The URL format is as follows
/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
Traceback (if applicable, to get the logs you may refer to: https://companion.home-assistant.io/docs/troubleshooting/faqs/#android-crash-logs):
Debug Log from Android Studio VM
android_studio_log.txt
Debug Log from In App
homeassistant_companion_log_6-16-2022_12-9-36.txt
Screenshot of problem:
![image](https://user-images.githubusercontent.com/14829730/179362008-01f4c9eb-6eee-4321-b368-cfff36e92426.png)
Additional information:
The text was updated successfully, but these errors were encountered: