UniFi intergration, why some clients are not showing up as entities

Just enabled the UniFi integration for a Dream Machine. For some reason, my phone will not show up in the entities but is in the client’s list.

Client List showing Pauls Phone

Here are the only ones I see in the integration list.
This is a complete list.

This may need a sperate thread …
What attribute that says “I am here”?
Maybe a different way of asking, is the “state” the only place you see the home? If so, they are all showing home, is that becuase I am not home that mine is not showing up?

Once it has seen your device, it should add it to the list of entities. The state is home/not_home. If you aren’t home it should still show ‘not_home’, but if you weren’t connected at home when you enabled it, it won’t show up.

If you haven’t done any changes to default config of the integration the phone should show up automatically when visible to the UniFi Controller

So does it have to connect once after the integration? BTW I used the GUI to configure HA UniFi integration. I was at work and remoted into the HA. So what I am hearing, when I get home it will show up with a state of ‘home’. Then when I leave they the state will be ‘away’ Does this sound right?

Sounds about right

yes.

yes. home/not_home

1 Like

Sounds good, will double-check tonight.
I wonder if the UniFi controller treats clients the same as HA does entities. The only reason I am showing up now because the controller remembers me. That is why HA did not see me when it polled the controller. In fact, saying it out loud now makes sense. That is why you can tell the controller to “forget” a client.

@flamingm0e, your response popped up as I was typing. Thank for the correction, I would have messed that one up. :slight_smile:

I just got a (UDM) UNIFI Dream Machine
I previously used a UNIFI controller
The integration always worked before
to ensure smooth transition, I removed the integration, then rebooted
I verified all the entities were gone fromt he registry
re-setup the integration with the new ip and credentials
it appears to works and can see all the devices
BUT…
within about 1-2 hours it starts throwing an error for every device and the log file balloons very quickly and eventually HASS is unreachable.
I run HASS in a docker container on synology
when this happens a system process starts consuming insane amounts of CPU
deleting the integration resolves the issue immediatly

I reconnected the old router and controller
the issue does not occur

repeating with UDM
the issue starts all over again

any ideas??
it sounds like the controller is rejecting the connection after a while?

@penright
are you seeing these issues?

Just got a UDM Pro here… I can’t seem to get Unifi integration to work. Was there anything special to setup with UDM?

The UDM pro was released a few weeks ago. Probably the integration doesn’t support it (yet).

Yes, I wasn’t sure if someone had gotten a head start. I didnt think about the fact the controller softrware would be different enough in the UDM for the integration to not be compatible.
Thanks!

this is already being worked on and a pr was created

The PR is to track progression, but I need support verifying everything. Which I can’t do myself

what can i do to help?

how do i go about testing this?

Contribute here https://github.com/Kane610/aiounifi/issues/13

@Robban

EDIT

i have downloaded all the files from the udm_support branch
i uploaded them to the container and replaced the files in the components folder
/usr/src/homeassistant/homeassistant/components/unifi

i can no longer select the unifi integration to add it
when i click it, it puts me back in the list of available integrations
other integrations are ok
restoring the folder contents lets me select it again however its the old files so i cant test it

I’m away until tomorrow. I’ll get back to you then

ok thanks

just let me know
i might need to be steered in the right direction but ill try anything you want me to

i know you are not back until tommorow but wanted to update my findings
after digging through the error logs
i realized that the file i am updating is not in the components
/usr/src/homeassistant/homeassistant/components/unifi

but actually in site-packages
/usr/local/lib/python3.7/site-packages/aiounifi

i restored the files to their original state
then replaced the controller.py in site-packages
restarted HASS
tried to add the integration
unfortunately i still have the original error

“Bad user credentials”

with below in the log file

Unknown UniFi communication error occurred
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/unifi/controller.py”, line 368, in get_controller
await controller.login()
File “/usr/local/lib/python3.7/site-packages/aiounifi/controller.py”, line 70, in login
await self.request(“post”, url, json=auth)
File “/usr/local/lib/python3.7/site-packages/aiounifi/controller.py”, line 163, in request
raise ResponseError(f"Invalid content type: {res.content_type}")
aiounifi.errors.ResponseError: Invalid content type: text/html

@Robban

just wondering if you have returned and if you have reviewed my findings
is there anything else i can verify