home-assistant / home-assistant/android

High Accuracy Mode Infinite Loop

Open
#3,878 11 comments 0 reactions 0 assignees View on GitHub
bug location-tracking
Dominant language
Kotlin
Stars
3.9k
Forks
1.1k
Avg merge
1d 12h
Merged PRs (30d)
81

Description

**Home Assistant Android app version(s):**
Originally 2023.7.5-full
Updated to 2023.9.2-full
Issue present in both versions

**Android version(s):**
Android 12 and Lineage

**Device model(s):**
Samsung S20+
Samsung S21 FE (No logs or images of this phone included)

**Home Assistant version:**
core-2023.9.2

**Last working Home Assistant release (if known):**
core-2023.9.2

**Description of problem, include YAML if issue is related to notifications:**

NOTE:
Below is copy-pasted as I posted to the wrong section before, please excuse any formatting errors as a result.

2 out of 3 of my phones linked to Home Assistant have an issue with High Accuracy.

I own 3 Samsung devices.
S20+ - Has the issue
S21 FE - Has the issue
S22 Ultra - No Issues at all

All devices have the same settings and app installed.

When enabling High Accuracy, both devices cycle between on and off at an alarming rate.
This leads to the phone's battery draining 50% in 3 hours, and overheating while on standby.

The issue appears to come into play when using the High Accuracy Notification:
https://companion.home-assistant.io/docs/notifications/notification-commands/#high-accuracy-mode

When I turn off High Accuracy mode using the notification command, the devices will randomly turn on High Accuracy again without my input or any automation.

The image below shows the device cycling, as well as it turning on again while the phone was sitting across the room from me (Red Arrow points to where I put the phone down, I did not interact with it again)
![image](https://github.com/home-assistant/core/assets/11380895/bc71cff8-5f43-41a0-b940-c16f749c9470)

Instead of editing the video, I'll give a play-by-play below:
LINK REMOVED: Included at bottom of Issue to follow the template.

On the left is my device.
It starts with HA (High Accuracy) off.
I proceed to turn it on using the notification command, the loop starts.
I then turn it off, and the loop stops.
I then turn it back on, and the loop starts again.
I then change the update interval from 60 seconds to 240 seconds and the loop stops.
I then changed the update interval from 240 seconds to 120 seconds and the remains stopped.
I then changed the update interval to both 60 and 90 seconds and the loop starts.

Each time I test this, the amount of seconds that trigger the loop varies.

Unfortunately in this state, I cannot run the app for more than a few seconds before the log file gets too large and crashes the app.
Earlier today, within a space of ~30min, the app's Cache size reached 120MB.

I have attached a log file that was recorded during this occurrence. (Now also included in the section below for the logs)
[Log.txt](https://github.com/home-assistant/core/files/12666886/Log.txt)

I use the following YAML code to test the High Accuracy Functionality:
```
alias: Location Update Interval - S9
description: ""
trigger:
- platform: state
entity_id:
- device_tracker.s9
to: not_home
id: Travelling-S9
- platform: state
entity_id:
- device_tracker.s9
from: not_home
id: Not-Travelling-S9
condition: []
action:
- choose:
- conditions:
- condition: trigger
id:
- Travelling-S9
sequence:
- service: notify.mobile_app_s9
data:
message: command_high_accuracy_mode
data:
command: turn_on
alias: Force High Accuracy On
enabled: true
- service: notify.mobile_app_s9
data:
message: command_high_accuracy_mode
data:
high_accuracy_update_interval: 60
command: high_accuracy_set_update_interval
alias: high_accuracy_set_update_interval
- conditions:
- condition: trigger
id:
- Not-Travelling-S9
sequence:
- service: notify.mobile_app_s9
data:
message: command_high_accuracy_mode
data:
command: turn_off
alias: Force High Accuracy Off
enabled: true
- service: notify.mobile_app_s9
data:
message: command_high_accuracy_mode
data:
high_accuracy_update_interval: 240
command: high_accuracy_set_update_interval
alias: high_accuracy_set_update_interval
mode: single
```

**Companion App Logs:**
Log file far too long to paste here, will rather attach the .txt file
[Log.txt](https://github.com/home-assistant/android/files/12666979/Log.txt)

**Screenshot or video of problem:**
https://youtu.be/pG4yvLh-w6A

**Additional information:**
None

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.