Geofence trigger doesn't work

Hi.
I set up two automations based on geofencing.

A: When anyone enters the area, all alarms (Away, Home, and Night mode) are automatically disarmed.

B: When the last person leaves the area, Away mode is automatically armed.

To avoid conflicts, I set the area of automation A to a smaller radius than automation B. This should allow the alarm to be armed when everyone has already left the disarming area boundary.
Whether all users are active and all devices are enabled (with location authorization always active and accurate) or only one user is active with the corresponding device, the App detects enabled devices in the wrong location: within the area even if they are many kilometers away or outside the area when the device is actually within the area.
Why?
All the tests I’m doing are driving me crazy. I’m thinking of giving up.

Hi.
I assume you are referring to the ā€œGeoencing 2.0 (Lap)ā€ of the Aqara Home app on iOS.

Apps are restricted low power mode in iOS

Please note that the Aqara Home app may be restricted by low power mode on your iPhone. To avoid this, you must deactivate them.

Note: Even if you have already disabled them, the settings may have been reset by system updates without your knowledge. You can easily check this in your smartphone’s system settings and change them again if necessary.

Check if Precise Location is on

  1. Go to Settings > Privacy & Security, then select Location Services.
  2. Select the Aqara Home app
  3. Check if Precise Location is on

Ceck if location services blocked by Screen Time
Settings > Screen Time > Content & Privacy Restrictions

That doesn’t make much sense to me. I would use the ā€˜Away’ automation only, triggered by ā€˜Last to leave the area’, and the ā€˜Home’ automation by ā€˜First to arrive in the area’. This ensures that no alarm is active when someone is at home, which is usually the case with the night alarm.

2 Likes

Hi,
I use Aqara home on an Android device.
Following your suggestion about battery usage, even though it’s not a requirement.
I’ve now enabled background usage as well.
Location is already set to ā€œalwaysā€.

Home mode and Night mode have scheduled activations. Another automation disables the Night mode and Home mode schedules when Away mode is active. Geofencing malfunctions are independent of the scheduled activations.

I’ll now begin a new series of tests.

Also check if your device’s location accuracy turned on or off.

From Google for Pixel phones as example:

What Standard Battery Saver limits

  • Apps refresh their content, like email or news, only when you open the app.
  • Location services stop when your screen is off.
  • Apps don’t run in the background, unless you turn off battery optimization

For all devices, regardless of the Android version they are running:

I think that the problem was the right setting of the Battery usage.
I had to set it on Allow background activity (that is not required from the App when you set Geofencing 2.0).

All the test I made have a positive result.


1 Like

It’s good to hear that it’s working now, and I hope everything continues to run smoothly. From my own experience, I can say that it doesn’t work as well as hoped with an iPhone.

I’m going to start the tests enabling all the users and related devices.

1 Like

Android devices have the same problems.
Geofencing isn’t reliable; it detects incorrect locations even when the Location and Battery settings are set correctly.
I give up and switch to manually arming and disarming the alarms.

Same here. On android using aqara app for geofence. Im home and it thinks im away and arms. App has all the permissions, u restricted battery, etc and its just broken. Been patient with this and decided to just return my g5 camera. It wasnt cheap.

:warning: The geofence function is still in the laboratory stage.

:spiral_notepad: The location is always obtained by the app from the smartphone’s operating system (Android or iOS).


Increase the Defined Radius

Since location tracking accuracy isn’t always reliable, you should set a larger radius for your home. I have often experienced instances where my location was just slightly outside the designated home area, causing me to be marked as ā€œAway.ā€ Although I was at home, but that was due to the location accuracy of the smartphone.

Open the Aqara Home App

You should open the Aqara Home App occasionally. This causes the system to prioritize the app and send location data in a timely manner. If you haven’t opened an app for a long time, Android can also automatically revoke location and other sensitive permissions.

Request with confirmation button

From time to time, iOS (and possibly Android) displays a message showing how often an app has used location services and asks if you want to continue allowing this. It is important to ensure that you continue to allow the queries. If you accidentally press the wrong button, the app will no longer be able to access your location.

Enable Mobile Data

Enabling mobile data improves location positioning and increases its accuracy. Additionally, you need mobile data to access your Aqara devices remotely.

Enable Wi-Fi

With Wi-Fi enabled, your smartphone can determine your location more accurately. It uses nearby Wi-Fi networks to do this—even if your smartphone isn’t currently connected to a specific network. Your smartphone detects the locations of surrounding Wi-Fi networks. This allows the app to quickly receive information about changes in your location.

Disable Battery Optimization

Ensure that battery optimizations for the Aqara Home App are disabled. These optimizations are designed to minimize your smartphone’s overall power consumption. However, this leads to the Aqara Home App being terminated in the background, preventing location checks from being performed.

Disable Battery Performance Optimization

On Android devices, you should disable battery performance optimization for the Aqara Home App. This ensures the Aqara Home App receives location data from the operating system without delay. Depending on the specific smartphone or operating system version, certain power-saving settings may become active again after a system update. This can happen even if you had previously disabled them for the Aqara Home App. Therefore, it is worth checking the settings periodically.

Increase Location Accuracy

This mode provides the most precise determination of your current location. It keeps the Aqara Home App permanently active in the background, significantly improving location checks.

Allow Physical Activity

Android also detects whether you are currently in motion. This motion detection (Physical Activity permission) helps the system better recognize whether you are entering or leaving the geofence.

1 Like

i have all those optimizations but it just randomly thinks i’m away and changes modes. In the morning at exactly 7:54, it arms away. Dunno way but just feels like it. Today, I leave, and away mode is armed (good) and then immediately away mode disarms. Why? I’ve initiated a return and have the end of the month to figure it out… otherwise it’s going back.

I have Smartthings and it triggers away and home mode almost perfectly. Think Aqara is just broken.

I can confirm that this isn’t an Aqara issue. I use Home Assistant, which pulls GPS data from the phone’s OS (iOS for me).

Since Home Assistant visualizes everyone’s location on a map, I can see the data drift clearly. Sometimes it shows me 3 streets away while I’m at home, or it gets stuck at my carport even after I’m already inside. This happens on all my family’s phones as well.

The only solution is to expand the geofence zone. That way, the system still considers you ā€žhomeā€œ even if the GPS places you 5 houses down the street.

I’m not using home assistant. I’m using the Aqara standalone app with the geofence 2.0 turn on.

However, location data is obtained from the smartphone’s operating system by the Aqara app and the Home Assistant app. So, it’s not the app’s fault.

In the Aqara automation settings, you can also adjust the size of the geofence area around your home.