Unifi presence detection not working in 0.94?

With the presence detection changes in 0.94, I notice its not working any more, any one else have this working?

  - platform: unifi
host: unifi.mydomain.com
port: 9443
verify_ssl: false
username: !secret unifi_user
password: !secret unifi_pass
detection_time: 120
consider_home: 60
ssid_filter:
  - 'gaul'
  - 'gaul-hw'

and I have logging enabled.

homeassistant.components.unifi: debug
homeassistant.components.switch.unifi: debug

I deleted the old know_devices.yaml (renamed), but notice it doesn’t create any new devices, has the unifi component been updated for 0.94?

Also I see nothing in the logs other than

2019-06-19 08:09:17 INFO (SyncWorker_21) [homeassistant.loader] Loaded **unifi** from homeassistant.components. **unifi**
2019-06-19 08:09:17 INFO (MainThread) [homeassistant.setup] Setting up **unifi**
2019-06-19 08:09:17 INFO (MainThread) [homeassistant.setup] Setup of domain **unifi** took 0.0 seconds.

My unifi tracking continues to work without issue on 0.94.3 (upgraded from 0.93.2):

device_tracker:
   - platform: unifi
     host: 192.168.x.x
     port: 8443
     username: !secret unifi_usr
     password: !secret unifi_pwd
     detection_time: 120
     verify_ssl: False
     interval_seconds: 60
     consider_home: 120
     new_device_defaults:
         track_new_devices: False
         hide_if_away: True

Are you using a non-standard port in your configuration (9443)?

Note that I did not delete my known_devices.yaml - only removed the Owntracks entries from it after upgrading per the release notes. Unifi was not one of the migrated device tracker platforms for the release.

I am using a non stadnard port for unifi, I can login to this

I had this problem on version 0.94 but now is working again in version 0.94.3.

no new devices are being added the known_devices.yaml… i have restored my old known_devices.yaml, but everything of state router is set to “not_home” which isn’t true.

also i changed the password in the config to make sure it fact working, changing the password showed the error logging in… so think this quite broken.

@oriolism can you confirm that you have stuff that is both marked as “home” and “not_home” when you filter the states by type “router”

Works for me and I used all versions of 0.94 from beta 0 to the current beta.

Yes, my iPhone is marked as not_home by the router and at Work by gps. Also my iPad is marked as home which is true. I had issues to load HA ui on version 0.94 and i ended deleting core.device_registry, core.entity_registry and core.restore_state to fix that problem but im not sure if that also fix the unifi problem.

I’d be willing to bet that your entity_id’s all changed. Look in your states page at your devices and see if you have new set of devices with other names.

Nevermind. Just read that it’s not creating new devices for you.

Have you tried stripping your config back to the bare miminum?

  - platform: unifi
    host: !secret unifi_host
    username: !secret unifi_username
    password: !secret unifi_password
    verify_ssl: False
1 Like

Yes that worked! I can see my devices now… not sure what is causing the issue maybe ssid_filter…

Well, you could slowly add items back in until it doesn’t work. Might take a few minutes but then you could narrow down the issue. Then decide if it’s a bug or not.

what is interesting is that if i add

“detection_time: 120”

Then the state for the device is missing the
“scanner: UnifiScanner” tag

So looks like its detection time that is buggering this up… can anyone else confirm this?

device_tracker:
   - platform: unifi
     host: 192.168.x.y
     port: xxxx
     username: !secret unifi_usr
     password: !secret unifi_pwd
     detection_time: 120
     verify_ssl: False
     interval_seconds: 60
     consider_home: 120
     new_device_defaults:     
         track_new_devices: False
         hide_if_away: True  

Detection time causes no issues for me on 0.94.3 with controller 5.10.25

source_type: router
latitude: <redacted>
longitude: <redacted>
gps_accuracy: 0
scanner: UnifiScanner
friendly_name: Blink XT Sync module
icon: mdi:cctv