Unable to connect to UniFi controller 5.10.25 using HA 0.95.x

@Robban - Looks to be working very well now. I am convinced.

One problem I have noticed though - when a restart (or start) of HA occurs, all tracked devices which were marked as home before the restart are initially marked as away after the restart. Within a couple of seconds, they are then marked as home.

I found this one out the hard way - some of my automations triggered after a HA restart at 3am (part of a regular HA restart to work around some Broadlink switch issues). They turned a heap of lights on, and then about 3-5 seconds later turned them off again. There are corresponding entries in the logbook directly after the ā€œHome Assistant startedā€ message that show the device trackers are marked away, and marked home.

Thanks!

I will look into that!

There is a generic fix for loading platforms that might manage the issue without requiring the config entry to be created.

I will make sure to have this fixed for next major hass release.

1 Like

Thanks for all your help. It is appreciated.

Hate to jump onto this topic, but Iā€™m having the same issue myself. I have the controller setup in integrations and it has no trouble connecting from there, but the connection string inside the configuration.yaml file doesnā€™t seem to want to work at allā€¦

No information is being provided in the error message.

My PR to fully include device tracker into unifi component is now complete. In release 0.97 of hass this issue will hopefully be gone

1 Like

got a link to the PR?

1 Like

Hi there

Iā€™m on Controller 5.10.26.0 @ Docker and Hass.io 0.97.2 and still get occasionally
ā€œUnable to reach controller [FQDN]ā€
Also, the original device_tracker had options for

new_device_defaults:
      track_new_devices: true
      hide_if_away: false
interval_seconds: 30
consider_home: 180

which is, as far as I can see, gone after the breaking change. Any thoughts?

Iā€™m running the latest controller and have no issues.

Which one of the parameters are you interested in?

well, all of them. Some Android Devices tend to go to a ā€œsleepā€ mode for some minutes. Thus the consider_home.
My basic config from the docs:

unifi:
  controllers:
    - host: <fqdn>
      site: <site>
      ssid_filter:
        - '<ssid>'

That would be detection time?

Seems to work, but where is that documented? I want to avoid those stupid questions

Itā€™s documented on UniFi integration page

detection_time

(integer)(Optional)

How long since the last seen time before the device is marked away, specified in seconds.

Default value:

300

1 Like

@Robban
Good work on the PR!

But how and where can I set

new_device_defaults:
      track_new_devices: false

When I configure the integrations with Unifi it adds all my network devices, and this causes problems further down, for example with my database that logs state changes.

The first PR was backend implementation. There is a new PR that will solve configuration unifi

Ok, so there are currently no current way to avoid all network devices to be added with the newest release of HA?

Since it requires backend and frontend changes it will be a part of next major Hass release

Just so I am sure I understand.
That PR with the backend implementation is in the current release, but the PR that will contain the frontend is in another release that wonā€™t be include until version 0.98?

0.98 will have all the necessary things in place. It is not possible to solve it before

2 Likes