Unifi Device Tracker not working for either AP or WAP

I have been going over and over my configuration for the past 3 days - googling all the specifics for the Unif controller and the options for using the WAP or the AP portion and I cannot seem to figure out why it isn’t working.

What I have done:
I verified that my site_id is “default” when logging in locally
I have created a read_only user for Unifi and verified that I can log in to the system.
I have checked the log file for home assistant, and adjusted my configuration so that there are no errors - including turning up the log level
I modified the password for the home assistant Unifi users to not have special characters (I could see in the logs that that WAS an issue until I fixed it)

Potential problems I see with the setup I have:

I have 3 Unifi AP AC Pro’s - I read on this forum that the Unifi Cloud Key component will not work if you have more than one AP (Seems strange…)

I am really at kind of a loss now as I have tuned my config enough so that I no longer get errors in the logs, but it also isn’t working.

I have tested both the WAP and AP components, and alternate between the two to see if I can get them to work.

When trying WAP my config is:

Unifi system tracker

device_tracker:

  • platform: unifi
    host: <IP_ADDRESS>
    site_id: default
    username:
    password:
    verify_ssl: false
    interval_seconds: 15
    consider_home: 180
    ssid_filter:
    • ‘AAA’
    • ‘BBB’
    • ‘CCC’
      new_device_defaults:
      track_new_devices: true
      hide_if_away: false

So it appears that Unifi Direct AP tracker does not support multiple AP’s Which makes sense.

So, the only option for multiple AP’s is the Ubiquiti Unifi WAP - which leverages the Cloud Key.

I got the AP’s working, but since I can only use one at a time, (the others won’t load due to the configuration parameters) - I have to get the Cloud Key talking to Home Assistant.

So, I have confirmed that the Unifi Direct AP module works - but only if you have one AP.

The Ubiquiti Unifi WAP component appears to be broken, at least when using Home Assistant version 0.86.4 and Unifi 5.9.29.1 (latest stable as of this writing)

I tested the nmap device tracker, and it worked immediately, as did the icloud component (after I figured out how to add Two Factor to it - hint: “unused entities” on the upper right in the GUI).

Has anyone verified this to work normally?

I’m using the unifi for device tracking. “Works for me” – which isn’t terribly helpful, sorry…

I don’t happen to be using a cloudkey; I have the UniFi software stack running in a docker container, rather than the dedicated cloudkey Linux system. That container runs on the same host as the Home Assistant container (and all of the other random things…) thus the loopback address below.

Just for reference, my configuration looks like this:

device_tracker:
  - platform: unifi
    username: !secret unifi_user
    password: !secret unifi_password
    host: !secret unifi_host
    site_id: !secret unifi_siteid
    verify_ssl: false
    interval_seconds: 30
    consider_home: 140
    track_new_devices: False

And the relevant stuff in my secrets.yaml file looks like:

unifi_host: 127.0.0.1
unifi_user: hass
unifi_password: souper-sekrit-pASSwerd-goes-here
unifi_siteid: default

So like you, I did create a dedicated “hass” user, and I’m also using the default siteid as well. I checked the “hass” user that I created, and it’s also set with a Read Only role, and none of the 4 checkboxes are checked (Enable alert emails, Allow devices adoption, Allow devices restart, Allow read only access to all sites). I do have an email address configured for it, have no idea if that matters… I’m running version 5.7.23 of the UniFi controller, probably old at this point, but I haven’t had a reason to upgrade.

Also, not sure if it matters, but my actual site name is not “default”, but something else.

I’ve never tried using the per-AP component, as the UniFi controller component worked for me out of the box.

Thanks, that has got me a lot closer - I think that the issue is that the Unifi system does not perform discovery? Once I had a fully populated known_devices.yaml - it seems to work? I commented out the nmap portion and restarted home assistant.

The strangest thing though, is that apart from the line in the logs showing:

2019-02-04 04:18:40 INFO (MainThread) [homeassistant.components.device_tracker] Setting up device_tracker.unifi

The unifi component does not log anything else.

And… after more beating on it (and disabling nmap and icloud for testing purposes) it seems to be working??

2019-02-04 04:55:04 INFO (MainThread) [homeassistant.loader] Loaded device_tracker.unifi from     homeassistant.components.device_tracker.unifi
2019-02-04 04:55:05 INFO (MainThread) [homeassistant.components.device_tracker] Setting up device_tracker.unifi
2019-02-04 04:55:05 DEBUG (SyncWorker_2) [pyunifi.controller] Controller for https://XXX.XXX.XXX.XXX:8443/
2019-02-04 04:55:05 DEBUG (SyncWorker_2) [pyunifi.controller] login() as HIDDEN_USER
2019-02-04 04:55:08 INFO (MainThread) [homeassistant.loader] Loaded unifi from homeassistant.components.unifi

I was able to find the additional details by spamming my logs like so in my configuration.yaml:

logger:
  default: debug
  logs:
    homeassistant.components.device_tracker: debug

My Unifi portion in my configuration.yaml looks like this:

device_tracker:
  - platform: unifi
    host: !secret unifi_ip_host
    username: !secret unifi_wap_user
    password: !secret unifi_wap_tracker_password
    site_id: !secret unifi_site_id
    verify_ssl: false
    interval_seconds: 15
    consider_home: 180
    track_new_devices: true
    hide_if_away: false

So, it appears to be working now, and it is one of those horribly annoying things that I have absolutely no idea why it is working now, I cannot point to any one thing getting it working, other than perhaps I needed to either manually define my known hosts or run NMAP first? I would expect the discovery from unify to work, but it seems that it does not?

Also, the URL mentioned in the documentation for site name does not match that of my controller, it may be that I am running a newer version, and the path that it is trying to grab site info from has changed, causing some issues?

The documentation references this URL:

https://127.0.0.1:8443/manage/s/ceb1m27d/dashboard

But in Unifi (with my home assistant user logged in) the URL appears like so:

https://XXX.XXX.XXX.XXX:8443/manage/site/default/dashboard

I hate it when things start working, but i have no idea why. I don’t favour black magic in my configurations! :slight_smile: