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

Android app sensor unit keeps changing back and forth #4224

Open
Chaoscontrol opened this issue Feb 23, 2024 · 5 comments
Open

Android app sensor unit keeps changing back and forth #4224

Chaoscontrol opened this issue Feb 23, 2024 · 5 comments
Labels
bug Something isn't working sensor-tracking

Comments

@Chaoscontrol
Copy link

Home Assistant Android app version(s): 2024.1.5-full

Android version(s): 11 and 13

Device model(s): Poco X3 NFC & Xiaomi 12 Lite

Home Assistant version:
Core 2024.2.3
Supervisor 2024.02.0
Operating System 11.5
Frontend 20240207.1

Last working Home Assistant release (if known): It's been happening for at least 1 month if not longer, across the latest updates.

Description of problem, include YAML if issue is related to notifications:
I've kept getting warnings in the logs about sensors from our phones (different device models, both Android) changing units. I have gone into Dev tools and fixed the issue several times, but it keeps appearing sort of regularly every few days. It's always the sensors relating to the notification count.

In this case I guess (from the log) it seems to be notifications becoming 0, and the unit changes? Just guessing, not sure and haven't manually tested.

It's been happening over several HA core updates. I was waiting for it to eventually not come back after fixing, but it returns. I don't think it's related to recent updates.

Companion App Logs:

--------- beginning of system
02-23 13:13:09.028  9016  9045 W BpBinder: Slow Binder: BpBinder transact took 228 ms, interface=android.app.job.IJobScheduler, code=4 oneway=false
02-23 14:14:55.574  9016  9016 W Looper  : PerfMonitor looperActivity : package=io.homeassistant.companion.android/.launch.LaunchActivity time=0ms latency=364ms running=0ms  procState=2 ClientTransaction{ callbacks=[android.app.servertransaction.TopResumedActivityChangeItem] } historyMsgCount=1 (msgIndex=1 wall=364ms seq=1545 running=124ms runnable=61ms io=124ms h=android.app.ActivityThread$H w=159)
02-23 14:14:55.626  9016  9016 I Timeline: Timeline: Activity_launch_request time:636422829
02-23 14:14:56.555  9016  9016 W Activity: Slow Operation: Activity io.homeassistant.companion.android/.webview.WebViewActivity onResume took 162ms
02-23 14:14:56.575  9016  9016 W Looper  : PerfMonitor looperActivity : package=io.homeassistant.companion.android/.webview.WebViewActivity time=0ms latency=695ms running=0ms  procState=2 ClientTransaction{ callbacks=[android.app.servertransaction.TopResumedActivityChangeItem] } historyMsgCount=9 (msgIndex=9 wall=670ms seq=1562 running=266ms runnable=34ms io=216ms late=10ms h=android.app.ActivityThread$H w=159)
02-23 14:14:56.640  9016  9016 W Looper  : PerfMonitor doFrame : time=62ms vsyncFrame=0 latency=682ms procState=2 historyMsgCount=7 (msgIndex=1 wall=670ms seq=1562 running=266ms runnable=34ms io=216ms late=10ms h=android.app.ActivityThread$H w=159)
02-23 16:11:17.323  9016  9049 W BpBinder: Slow Binder: BpBinder transact took 263 ms, interface=android.net.IConnectivityManager, code=1 oneway=false
02-23 16:17:17.295  9016  9094 W BpBinder: Slow Binder: BpBinder transact took 225 ms, interface=android.net.IConnectivityManager, code=1 oneway=false
02-23 16:35:15.308  9016  9048 W BpBinder: Slow Binder: BpBinder transact took 266 ms, interface=android.net.IConnectivityManager, code=1 oneway=false
02-23 16:46:44.281  9016  9092 W BpBinder: Slow Binder: BpBinder transact took 227 ms, interface=android.gui.SensorEventConnection, code=1 oneway=false
02-23 17:04:43.265  9016  9091 W BpBinder: Slow Binder: BpBinder transact took 231 ms, interface=android.net.wifi.IWifiManager, code=29 oneway=false
02-23 17:17:55.030  9016  9048 W BpBinder: Slow Binder: BpBinder transact took 265 ms, interface=android.app.IActivityManager, code=12 oneway=false
02-23 18:41:51.799  9016  9063 W BpBinder: Slow Binder: BpBinder transact took 203 ms, interface=com.google.android.gms.location.internal.IGoogleLocationManagerService, code=89 oneway=false
02-23 19:29:36.003  9016  9016 I Timeline: Timeline: Activity_launch_request time:640008575
02-23 19:29:36.466  9016  9016 W Activity: Slow Operation: Activity io.homeassistant.companion.android/.webview.WebViewActivity onResume took 134ms
02-23 19:29:36.474  9016  9016 W Looper  : PerfMonitor looperActivity : package=io.homeassistant.companion.android/.webview.WebViewActivity time=0ms latency=415ms running=0ms  procState=2 ClientTransaction{ callbacks=[android.app.servertransaction.TopResumedActivityChangeItem] } historyMsgCount=7 (msgIndex=7 wall=375ms seq=5078 running=165ms runnable=40ms io=71ms late=41ms h=android.app.ActivityThread$H w=159)
02-23 19:29:36.550  9016  9016 W Looper  : PerfMonitor doFrame : time=74ms vsyncFrame=0 latency=405ms procState=2 historyMsgCount=11 (msgIndex=3 wall=375ms seq=5078 running=165ms runnable=40ms io=71ms late=41ms h=android.app.ActivityThread$H w=159)
02-23 19:29:44.595  9016  9016 I Timeline: Timeline: Activity_launch_request time:640017167
--------- beginning of main
02-23 19:32:08.793  9016  9016 D LocBroadcastReceiver: Received location update.
02-23 19:32:08.796  9016  9016 D ForegrndServiceLauncher: Check if service HighAccuracyLocationService is running. Service running = false
02-23 19:32:08.796  9016  9094 D LocBroadcastReceiver: Last Location: 
02-23 19:32:08.796  9016  9094 D LocBroadcastReceiver: Coords:(53.3808309, -2.1679754)
02-23 19:32:08.796  9016  9094 D LocBroadcastReceiver: Accuracy: 100.0
02-23 19:32:08.796  9016  9094 D LocBroadcastReceiver: Bearing: 0.0
02-23 19:32:08.799  9016  9094 D LocBroadcastReceiver: Begin evaluating if location update should be skipped
02-23 19:32:08.799  9016  9094 D LocBroadcastReceiver: Received location that is 43 milliseconds old, 1708716728756 compared to 1708716728799 with source fused
02-23 19:32:08.799  9016  9094 D LocBroadcastReceiver: Duplicate location received, not sending to HA
02-23 19:33:08.795  9016  9016 D LocBroadcastReceiver: Received location update.
02-23 19:33:08.799  9016  9016 D ForegrndServiceLauncher: Check if service HighAccuracyLocationService is running. Service running = false
02-23 19:33:08.800  9016  9049 D LocBroadcastReceiver: Last Location: 
02-23 19:33:08.800  9016  9049 D LocBroadcastReceiver: Coords:(53.3808309, -2.1679754)
02-23 19:33:08.800  9016  9049 D LocBroadcastReceiver: Accuracy: 100.0
02-23 19:33:08.800  9016  9049 D LocBroadcastReceiver: Bearing: 0.0
02-23 19:33:08.804  9016  9049 D LocBroadcastReceiver: Begin evaluating if location update should be skipped
02-23 19:33:08.804  9016  9049 D LocBroadcastReceiver: Received location that is 47 milliseconds old, 1708716788757 compared to 1708716788804 with source fused
02-23 19:33:08.807  9016  9094 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
02-23 19:33:08.988  9016  9094 D LocBroadcastReceiver: Location update sent successfully for 2 as exact
02-23 19:33:40.976  9016  9016 D IntegrationRepository: isAppLocked(): false. (LockEnabled: false, appActive: false, expireMillis: 1708716600933, currentMillis: 1708716820976)
02-23 19:33:41.085  9016  9016 D IntegrationRepository: isAppLocked(): false. (LockEnabled: false, appActive: false, expireMillis: 1708716600933, currentMillis: 1708716821084)
02-23 19:33:41.085  9016  9016 D IntegrationRepository: setAppActive(): true
02-23 19:33:42.982  9016  9016 W Choreographer: Frame time is 0.0741 ms in the future!  Check that graphics HAL is generating vsync timestamps using the correct timebase.
02-23 19:33:43.116  9016  9016 W Choreographer: Frame time is 0.062011 ms in the future!  Check that graphics HAL is generating vsync timestamps using the correct timebase.
02-23 19:33:44.351  9016 15107 W RenderInspector: QueueBuffer time out on io.homeassistant.companion.android/io.homeassistant.companion.android.settings.SettingsActivity, count=1, avg=13 ms, max=13 ms.
02-23 19:33:47.069  9016  9048 D LogcatReader: Read logcat for pid 9016

