[PROJECT] Driver for Unifi Network Controllers

This sounds just like what @forlornlawngnome had. Has there been an update for the controller lately, and did you reboot it after that?

For child devices you also need the respective child drivers on the Hubitat for them to be useful. Including the Presence child driver for presence detection. However, the error is more that it is not even getting to that stage.

Mine never showed failure to login, or anything worrying on that page except the last time it got the presence. The logs showed request timeout for presence, stats, decices,. Basically everything except long and login :woman_shrugging:.

Looking at update times, the controller did an update roughly 10 days ago, then I updated the hubitat code and broke things on the 22nd. We then applied updates again yesterday and it worked. I do know they released a new update for unifi just yesterday after we installed one so you might have new uodates

Yes, latest Unifi update was done this morning, and controller rebooted. I just rebooted the controller again to be sure. Same response for presence

Capture

Capture

Unifi OS and associated apps (Network, Protect) are all up to date. I have loaded all of your Unifi drivers, even though I only have Controller, 2 x APs and 2 x Cameras.

I did notice that in the State Variables for my device is says "Driver Version: 0.4.19" and in the Current States it says "Driver Status: New patch 0.4.20 available". I assume that is your driver? However, when I run HPM, there are no updates available

0.4.20 is the latest and the one that HPM should be pulling (I just double-checked the Manifest file). You could try doing a direct import from the driver file itself (and check the version in the code before saving). Maybe HPM needs a refresh itself?

0.4.20 did make changes to Presence checking, so I highly recommend checking that you have that, and the updated UnifiChild-Presence driver.

As a side note, you should not need ALL the child drivers by any means, but they cannot hurt things.

1 Like

Thanks @snell I'm definitely making progress!

After some digging in the drivers, I realised that I had somehow ended up with two copies of UnifiNetworkAPI, one at 0.4.19 and one at 0.4.20 and when I tried to delete the 0.4.19 it would not let me as it was in use by my device. That would explain the discrepancy in the driver my device reported, and there being no update in HPM, as I had both versions.

In the end, I deleted my device and both versions of the driver. I used HPM repair to repair the package and then recreated my device. Within seconds it had created a few child devices which it obviously pulled from my controller

Capture

I also checked the presence function, and that also works now

Capture

I was also able to create a virtual device using UnifiProtectAPI and it then created two child devices for my G3 Instant cameras!

So thanks for all your help so far! I'm sure I'll have more questions :+1:

1 Like

First and foremost, your UDM Pro SE was not detected properly by my driver and not given a child driver (see how it is labeled as Generic) because I have not seen one before and have no data to recognize it. If you would be willing, I would love a Trace log for when you run a "Refresh Unifi Devices Basic". That would give me the model information I can then use to start supporting it. Or you can just tell me directly about it... For example, my UDMP has a model value of "UDMPRO". I EXPECT the SE to be something like "UDMPROSE" or "UDMSE" but have no way of knowing. Once I get that I can build it into the parent driver AND create a child driver (based on the UDMP one, but also handling the PoE ports hopefully).

I have a separate topic for Unifi Protect... but I definitely have not put as much effort into it lately as I have for the Unifi Network driver. So when you have requests/recommendations for that one there, let me know.

1 Like

@keithandrewowen You should delete that post and PM it to snell directly.

1 Like

Will do :+1:

I should have given the why part. The logs have a raw dump of all your clients and network info. My recommendation was more to help protect your network info.

1 Like

I probably should have have been more specific. I mentioned the basic because the most people could see is your list of Unifi devices and their MAC addresses.

But all I REALLY need is that model info, you do not even need to send me a whole log.

No problem! Its late here, so I'll do it tomorrow :+1:

Hi @snell , thanks for the PM. As you said, it is UDMPROSE

The other issue I have at the moment is with the G3 Instant cameras. Child devices were created correctly, but the devices don't seem to recognise any motion events, even though the Controller does send me notifications are records correctly. I was hoping to use the G3s as motion detectors

For the Protect-related stuff we can discuss it further in the Protect Driver's topic, just to keep them separate. Long story short, I have a G3 Instant (my only Unifi camera) and it is working for motion detection using the Protect driver and WebSockets, so we can look into it more in that topic.

1 Like

Updated Version(s):

  • UnifiNetworkAPI.groovy = 0.4.21
  • UnifiNetworkChild-UDMPSE.groovy = 0.1.0 (NEW, added to list in initial posting)

Change(s):

  • Support added for Unifi Dream Machine Pro SE. Minor changes to the parent driver to add support for it only. Obviously the child driver is new and should support controlling the PoE ports (1-8) on the UDMPSE in addition to the "normal" UDMP capabilities and data.

I've applied the new version and my UDM Pro SE is now recognised as such in the child devices. However, the parent device is still utilising 0.4.20 version. How do I force it to use 0.4.21?

The Driver Version event (and state) will update if you Save Preferences. It will also be corrected within 24 hours automatically, the next time the parent performs the CheckForUpdate (it is scheduled to run daily).

Since your UDMPSE is now recognized and added as a child properly, then you have the 0.4.21 so you should not need to worry about it (let the automatic one happen).

1 Like

As you said :+1:

Capture

Sorry for all the questions, but I'm keen to get this fully working!

I notice that there is no info on the port usage. All of the ports report like this

In fact, Port 01 is in use with PoE, Port 08 is in use without PoE and Port 09 is WAN. The rest are currently not in use

That is the default values when they get generated. They SHOULD refresh at some point once the API provides information, although (depending on commands) it will often not provide ALL those pieces, so you might see some things remain unknown for a bit.

Here are two examples from a couple of my switches (1st is from my 48 port PoE and 2nd from a Mini):

  • Port 27 Status : {Speed=100, Connected=true, PoE=true, Media=GE, PoE_Status=auto, PortID=27, Enabled=true, PoE_Usage=0.00}
  • Port 28 Status : {Speed=0, Connected=false, PoE=true, Media=GE, PoE_Status=auto, PortID=28, Enabled=true, PoE_Usage=0.00}
  • Port 43 Status : {Speed=1000, Connected=true, PoE=true, Media=GE, PoE_Status=auto, PortID=43, Enabled=true, PoE_Usage=3.10}
  • Port 50 Status : {Speed=10000, Connected=false, PoE=false, Media=SFP+, PoE_Status=NA, PortID=50, Enabled=true, PoE_Usage=NA}
    AND:
  • Port 05 Status : {Speed=1000, Connected=true, PoE=false, Media=GE, PoE_Status=NA, PortID=05, Enabled=true, PoE_Usage=NA}
  • Port 04 Status : {Speed=0, Connected=false, PoE=false, Media=GE, PoE_Status=NA, PortID=04, Enabled=true, PoE_Usage=NA}

And indeed, I am too impatient! I suspect Port 08 will also refresh soon :joy:

  • Port 01 Status : {Speed=1000, Connected=true, PoE=true, Media=GE, PoE_Status=auto, PortID=01, Enabled=true, PoE_Usage=4.40}
  • Port 08 Status : {Speed=null, Connected=false, PoE=false, Media=null, PoE_Status=NA, PortID=08, Enabled=false, PoE_Usage=NA}
  • Port 09 Status : {Speed=1000, Connected=true, PoE=false, Media=2.5GE, PoE_Status=NA, PortID=09, Enabled=true, PoE_Usage=NA}
1 Like