android
android copied to clipboard
Android Mobile App Intermittently Slow
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
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:
- when the app is slow, do other features like device controls, notifications, widgets get slow?
- does force stopping the app fix the issue?
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.
- 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)
- What version of the app the user is on
- What WebView package and version is installed on the device
- 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.
- What type of HA setup, HA core, Docker, Supervisor, HA OS
- Anything else that we may consider to be common.
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.
- HA core version 2023.2.5, but this issue is showing up since ~November
- 2023.1.1-full, same as the above it's there for a while. Usually reappears ever couple of weeks. Phone is Google Pixel 6 Pro.
- WebView version is 111.0.5563.57
- Custom resources:
- /hacsfiles/battery-state-card/battery-state-card.js?hacstag=256292682211
- /hacsfiles/bignumber-card/bignumber-card.js?hacstag=187245418006
- /hacsfiles/clock-weather-card/clock-weather-card.js?hacstag=5226340191011
- /hacsfiles/lovelace-auto-entities/auto-entities.js?hacstag=1677445841121
- /hacsfiles/lovelace-fold-entity-row/fold-entity-row.js?hacstag=150781994220
- /hacsfiles/lovelace-multiple-entity-row/multiple-entity-row.js?hacstag=178921037441
- /hacsfiles/lovelace-mushroom/mushroom.js?hacstag=444350375253
- /hacsfiles/mini-climate-card/mini-climate-card-bundle.js?hacstag=268163975243
- /hacsfiles/mini-graph-card/mini-graph-card-bundle.js?hacstag=1512800620110
- /hacsfiles/mini-media-player/mini-media-player-bundle.js?hacstag=1485208381165
- /hacsfiles/power-flow-card/power-flow-card.js?hacstag=484538222261
- /hacsfiles/scheduler-card/scheduler-card.js?hacstag=286270157327
- /hacsfiles/simple-thermostat/simple-thermostat.js?hacstag=158654878250
- /hacsfiles/sun-card/sun-card.js
- /hacsfiles/upcoming-media-card/upcoming-media-card.js?hacstag=146783593043
- /hacsfiles/vacuum-card/vacuum-card.js?hacstag=261291295263
- /hacsfiles/weather-card/weather-card.js
- /webrtc/webrtc-camera.js?v3.1.0
- HA Docker
- My wife who is using companion app much less often (on Pixel 5a), doesn't receive many notifications doesn't experience this problem.
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.
https://user-images.githubusercontent.com/29582865/225815334-fa303024-0fc3-4e65-9e06-05036b8e4f55.mp4
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.