sensor.unifigateway
sensor.unifigateway copied to clipboard
Sensors unavailable when HASS and UniFi run on the same node
I got Home Assistant and my UniFi controller running on the same node (in Docker) and when my node is rebooted, the UniFi sensors are always unavailable. In the logging I see the following exception:
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='192.168.1.1', port=8443): Max retries exceeded with url: /api/login (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fcec0af9c10>: Failed to establish a new connection: [Errno 111] Connection refused'))
Same issue for me... I used to use this as custom integration. Love it. Thanks very much. I've since tried to use it since it was installed via HACS. I simply un commented out the previous config, and it's failing to connect to my controller. I'm running HAS on Debian (x86_64), with the Unifi Controller in a docker on the same machine. Current Version 0.23.1. Default ports. No cert installed. I'm seeing this error in the HA logs:
Error while setting up unifigateway platform for sensor Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 169, in _new_conn conn = connection.create_connection( File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 96, in create_connection raise err File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 86, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused Here's my configuration.yaml extract:
- platform: unifigateway
username: Admin
password: !secret unifi_gw_sysmon
monitored_conditions:
-
www
-
wlan
-
lan
-
wan
-
firmware
-
I tried commenting out the host ip to see if that would help at all..
What silly mistake am I making?
Thanks in advance,
hi @ualex73 I just tried again this time specifying the IP and port (8443) on my host device and everthing came up okay..
HTTPSConnectionPool(host='192.168.1.1', port=8443):
It looks like you're trying to connect to the unifi device (i.e. router, usg udm) directly, however you have to connect to your unifi controller.
@phixion I replaced the IP I used with a dummy IP (before posting on the internet), in this case 192.168.1.1.
@phixion I replaced the IP I used with a dummy IP (before posting on the internet), in this case 192.168.1.1
oops, disregard my comment then