Unifi device tracker - home, away, home and then away again

I use the Unifi device tracker with the families iphones. However, with the power mgmt features of the Iphone I am constantly seeing all devices flick between being home and away if they are not plugged into power. I do not want to use multiple trackers if I can help it, can anyone recommend the settings they use to try and mitigate this? I use

- platform: unifi
  host: 192.168.10.52
  username: <redacted>
  password: <redacted>
  consider_home: 180
  track_new_devices: no
  interval_seconds: 12
  verify_ssl: false

Thanks

strange, I have an iPhone X and iPad Pro, and due to a bug in the unifi software, they take over 10 minutes to disconnect. I have had to setup a second device tracker to be accurate. Seem’s we are having opposite problems :smiley: I presume you have the cloud controller setup that you are connecting to ?

My UniFi controller is running on a spare MacMini I have. I do not use the cloud controller.

Sorry meant, are you using the controller software. I have mine setup on my Synology NAS.

Thats the error I am having, I guess it might be worth searching on the Unifi forum, there seem’s to be a few threads about disconnects and reconnect’s.

Yes I am using their controller software. Will have a search around the UniFi forums but I firmly believe this is a iPhone problem and the way it handles power management with WiFi.

Not seeing this on my controller with the couple of guests iPhones I have on mine. I don’t believe they changed anything on the power as they wouldn’t know how, kinda why they have that type of phone in the first place. Think they are 6 and 7 models.

I have no trouble with my Droid but my wife’s iPhone X turns to ‘Away’ in home assistant a few times per day.

I work from home a lot, here is the last week of history of my iPhone X running iOS 11.4.1

histroy

As you can see it hasn’t disconnected from my wifi for the last 4 days, and these are my settings,

  - platform: unifi
    host: !secret unifi_host
    port: !secret unifi_port
    username: !secret unifi_cont_user
    password: !secret unifi_cont_password
    site_id: !secret unifi_site_id
    verify_ssl: False
    interval_seconds: 60
    consider_home: 180

Obviously when I do leave, it marks me as away, but as above, I have a bug where it isn’t instant, but thats another story.

Thanks everyone.

Are there any settings specifically on the iPhone that may affect this?

FWIW I moved away from using the HA Unifi interface and now use unifi2mqtt, which at least gives some visibility about what is going on.

1 Like

Hmm looks interesting for a bit more details on what’s going on with the controller, although, its just me in my house, so I kinda know whats going on with it anyway :smiley:

I use the unifi as a backup presence detector, and have setup two raspberry pi zero’s at each end of my house, which covers all three floors, front to back, running monitor from here,

Works really really well for me. Instantly knows when I am here or not, so can run automation’s for when I walk/drive up to the house and then run just before I get to the doors.

2 Likes

Yeah, I have 3 Pi Zero’s scattered around running monitor also. Though I’m still beta’ing them rather than using them in anger atm.

I also have a Wemos D1 running Tasmota in the car, which, when it connects to MQTT (usually on car start, or on returning home), triggers various stuff.

In case you are interested (and with apologies to the OP for the thread hijack), I was planning on doing an AppDaemon app which merges the monitor results with the Unifi presence (and maybe door sensors and zigbee presence detectors) to (hopefully) give an even more accurate and timely result of presence/absence.

That said, I’ve been too busy to make any progress on it recently, but someone else has shown an interest in doing it - Advice on app design please

2 Likes

Always had that one, just the nature of the Unifi controller itself.

There’s very cool…I’ll have to see if someone has a docker container made for it or create one for it. Universal MQTT goodness!

EDIT: I see someone has a PR for a dockerfile, it looks like the dev hasn’t messed with it much and two other people have forked things and been running with it. Love it.

Network link to the Github with the other changes:

1 Like

Oh, good spot! There are a couple of issues with it that I had raised and not got a response. I’ll try one of the others.