Android - Geofence not working

Excellent points and great feedback, as always. Thank you! This is something we have observed as well, and our engineers are looking into it.

1 Like

Anecdotally, I've noticed presence works much better if I'm navigating using Google Maps. I've noticed the same thing on my wife's phone. Both Galaxy S9. That's also why I re-enabled the location permission for Facebook, even though I hardly use it anymore and Facebook definitely doesn't need to know where I am. I figure the more chance there is for my phone to check my location for any reason, the better my reporting should be. I don't know if that's how it actually works, but I thought I'd give it a try.

I have weather and call blocker apps that have a persistent notifications (one for temperature display in the status bar, and one to monitor incoming calls in real time). They both get relegated to the small "Silent notifications" section at the bottom of my notifications, so they're really not that obtrusive. The call blocker doesn't show up in the status bar unless it actually blocks a call.

Thank you for posting this, Joe. I've followed these posts and wanted to respond so many times with, "So, what is Samsung doing?". The geofence has worked great for me for three years with two Pixel 3A's and now two Pixel 6A's.

1 Like

I have noticed this too. I'm the only one in my family that is using Samsung and I'm the only one that is having an issue. I'm getting 5–10-minute delay. There was an update to the firmware addressing security that has introduced delayed, I believe. I have my setup L360, Hubitat GF, and UNIFI WiFi. Then I use combination presence application to aggregate them all. It worked very well. However, since one of the Android/Samsung updates seemed to introduce this issue recently I have been doing testing.
I have started testing the following: Values in Minutes

  1. Hubitat - 3-5+ delay
  2. WebCore - 0-5
  3. Life360 - 2-7+ delay
  4. IFTTT - 0 delay

Note: Unifi depends on the polling you have setup (static mac) Part of all the test but not measured.

I believe what is going on here (in my very limited testing) is that IFTTT is running different not as a process/service the background but more as application within the notification part on android. IFTTT does recommend doing this for android devices.

The configuration that I have right now. L360, WebCore, IFTTT and Unifi WiFi.
This seems to be working well thus far.
I plan on doing more testing, but I think this always to be chasing issues between app dev, Mobile manufactures, and OS developers.

Well, the problem is back. I had a problem with the geofence not recognizing my phone's presence. After the last update of the app on my Android phone, it worked flawlessly for a few months. Now it is back again. I have tried the following:

  • Force stopping the app and clearing cache and storage
  • Send geo event
  • Powered off/on my phone
  • Uninstalled and reinstalled the app

Nothing seems to help. I am in the middle of my geofence right now but it shows out of geofence. Any other suggestions?

Thanks

A post was split to a new topic: Geofence is not working

Not working for me either. Now this may be obvious but perhaps helpful for debugging. If you change the size of the blue circle, even the minutest amount a Geo event will be sent and will be correct.

I now use a button I press on the way out the door. After pressed it waits 5 minutes after the garage door closes and then activates Away. When I return I press the button again to cancel Away. When the Geo fence is working correctly it activates before the button rule does. So my backup process has become my primary method of setting Away.

Just a reminder, every mobile device manufacturer has its own optimization tasks running on top of native Android tasks. It is imperative to share make, model and Android version when reporting issues with the Mobile app.

Our engineers are currently reviewing OneUI (4) for Samsung devices. We have not tested the following operating systems that use Android variations: OxygenOS (OnePlus), ColorOS (Oppo) or MIUI (Xiaomi). If you are using one of these operating systems, your experience may vary.

2 Likes

FWIW - I implemented presence/geofencing in my Android dashboard.

While it's still a work in progress - the results have been getting better and better. The intent wasn't to replace the native Hubitat app but more to supplement it.. there's no reason you can't run both. That said, for my testing I've disabled the Hubitat app's geofencing so I could make sure everything is working end-to-end and so far so good.

I tried to document how to get it configured here.

2 Likes

I have two SM-G998U devices. (S21 Ultra 5G) that were working almost flawlessly prior to the middle of July. Both are Android 12, OneUI 4.1, G998USQS5CVGA baseband version (August 1, 2022).

On Both phones:
Settings -> Device Care -> Battery -> Background Usage Limits -> Put unused apps to sleep is off.
In addition I added the below to Never Sleeping Apps (They have been since I got the phone)
-Hubitat
-Google play Services

Settings -> Device Care -> Battery -> More Battery Settings -> Adaptive Battery is off

In Settings -> Device Care -> Memory under Excluded apps, I have Hubitat and Google Play Services there as well.

In Settings -> Device Care -> 3 Dot Menu - > Automation, I have Auto Optimize Daily turned off (as well as all other options on this menu)

In Settings -> Apps -> Hubitat -> Battery, it is set to unrestricted. I also have no Permissions denied, Location at always, physical activity and camera while using app.

In Settings -> Apps -> Google Play Services -> Battery, it is set to unrestricted. Location all the time and also no permissions denied.

I went through each of these settings and toggled them off then back on trying to fix it. I also force stopped the app (hubitat), cleared cache, and restarted it.

