leiweibau / Pi.Alert

Scan the devices connected to your WIFI / LAN and alert you the connection of unknown devices. It also warns if a "always connected" device disconnects. In addition, it is possible to check web services for availability. For this purpose HTTP status codes and the response time of the service are evaluated.
https://leiweibau.net
GNU General Public License v3.0
342 stars 25 forks source link

Unifi Scan Method Not Connecting #253

Closed bam7 closed 5 months ago

bam7 commented 5 months ago

Any thoughts on why I can't connect to my Unifi cloudkey controller no matter what settings I use for UNIFI_API? I am using a verified read-only user that can login to the local Unifi Cloud key with the same credentials defined in the config. There really isn't a lot to the config, so there isn't much chance I'm missing something.

All I see in the log is: UniFi Method... Could not connect to UniFi Controller

If it matters, I'm using a Cloudkey Gen2 with UniFi OS 3.2.10, network version 8.0.28.

leiweibau commented 5 months ago

When connecting to a UniFi system, I use a ready-made Python library. Unfortunately, I cannot provide support for this.

If you have logged in to the UniFi Controller and open any subpage, please take a look at the URL at the top of the browser. This URL also contains the API name. After a search on the Internet, I came across the name "UDMP-unifiOS" in the case of a "Cloudkey Gen2". I also came across another API version/site ID that was previously missing from my documentation:

v4 v5 unifiOS UDMP-unifiOS default

As I don't have a UniFi myself, unfortunately I can't really help you more extensively.

bam7 commented 5 months ago

Thanks for the response and good info. I do not see the API name in the URL of any page of the Cloudkey controller, it appears that that might only be the case for the older Unifi devices. However, I was able to use UDMP-UnifiOS in the PiAlert config and did get a connection after restarting the service. I am still not detecting all network devices but it's a start. I will keep working on it. Thanks for the help.

leiweibau commented 5 months ago

Main question answered