[PROJECT] Driver for Unifi Network Controllers

@snell I got a new toy over the weekend -- A PRO MAX 16 POE (USW-Pro-Max-16-PoE) switch.
It has
Model : USPM16P
if you don't already have that in your model database.
I have manually assigned the UnifiNetworkChild-USW16PoE device to it.

I also have a question. Can you describe what "default-lan-Health" means? Mine is showing "error" but I don't find anything wrong in the controller GUI.

I just got one of those myself before I went on vacation. Long enough to put it on the network and replace the 16 Lite I had with it... but not long enough to do any coding. It will be going up in a few minutes.

As for the "default-lan-health"... No real idea. For these "health" ones I purely provide whatever the API reports back for it since it SEEMS like they should be valuable.

Updated Version(s):

  • UnifiNetworkAPI.groovy = 0.4.68
  • UnifiNetworkChild-USPM16.groovy = NEW, added to list in first post
  • UnifiNetworkChild-USPM16P.groovy = NEW, added to list in first post

Change(s):

  • Support added to the parent driver for Unifi Pro Max 16 port switches (PoE and non-PoE versions).
  • Child drivers created for the Unifi Pro Max 16 port switches.

Getting back to it after a while. I am dm-ing you the exact string of macs for which I get UniFi - No valid MAC address entered to unblock.
Thanks!

Updated Version(s):

  • UnifiNetworkAPI.groovy = 0.4.69

Change(s):

  • Correction to BlockMAC and UnblockMAC functions when handling multiple MAC addresses. In the process of checking why @jbaruch was having an issue I discovered a really simple error in how I was initially checking the MAC string... it was checking both length AND if it was valid. But if there was more than one MAC in the string, it would always be invalid (the validity check should have been after it separated it for individual strings if there WERE multiple). This should now be fixed and tested fine when I threw multiple samples at it.
  • Additional data handling was added (this had already been done and was waiting for more changes to justify publishing).
1 Like

I snagged one of the new Flex 2.5GE switches -- Switch Flex Mini 2.5G - Ubiquiti Store

The model shown is USWED35 @snell for your next updated driver....

Sure, I think it should be pretty reasonable to add once I am back home (off for a trip until Sunday).

Turns out I was able to VPN into my network and readily perform the edits. Update to be posted momentarily...

1 Like

Updated Version(s):

  • UnifiNetworkAPI.groovy = 0.4.70

Change(s):

  • Added support for the Switch Flex Mini 2.5G (per @kanewolf's info). This should now be recognized and use the US5FP child driver (yes, it seems odd but there seems to be no "functional" differences requiring a separate driver).

This switch does not have POE output. It is more like the Flex-Mini with POE in, but no POE out. The Flex has POE out, the Flex-Mini and the Flex-2.5G do not. It should probably be the USMINI type rather than the 5P type. The new switch does have features that the other Flex units don't. Better VLAN, port profiles and STP. But I don't think any of those are significant to your code.

If you need a room switch, this is a great choice.

When I saw it I thought it would be a nice one to get... but it was already sold out. I will get it switched over to the mini.

Updated Version(s):

  • UnifiNetworkAPI.groovy = 0.4.71

Change(s):

  • Changed the Switch Flex Mini 2.5G child to use the USMINI child device instead of the US5FP.

That works.

2 Likes

I got a UI Notify email while at work and ordered two of them without thinking it through. They showed up, but then I realized I had nothing I can upstream them to.... I think they'll be on the shelf until I can grab a Pro MAX 16 to feed them. I wish they had an 8 port like the $129 Ultra with 2.5G and a 10Gb uplink. They do, but its pricing makes no Sense. Enterprise 8 POE for $379??? Gack.

S.

Use them as 1GE. When you get 2.5GE they will auto-negotiate. The ProMax 16 isn't too bad if you don't get the POE. I got two of the POE versions. I run my PI4s with POE to USB adapters.

I cannot seem to get any of this correct?

I have copied/pasted/ imported all the drives and turned them all to API and input name and password and I cannot see any APs/Doorbells/cameras etc. What am I doing wrong?

Few things to check:
First, what Ubiquiti controller are you using?
Second, do you have a local admin account that you are using for the username/password? It does not use ui.com ones with MFA.
Third, the only device you you need to add is a virtual device for the parent, using the main API driver. Child devices will be created automatically as they are identified (if enabled and their drivers loaded).
Last, you can check the logging. If there are actual errors being reported my drivers will always report those.

Let me know if any of that helps.

Save Preferences used to remediate the Request Timeout errors but it appears no longer:

Or maybe two presses of Save Preferences is required...

The only thing I could ever trace this back to was just too many calls happening to the Unifi controller too closely. Save Preferences will reset the times at which things are automatically queried... which is why that seems to fix this issue.

1 Like

Hi - I am trying to get this set up and having issues with what looks like an auth error. From reading above - I suspect this is due to the versionof Unifi I am using?
I have set up a local admin account etc. Screenshots below:

Errors from Logs

Version Info:

image

Any help would be appreciated

Thanks

Blair