Open MaxK99 opened 1 year ago
I encountered something similar a few times, looked like it was something in the WebView causing it to slow down as other parts of the app remained fast.
Can you check:
Unfortunately, it can be a few weeks before the issue occurs. But I will do those checks when it does happen again. Hopefully, others will jump in and provide feedback sooner.
There was a recent mention about how clearing the cache on the phone resolved the same issue.
This issue occurs for me too. The cache clearing does not solve the problem, only the mobile restart.
I also have this issue. I often also get the screen that the instance is not available (where I can decide to wait, check internal URL etc.) when I open up the app. It's like there is a massive delay/package loss.
In my case, I usually "fix" this by rebooting the phone but it comes back quickly. I am using a Google Pixel Pro 7 but I remember I also had this behavior with my Galaxy S20+ few months back, this is clearly not something recent. I just tried to purge the cache but it did not change anything, however, I used "Force Stop" and it immediately fixed it. And I mean not just swiping up the app in the app switcher, it does not stop really stop it.
Based on this comment and the description from this issue I think this might be a frontend issue and not an app issue.
Home Assistant should automatically reconnect with a maximum of 1 second delay.
I often also get the screen that the instance is not available (where I can decide to wait, check internal URL etc.) when I open up the app.
This is unrelated to this issue. The only reason why that pop-up will show up is either a connection error to the server or your server did not respond within 10 seconds.
And I mean not just swiping up the app in the app switcher, it does not stop really stop it.
Some manufacturers will implement force stopping an app when you swipe it away but typically that does not happen and it just stops the activity.
I often also get the screen that the instance is not available (where I can decide to wait, check internal URL etc.) when I open up the app.
This is unrelated to this issue. The only reason why that pop-up will show up is either a connection error to the server or your server did not respond within 10 seconds.
Well, I only get this message when I open up the app, and webview works perfectly fine and responsive, so I guess this seems to be at least not a network issue.
I can confirm the behavior described by @ciB89. It becomes so slow at some point that the message is shown. The slowness is the same on Wi-Fi or 4G, using internal or external URL. It's like having a throttling preset to Slow 3G enabled.
I actually have a video of it being slow to load from last December with dev tools open, showing unexpected gaps in the timeline with the webview waiting on basically nothing? Not sure where to start with determining where the issue lies / how to fix it though, and I haven't seen this behavior recently.
https://user-images.githubusercontent.com/8148535/223224266-47917152-fe71-4d3a-883d-4e3e8d667b2a.mp4
Maybe it's not related to network but to high CPU usage due to multiple instances of the app (as seen in #2749 for instance, no pun intended). If one clicks on notifications on a regular basis, new instances are spawn and the overall allocated CPU becomes high. Consequently, it degrades slowly over time. This could be the reason why killing the app (or rebooting the phone) fixes the issues, all the instances are killed.
Maybe it's not related to network but to high CPU usage due to multiple instances of the app (as seen in #2749 for instance, no pun intended). If one clicks on notifications on a regular basis, new instances are spawn and the overall allocated CPU becomes high. Consequently, it degrades slowly over time. This could be the reason why killing the app (or rebooting the phone) fixes the issues, all the instances are killed.
That code has been there for a very long time, as in well over a year. This issue has only recently started back in November so the timing and dates don't match up.
Hello, I also have this problem and it started at the same time as adding an Android widget and quick access with the notification bar (maybe a coincidence) . I notice too this is temporarely resolve with device reboot.
It's not easy to reproduce but I ran a top and saw this while the application was slower to load the home page.
Sorry the cropped output... PID 11884 is the webview:
@Mincka managing CPU tasks is out of scope for any android app, that is up to the system to handle it.
Also we no longer keep those newly spanned tasks in history, they are removed as soon as they user navigates away from it. That change was also done a while ago.
If that were indeed the issue then it would be very easy to reproduce actually.
Fine, but if you have some helpful recommendations to find out the root cause, don't hesitate to share.
At this point its probably best we look for whats common amongst all the users.
For me I am unable to reproduce this on my Pixel 7 Pro. HA core is on 2023.3 (only running HA core), WebView package is Googles and version is 110. Only custom card I use is custom weather and auto entities.
@dshokouhi Edited original post with requested details. I have not had a recurrence since original post yet.
I'm also experiencing this issue for few months. Clearing app cache doesn't work, reboot helps and clearing app user data too.
Logs just after app was started. homeassistant_companion_log_2-9-2023_21-48-50.txt
Hello,
I also have the exactly same problem since few months and forcing to stop the App fixes the bug for some times too (but not definitely).
What version of HA core the user is on (even better if we can tell which version the issue started as we suspect this started in November 2022) 2023.3.3
What version of the app the user is on 2023.1.1-full
What WebView package and version is installed on the device 110.0.5481.153
If the user has any custom cards or components (may be trivial as I think some users don't have anything custom). For this keep in mind we care about if the card is loaded as a resource in Lovelace, it does not have to be used just loaded. -> Battery State Card -> Hass Shutter Card -> Light Entity Card -> Grocy Meal Plan Card -> Template Entity Row -> Xiaomi Vacuum Card -> Xiaomi Vacuum Map Card -> Kiosk Mode
What type of HA setup, HA core, Docker, Supervisor, HA OS HA OS
Anything else that we may consider to be common. I have this bug on my Pixel 7 Pro.
Also see this exact problem on pixel 6 pro with the latest version of the companion app. Loading HA via a browser on the same phone works quick.
Hi,
Having this problem too since a few months.
What version of HA core the user is on (even better if we can tell which version the issue started as we suspect this started in November 2022) 2023.3.4
What version of the app the user is on 2023.1.1-full
What WebView package and version is installed on the device 110.0.5481.153
If the user has any custom cards or components (may be trivial as I think some users don't have anything custom). For this keep in mind we care about if the card is loaded as a resource in Lovelace, it does not have to be used just loaded. -> WebRTC camera -> Frigate -> Powercalc -> Circadian Lighting -> Pyscript -> Dahua -> Fontawesome -> Dwains Dashboard -> Volkswagen We Connect ID -> Daikin Residential Controller
What type of HA setup, HA core, Docker, Supervisor, HA OS HA OS
Anything else that we may consider to be common. I have this bug on a Samsung Galaxy S22 Ultra.
With this bug the companion app is basically unusable. It takes 50 seconds to load on the app versus 5 seconds on Chrome.
Galaxy S23 Ultra.
It's as if the app had a data speed cap.
I've also been experiencing this issue for a month or two at least. I assumed I was having a WiFi problem until I tested the web app and it loaded really quickly.
Every time I try and open the Android app it spins for a while, gives me the error about not finding my instance, then starts loading a few seconds later.
But then every page I go to within HA just sits on a blank window for 5-10 seconds until it starts loading in slowly.
I am experiencing this issue again since first posting the details above. Nothing has changed version-wise except I have the March 5, 2023 security update.
There is nothing in the Core or Supervisor logs. I did captured the companion log again. homeassistant_companion_log_2-18-2023_14-52-4.txt
@dshokouhi I will try to keep my phone in this state in case you want me to check anything else.
Also experiencing this issue for the last 2months or so, it even affects the ble transmitter, so my espresense setup thinks I'm not home because the app stops broadcasting. I use the persistent websocket connection if that changes anything.
Notifications are also significantly delayed during this time, I have some door open notifications which will trigger 5 mins after sent instead of <1 second
When I open the app it's very slow to open, complains about ha server being unreachable then eventually starts up, but navigating between dashboards is very slow.
I just force stop the app and re open and it's fast again.
Same here on a Pixel 6A and OnePlus Nord. Versions of the companion app are basically always latest, Core HA is currently 2023.3.6.
Notifications are delayed at that time, location of apps in zones doesn't update correctly for a while.
Force stop seems to alleviate the problem for a while.
When the application starts running slowly, I looked at what it shows in debug mode. It seems that in addition to the main instance, there are also several others that are marked as detached. Killing/reloading the application not only does not help, but after each kill/reload a new detached instance appears. The only thing that helps is rebooting the device or force stop. This helps for a few days or a week, then everything happens again.
To add to this, it seems that it is also draining my battery quicker.
I had removed the app for a while and used the web app, and my phone used to live a lot longer. Reinstalled the app because I missed the notifications (html5 notifications are not as reliable), and now it is getting drained a lot faster again.
No extra sensors or w/e enabled, just basic install with default settings. So might be related to this issue and the higher CPU usage others have noticed.
@wouterrutgers for battery drain issues please refer to our troubleshooting guide, as far as I know no other user in this thread has mentioned high battery drain so its possible you have some settings to adjust or something that needs to be cleaned up.
https://companion.home-assistant.io/docs/troubleshooting/faqs#android-app-battery-drain
Try to remove the internal ip and wifi ssid from the companion app completely. I found that mine significantly sped up after doing that.
Thanks for the suggestion, but I never had it there.
Can you try filling it in and restarting and removing it again?
Ok, just did. Let's see how it behaves.
Just to update, I tested it, and it has apparently helped for a while. Just like cleaning the app cache does.
But the problem returns.
Same for me, unfortunately.
Same here since a couple of days (could be a bit longer, don't use the app every day), though strangely it resolved itself sometime last night, without doing anything.
What version of HA core the user is on (even better if we can tell which version the issue started as we suspect this started in November 2022) Started while on HASS OS 9.5 and Core 2023.4.4, but not directly after updating to these versions. The issue continued after updating to 10.1 / 2023.5.2.
What version of the app the user is on 2023.3.0-full
What WebView package and version is installed on the device Android System WebView 112.0.5615.135.
If the user has any custom cards or components (may be trivial as I think some users don't have anything custom). For this keep in mind we care about if the card is loaded as a resource in Lovelace, it does not have to be used just loaded. Nothing custom, as for addons: File editor, Glances, Mosquitto Broker, SQLite Web, Terminal & SSH.
What type of HA setup, HA core, Docker, Supervisor, HA OS HA OS, OVA image in VMware Workstation 15.5.6, host OS W10 x64 LTSC 1809 (17763.1999).
Anything else that we may consider to be common. Samsung Galaxy S20 FE 5G, DNS lookup is done using PiHole. Since the memory card of my RPi recently died and had to do a clean install, I thought the problem was there, seems it's not.
Have the same issue, for quite a long time now. Apparently clearing cache is the only short-term solution for the problem.
I confirm the same behavior from long time too. When it happens it can be resolved by clearing the app cache and force the app to exit, then it works again as normal, until it happens again. Not the worse issue when you understand how to overcome but I'm sure there's many person that don't know what to do and uninstall/reinstall to resolve, losing all sensor configuration...
https://github.com/home-assistant/core/issues/100982 Confirm same behavior. More info in the linked issue
Same here!
Mine is set to auto clear cache every night with 1Tap Cleaner Pro, since i started the auto clear cache i disabled the auto reboot HA automation (i thought that the database was making the lags) and for 10 days the HA app is working flawless.
Yes clearing cache or reboot phone solves the problem for a while but this should not be the solution as before not had this issue
I had a similar issue lately and spent days investigating. Long story short, it was due to the file known_devices.yaml that was too big, like several megabytes (this was due to a chatty BLE device tracker integration). Reduced the file to like ~1000 lines and after a HA reboot it was day and night.
Where can I find this file?
Where can I find this file?
At the root of /config next to configuration.yaml
@earion68 that's just a coincidence. No use of that file here (not even present), issue still appears occasionally.
Would have to initially side with @nagyrobi. on this one. A. That file is not present on my system and B. Restarting the phone would not (unless there is some specific code doing it) adjust that file on the server and reload the server (as my issues are resolved without server restart). Not saying your issue wasn't resolved as per your description @earion68 . Just saying it is likely another issue. IMHO. Thanks for your input though 👍
Same behavior for me since a few HA core releases ago. Interested in helping testing or doing anything I can to help nail down the issue.
What version of HA core the user is on
Home Assistant 2023.10.3 Supervisor 2023.10.0 Operating System 11.0 Frontend 20230608.0 - latest
What version of the app the user is on
2023.10.2-full
What WebView package and version is installed on the device
117.0.5938.153
If the user has any custom cards or components (may be trivial as I think some users don't have anything custom). For this keep in mind we care about if the card is loaded as a resource in Lovelace, it does not have to be used just loaded.
Hmm ... nothing that I wrote myself. The most advanced I have is a Thermostat card, but it's the defualt one as far as I know.
What type of HA setup, HA core, Docker, Supervisor, HA OS
HA OS
Anything else that we may consider to be common.
Works fast on Web but get slow on mobile. Restarting Home Assistant core makes it fast again for a while, but after hours / a day it gets slow again. Force stop on Android also makes it fast again - TBD for how long.
After some more testing I can confirm the issue is temporarily resolved by flushing the app cache. It does however eventually return. Very random when it occurs. I cannot see any pattern to it.
Home Assistant Android app version(s): 2023.1.1-full Android version(s): 13 Device model(s): pixel 4a Home Assistant version: 2023.2.5 HA OS Last working Home Assistant release (if known):
Description of problem, include YAML if issue is related to notifications: The Android mobile app is intermittently slow to startup (5-10 seconds to start) and slow when navigating in the app (up to 5 seconds to navigate to a different screen). The issue is persistent when it occurs until the phone is rebooted. This issue has been reported by others in the Home Assistant Forum
https://community.home-assistant.io/t/mobile-app-2022-11-0-full-slow-lately-solved-after-reset-but-now-slow-again/504816
https://community.home-assistant.io/t/ha-app-has-become-slow-on-android/534341/6
Companion App Logs: homeassistant_companion_log_1-28-2023_5-59-6.txt
Screenshot or video of problem:
Additional information: WebView version: 110.0.5481.153 No custom cards No HACS components