nymea / nymea-plugins

A collection of plugins for the nymea IoT server.
GNU Lesser General Public License v3.0
22 stars 25 forks source link

Unifi plugin - make port optional depending on type of conroller (443 or 8443) #726

Closed plasmediaX closed 7 months ago

plasmediaX commented 8 months ago

In nymea you can use the UniFi plugin to create a controller thing. The plugin always uses port 8443, which seems hardcoded in nymea-plugins/unifi /integrationpluginunifi.cpp (line 346).

Ubiquiti / UniFi itself distinguishes between two different kind of controllers for a while now. https://help.ui.com/hc/en-us/articles/218506997-UniFi-Network-Required-Ports-Reference

  1. controllers running on a UniFi console using port 443
  2. controllers running on a Windows / macOS / Linux machine using port 8443

With the current plugin, only the 2nd kind of controller can be used. To be able to use controllers running on a UniFi console as well, it would therefore be necessary to make the the port optional so that users can choose between ports 443 and 8443 when setting up the controller thing, dependig on what kind of controller they use. Another option could be to keep the old plugin as it is - maybe rename it UniFi network controller plugin - and to create a second UniFi plugin for controllers running on UniFi consoles with port 443. Thanks.