[PROJECT] Driver for Unifi Protect Controllers

Ha! No worries there, I did not even realize it and I created the drivers and threads.
:crazy_face:

I have been trying to get hold of a UP-Sense to see how it works out and get samples of the data it provides, but it has been "sold out" for so long now I am pretty much ready to give up. But before I call it a complete wash I thought I would ask here if anyone has one and would be willing to provide a couple samples of the data it provides so that I can incorporate it into the driver.

Wow, serendipity! I just yesterday received two of the Unifi Smart Sensors that I plan to install in my garage, and I came here to check if you supported it yet!

What can I help with?

I will shoot you a separate message about it, thanks!

I just installed this a few days ago mostly to use for presence. Any best practice ideas to keep hub load to a minimum? I did install the AP and presence child devices but have the AP device set to not refresh automatically.

This probably belongs over in my Unifi Network thread, since I see you mention about the Presence child (which the Unifi Protect does not have).

I will try to copy/answer this over there.

Updated Version(s):

  • UnifiProtectAPI.groovy = 0.2.20
  • UnifiProtectChild-Sensor.groovy = 0.1.0

Change(s):

  • Initial support for the UP-Sense sensors has been added to the parent driver and an associated child device driver has been created.

Adding descriptionText logging of infrequent events such as doorbell press (not motion) would be helpful.

Popping that as an info item is possible, although I usually do not do too much info logging (easier for people to just check events). Looking at the child device though I think I can make a couple improvements. I should have these done tonight.

Updated Version(s):

  • UnifiProtectChild-Doorbell.groovy = 0.1.6

Change(s):

  • Added "pushableButton" capability for better integration into Hubitat. This also added the push command so someone can manually select it within the device page. It will not TRIGGER the doorbell, just the Hubitat side of things.
  • Improvements to the button press handling and max number of button presses. You WILL need to Save Preferences on the child device to make sure this is applied properly.
  • Minor change to the ProcessEvent command to allow it to have events FORCE an "isStateChanged" notice... Useful for the push command specifically because it will always be button 1 so normally that would not trigger a change.
  • Added info logging for when the button is pressed. The child device defaults to having the Info logging level and you need to Save Preferences anyways due to the other changes so you can always make sure the logging level is as-desired. It is always possible to turn off the logging with the "None" level.

Note(s):

  • No changes were needed in the UnifiProtectAPI.groovy parent driver. Everything was handled at the child driver level.

Any way to get this to work with the UNVR?

It should be possible for it to be recognized although I am not sure what additional functions would be available. I would have thought it would get added in as a child device with the UnifiProtectChild driver right now (I have not made a specific child driver for NVR devices because of the limited functions presented in the Protect API for them).

Is it not showing up?

If not, or if you want me to better recognize it in general, you can message me with a Trace log recording from when you do a GetProtectInfo command. That data would let me look over the devices reported and see where/how it got assigned. My UDMP gets tossed into the NVR category by the Protect API so it might be interesting to see if it gets any relevant differences. Of course if you do message me with the log (do not post it here) you can feel free to edit out any information you do not want me to see.

pinged you. It dosen't appear to be able to login to the NVR at all.

Ah. That is something different. This driver connects to the Unifi console (UDM, Cloud Key, PC, whatever) that is running the Unifi Protect app. It does not connect to the devices themselves, but through the API that Protect has.

I have a virtualized controller for manageing my AP's but as far as I am aware it dosen't talk to protect. Also haven't heard of a 'protect' app for PC since unifi video was discontinuted.

Hmm... I do not know enough about them to know the capability of a virtualized controller.

Sorry if I am going to seem dumb, but I want to try to understand how it all works better.

How do you access your cameras?

I dont think it would be nessasary here anyways since the two systems don't talk to each-other.
To access my cameras I would go to https://hostname/protect/dashboard for local access or via unifi.ui.com

@snell: Would you possibly be able to add PowerCycle PoE for individual ports to the USW Flex like exists for the other USW PoE swithes? Your driver is recognizing mine as a USF5P, which I think is correct, but the functionality isn't there .

image

Edit: It was easy enough for me to just copy the code from the 48 port driver, so I don't need you to do this for me, but it is still something that you might want to add to all PoE distribution switches.

I think this is meant over in the Unifi Network project... :slight_smile: but I can certainly do it. Sometimes I remember to do this stuff when adding in new devices (I actually have one myself) and sometimes I totally forget about it. Thanks for pointing it out! Obviously it would only be for ports 2-5 because we would not want it trying to do it to itself (not that I am sure the API would allow it) since who knows what would happen.

Changes done. I will post about the change in the main project thread.

1 Like

Yeah, sorry, I admit that I stopped reading at 'Unifi' in the title.

1 Like