Screenshot or video of problem:
image

Additional information:
Coming from here

@Chaoscontrol Chaoscontrol added the bug Something isn't working label Feb 23, 2024
@jpelgrom
Copy link
Member

This is a peculiar bug, because the unit is always supposed to be notifications, not changing or none:

Is this the only sensor where you encounter this, or does this also happen to other sensors?

I wonder if this is related to home-assistant/core#83716, where core losing the state class also breaks the unit of measurement used for statistics producing the error from your screenshot 🤔

@Chaoscontrol
Copy link
Author

@jpelgrom Nope. I have only seen the issue with the notification_count sensor exclusively so far. It doesn't happen daily, only from time to time.

@Chaoscontrol
Copy link
Author

To add more info, today I noticed a slightly different but still related warning in the log.

The unit of sensor.xiaomi_12_lite_ax_active_notification_count is changing, got multiple {'notifications', None}, generation of long term statistics will be suppressed unless the unit is stable and matches the unit of already compiled statistics (notifications). Go to https://my.home-assistant.io/redirect/developer_statistics to fix this

@dshokouhi
Copy link
Member

Just checked my HA core logs and I am also seeing the original error now.

The unit of sensor.dannys_pixel_8_pro_active_notification_count (None) cannot be converted to the unit of previously compiled statistics (notifications). Generation of long term statistics will be suppressed unless the unit changes back to notifications or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this

I do not see the new error. I am not sure if this is an app bug but we probably need a core developer to help us here.

@Chaoscontrol
Copy link
Author

I haven't seen this error for a couple months now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sensor-tracking
Projects
None yet
Development

No branches or pull requests

3 participants