[PROJECT] Driver for Unifi Protect Controllers

HI,

The new drivers are looking good...I don't have the messages in the log file anymore, and everything is working as it should.

Thanks so much for your assistance.

Updated Version(s):

  • UnifiProtectAPI.groovy = 0.2.52
  • UnifiProtectChild.groovy = 0.1.13
  • UnifiProtectChild-Light.groovy = 0.1.8
  • UnifiProtectChild-Camera.groovy = 0.1.13
  • UnifiProtectChild-Bridge.groovy = 0.1.6
  • UnifiProtectChild-Doorbell.groovy = 0.1.15
  • UnifiProtectChild-Sensor.groovy = 0.1.6
  • UnifiProtectChild-PTZCamera.groovy = 0.1.3

Change(s):

  • Additional attributes/events refreshRate and imageUrl (as well as the ImageUrl capability) have been added to camera child drivers (cameras, doorbells, and PTZ cameras) to better support Easy Dashboard.
  • A RefreshRate preference has been added to the camera child drivers. This allows you to specify how often you want the camera to be scheduled to take a new picture which will be saved to the Hubitat's File Manager. This defaults to "Manual" but can be configured in a number of increments from 30 seconds to every 3 hours.
  • An additional attribute/event has been added for cameras "ImageAsOf" is intended to give you an idea when the image was most recently taken and saved to the File Manager.
  • Changes to how all drivers handle event and state variable processing. However, there still seems to be some oddities with the new UI style (2.4.x) and also some strange browser caching (at least evident with Google Chrome on my computer) that impacts State Variables at times (no problems noticed with Events/Current States).
  • All child drivers now use the new "Tile" method.
  • All attributes with a space in their name should not be used by the drivers anymore (they may "linger" on devices, I did not specifically write code to remove them as the remaining ones would not be present on every device).

Note(s):

  • For those that may not have noticed yet, the images saved from the cameras to the Hubitat's File Manager are named "Camera_[CameraID]_Image.jpg". The CameraID is the ID provided by the API and can be found in the device's State Variables named "ID". The reason for this, and not using the DNI or device label, is that the File Manager cannot have spaces in file names. That limited the possibilities for a unique identifier and I did not want to spam the file manager with individual date/time files either.

Updated Version(s):

  • UnifiProtectAPI.groovy = 0.2.53

Change(s):

  • Corrected a typo in the PostEventToChild function that was causing errors.