core
core copied to clipboard
Failed to Connect Unifi network integration
The problem
I have installed Unifi Controller as a Home Assistant Add on that is working on a RPI (https://192.168.1.65:8443/). The contrller works fine but when I try to install the Unifi network integration I always get "Failed to Connect". I'm already using a local admin to bypass multi factor authentication. I'm putting the host as 192.168.1.65 ...
Any idea on how to connect the integration ?
What version of Home Assistant Core has the issue?
core-2024.10.2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
unifi
Link to integration documentation on our website
https://www.home-assistant.io/integrations/unifi/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
024-10-14 11:47:32.582 ERROR (MainThread) [homeassistant.components.unifi] Error connecting to the UniFi Network at 192.168.1.65: Error requesting data from https://192.168.1.65:443: Cannot connect to host 192.168.1.65:443 ssl:False [Connect call failed ('192.168.1.65', 443)]
Additional information
No response
Hey there @kane610, mind taking a look at this issue as it has been labeled with an integration (unifi) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of unifi can trigger bot actions by commenting:
@home-assistant closeCloses the issue.@home-assistant rename Awesome new titleRenames the issue.@home-assistant reopenReopen the issue.@home-assistant unassign unifiRemoves the current integration label and assignees on the issue, add the integration domain after the command.@home-assistant add-label needs-more-informationAdd a label (needs-more-information, problem in dependency, problem in custom component) to the issue.@home-assistant remove-label needs-more-informationRemove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.
(message by CodeOwnersMention)
unifi documentation unifi source (message by IssueLinks)
I have the same problem with my local Unifi controller (I am not sure for how long, sorry...).
Looking at a nework capture:
- HA initiates the TCP connection
- The Unifi controller accepts the TCP connection
- HA sends its TLS Client Hello
- (in my capture there is a TCP retransmission of the Client Hello after 0.2 s)
- The Unifi controller sends a TCP reset
I had a quick look at the Unifi controller logs on its docker container but could not see any error unfortunately.
+1 on this
screengrab of the error. SSL should not be validated
+1
I had to change port to 8443.
Same issue Tried ip, host, all ports, all combinations
Super frustrating that the input field are demented forcing me to fill in the username and password every single time I try to use this integration
Same issue here. But I just updated to Home Assistant OS 13.2 from version 12.3, so a big OS update.
My other versions are: Core: 2024.5.4 Supervisor: 2024.10.3
So this issue has to do with the OS update, because my core didn't change.
ps. After updating Core to 2024.10.4 it still doesn't work, but I expected that.
screengrab of the error. SSL should not be validated
Did you try setting the port to 8443 as you stated was the correct port in your first post?
I had to use port 443 to be successful.
I had to use port 443 to be successful.
what do you mean @hs82h ? 443 is the default per the image above ...
Have the same issue here. My Unifi network built in PVE and found it need to have MFA log in Authentication now. Didn't remember I need to do that before.
Have the same issue here. My Unifi network built in PVE and found it need to have MFA log in Authentication now. Didn't remember I need to do that before.
The integration documentation is updated on how to use it with regards to accounts, have you read the documentation?
After checking the documentation and the issue here https://github.com/home-assistant/core/issues/117158 I can't find any place which has the option "Restrict to local access only" even in the legacy interface.
Have the same issue here. My Unifi network built in PVE and found it need to have MFA log in Authentication now. Didn't remember I need to do that before.
The integration documentation is updated on how to use it with regards to accounts, have you read the documentation?
After checking the documentation and the issue here https://github.com/home-assistant/core/issues/117158 I can't find any place which has the option "Restrict to local access only" even in the legacy interface.
b6mh3 you might have an old interface. what is the version ? are you using an old cloud key ?
Actually, for me switching to legacy interface was the only way to setup a local account. I am using self hosted server as a HA addon.
I don't have that local account option anymore since it's synced with ui.com. Also legacy UI on the latest unms doesn't show tha option. 2FA should be mandatory for security so this plugin needs to be updated to allow entering a code.
I don't have that local account option anymore since it's synced with ui.com. Also legacy UI on the latest unms doesn't show tha option. 2FA should be mandatory for security so this plugin needs to be updated to allow entering a code.
How are you running unifi? Self hosted or through unifi os?
How are you running unifi? Self hosted or through unifi os?
self-hosted
Follow the same proceduren as https://github.com/home-assistant/core/issues/128348#issuecomment-2469538790
I have no plans to support 2Fa tokens at the current time
Follow the same proceduren as #128348 (comment)
I have no plans to support 2Fa tokens at the current time
Like I said, the option is not available once you’re syncing with ui.com. Since you’re not planning to support it I guess that makes this integration obsolete for many people who won’t sacrifice security for the sake of an outdated plugin.
@jzielke84 - I also ran into this issue with 2FA/MFA with self-hosted, but was able to get an account to work with a local login without MFA by going to the old UI, and then toggling this to 'OFF'.
After checking the documentation and the issue here https://github.com/home-assistant/core/issues/117158 I can't find any place which has the option "Restrict to local access only" even in the legacy interface.
b6mh3 you might have an old interface. what is the version ? are you using an old cloud key ?
I run unifi network (8.0.26) on my local VM:
And no "Restrict to local access only" option in default or legacy interface.
default
legacy
Update:
I created a new admin in the legacy interface with no "Restrict to local access only" execution, and it can work now!
After checking the documentation and the issue here https://github.com/home-assistant/core/issues/117158 I can't find any place which has the option "Restrict to local access only" even in the legacy interface.
b6mh3 you might have an old interface. what is the version ? are you using an old cloud key ?
I run unifi network (8.0.26) on my local VM:
![]()
And no "Restrict to local access only" option in default or legacy interface.
default
legacy
Thank you @dimatx and @b6mh3! This has been driving me bonkers. I migrated from an USG with the controller hosted in HomeAssistant as an Addon to a Unifi Dream Machine Pro hosting the console and hadn't been able to get this integration working since.
For the UDM I had to disable Remote Access in the Console Settings as a whole. Add the admin, and auth the integration to get it working. After it was connected I was able to re-enable Remote Access.
The last comments are great, but not related to the issue. It is explaining how to create a local user in Unifi. This issues is after having a local user, I am not able to connect to unifi from home assistant ... getting the error seen here: https://github.com/home-assistant/core/issues/128348#issuecomment-2417075719
@tiagonmas I apologize if they are indeed tangential. I was getting that exact same error until I did the steps above.
The last comments are great, but not related to the issue. It is explaining how to create a local user in Unifi. This issues is after having a local user, I am not able to connect to unifi from home assistant ... getting the error seen here: https://github.com/home-assistant/core/issues/128348#issuecomment-2417075719
Your post says your Unifi is running on your RPi on 8443, but your error from HA says 443. Are you putting in 8443 in HA prompt?
The problem is related with the 2FA, when I try to login in the integration it says authentication not valid but at the same time I get a 2FA email with the code but there is no place to enter it. That means that the console requires the code, and probably sends a status of waiting for 2FA but for the integration anything different of 200 I suppose is not valid and shows the error.
I'm also unsure what to do now. Did an upgrade to 2024.11.2 and now I can't connect my unifi integration. I run a self hosted install on the HA machine, which is addressable through local network 192.168.1.200:8443 and also with a hostname on my domain.
When I try to connect from a browser in the local network to the IP address I have to do MFA, and when I connect to the external adress (which is a nginx proxy to the exact same internal IP address) I can connect "normally" w/o MFA.
Needless to say, that neither of the two ways works to get the unifi integration to connect. Connecting to the ipaddress:8443, and to external address I receive "invalid authentication". Any idea what to do?




