"Ubiquiti Unifi direct AP" component not updating status

This component seems to work sporadically. I have devices which have been disconnected for more than 4 hrs is still showing “Home”. I checked my Unifi controller and the devices are not showing connected. Restarted HA a few times, still not updating the status. Anyone having same problem or how to solve this? My config:

- platform: unifi_direct
  host: 192.168.1.XX
  interval_seconds: 60
  consider_home: 180
    track_new_devices: False
    hide_if_away: True

If you run your controller all of the time, try using the unifi component. It connects to the controller.

If you have more than one AP then you need to use the controller component.

Thanks. That was my next option but wanted to first check with the community if this is a bug with this component or has anyone else experienced same issue/has been successful using this with some tweaks. Is the other Unifi component any more reliable? Any experience with using it?

I haven’t paid too much attention to it yet. It has seemed to work.

Just now it took 10 minutes to change to away status - so I’ll need to play with the settings when I get some time.

Hmm can you manually try to run

mca-dump | tr -d "\n" on your AP, you need to SSH in to it and then run the command. See if you see the devices mac address still in there?

Device is not in the dump. But still showing up as “Home” in HA. Same when I check the States under Dev tools.

And you aren’t seeing any errors in your logs?

no errors except for the occasional “(MainThread) [homeassistant.core] Timer got out of sync. Resetting”. I added a new device for tracking this morning and that one updated, so something is working :smile:

You don’t have any custom logging levels set do you? Really not too sure what would be causing this if you aren’t seeing any errors.

My logger config.

  default: warn
    homeassistant.components.device_tracker: info
    homeassistant.components.automation: debug
    homeassistant.components.light: info
    homeassistant.components.sensor: info
    homeassistant.components.switch: info

Its now updating… What I did was connected the troubled device to another AP, waited a few mins, reconnected to this tracked AP and then disconnected. Now it seems to be working. Strange!

w1ll1am23- I can reproduce the issue. Steps:

  • With device connected to Unifi and showing as Home in HASS, shutdown HASS server
  • Disconnect device from Unifi, wait till device disappears from Client list in the Unifi controller
  • Start up HASS server
  • Waited 15 mins and device still continues to show as “Home” eventhough the device does not exist when I dump using mca-dump | tr -d “\n”. Restarting HASS does not update status either. But reconnecting device to Unifi and disconnecting will trigger the update

Interesting, I’ll take a look and see what’s going on.

Are there any updates on this issue? I just picked up a bunch of Ubiquiti gear and am having this same issue. Unifi direct AP shows me as home all the time even after several hours of being away. At the moment I’m not running the controller all the time so that’s not an option for me at this time.

Are you having this issue without shutting down Hass? I haven’t seen this problem my self, and I haven’t looked in to it I have been really busy lately.

Really the only troubleshooting that I’ve done is I had initially manually added my phone into known_devices.yaml, so I removed it and then had the unifi_direct component add it automatically after disconnecting and reconnecting my phone to the AP.

I have since put my phone on an old Netgear AP that I haven’t decommissioned yet, and it’s been on that for almost an hour. HA still shows my status as home.

I also JUST did the update to 0.69 and rebooted the whole system afterwards. HA still shows me as home even with my phone not connected to the AP at all. Controller shows no devices connected to AP.

I will try to recreate this some time this week and see what I figure out.

Let me know if there is some way I can help troubleshoot anything. I’ve never gotten any kind of device tracker to work reliably and I was hoping to finally get it with Unifi.

So this appears to be a bug with Home Assistant not the unifi component. You will see this same issue on all router based trackers. I am looking in to it but it gets in to the core HA stuff and I am not too familiar with it.

Well thanks for looking into it. I think I got the Unifi device tracker working reliably with the Unifi Controller, so at least I’ve got that.

Can anyone confirm - is it possible to run the Unifi component if you’re hosting the controller on your Hass install as an add-on?