For Geofence settings on both phones,
-Send presence only in motion is off.
-Validate location on network change is on
-Delay Exit is on: 2 minutes

I also have Tasker launching Hubitat in the background whenever the phone is restarted.

I don't think it is a Hubitat APP problem, as that has not updated on either phone since January 2022 (Currently 1.6.8). Location was working fine after that update until the middle of July sometime.

Since the middle of July, both phones were lagging on updating, and I noticed that often if we open the app, it would immediately update. Other times, I had to send a geo event, or using a custom rule with a switch, just force update Arrived or Departed.

Then, I got logged out of the Hubitat app (it happens at work sometimes due to VERY poor cell coverage). When I logged back in, and re-associated my phone with the proper device in the app, MINE has been rock solid for a week again. I tried doing the same to my wife's phone, force stop, clear cache, clear data, then sign in and re-associate. I then went and set all the battery saving/memory saving settings back to the above. Hers still doesn't work, mine still does. So :man_shrugging:

I have a Tasker profile that I use location to kick on my VPN when I leave the house and turn it off when I return. I added a step to force HE to update arrived and departed using Maker API. Works great on depart. (Was able to turn that off on my phone after the above log out/log in procedure) However, it is a bit slow. So, the second workaround is that I created a switch, that when turned on runs the rule to mark the phone presence as arrived. I then made a google home routine, and put it in as a custom command on android auto. So now, if she gets in the driveway, and the garage doesn't open, all she has to do is push the button on the Android auto screen and Voila.

It was tedious to set up. But, it is an okay workaround until we can figure out what Samsung did to us in the July update.

SM-G960U (Galaxy S9)

My wife's is the same. Both also not working since the middle of July. I also logged out, cleared data and logged in and mine has been working great, but that didn't work for my wife. I did notice that mine works/works better if I'm navigating home, but again that doesn't seem to matter on my wife's phone.

Been having the same issue as others. Here's my details:

  • Mobile device: Huawei P10
  • Android Version: 9
  • Security patch level: Aug. 1, 2019
  • Mobile app version: 1.6.8. - build 128
    Notes:
    No 3rd party optimization apps
    Battery and CPU/memory optimization services are disabled for Hubitat app.

Adjusting the geofence boundary has no effect. I don't even see the radius at all.

In the debug information it is indicating I'm out of the geofence, which I'm not. The lat and long are 0 but in the events it's showing the lat and long are correct (same as hub).

Hope this gets fixed.

On Pixel 6a running 1.6.7 build 132. Pic shows how actual location is not at what app shows as the center of the geo fenced circle. What's the word on this issue?

If you believe that the two should match, and assuming that the geofence is wider than the normal GPS variance, then my assumption would be that either GPS services are turned off or are having trouble locating a good satellite positioning signal, and is possibly using cell towers to attempt a triangulation.

Well...I'll chime in to say that things are working swimmingly for me. I use HE, Life360, and Joe's Hubitat Dashboard App.

I pulled out my driveway at 18:51:47 and pulled back in at 20:54:42

Time Device Presence
2022-09-02 20:54:44.715 Phone_Ryan_HDA arrived
2022-09-02 20:54:39.243 Phone_Ryan_Life360 arrived
2022-09-02 20:54:30.421 Phone_Ryan_HE arrived
2022-09-02 18:52:07.719 Phone_Ryan_Life360 departed
2022-09-02 18:52:07.181 Phone_Ryan_HE departed
2022-09-02 18:51:55.350 Phone_Ryan_HDA departed

Pixel 6 Pro - Android 13 - build TP1A.220624.021
App version - 1.6.9 (beta)
Battery setting for all apps is "Unrestricted"
Background data is enabled for all

I use Wireguard to maintain a VPN back to the house.

1 Like

Or something broke in the version I'm running. I should have stated previously I am on the beta build so sorry for that confusion.

Everything was working fine until this last update. Hubitat app has full permissions always. Use precise location is turned on. On a pixel 3 running beta 1.6.8 build 128 location is working fine.

Now the real mystery. When I click on the about choice in the Hubitat app on the Pixel 6a it shows version 1.6.9 Build 132 which is not the same 1.6.7 I previously saw on the Pixel 6. I either misread the version and got the build correct or something else is going on.

Auto-update for apps turned on?

I have been using those three combinations of Unifi and presence combination application on the S10. It has been working well but did have to turn off some additional items. iOS does not change, and I don't need anything other than Life360 and Unifi, which, has been running for years.

Adaptive Battery Turned OFF, Enhanced Processing turned ON. Allow background (per app level) during power saving ON.. This has improved this function.

Pixel 6a does auto update but Pixel 3 itself is not always turned on. I use it for testing. Pixel 3 just updated and at least for the moment sitting still it is showing the proper location centered in the geofence area.

I feel like Hubitat should remove features they cant get to work so we can just use third party applications to insure functionality versus advertise functionality that is subpar at best. I have yet to have iOS and Android function reliably even with the countless suggestions on this forum.