- Code: Select all
starting in V 7.38.346 @ 2021-03-11
==================
1. added support for unifi protect cameras
- get cameras from unifi systems and create indigo devices
- the plugin will listen to events, create dev states for start time / end time/ time length of event
get thumbnails jpegs and or heatmap jpegs
enable / disable / configure thumbnails in camera device edit
events are also setting variables:
Unifi_Camera_Event_Date date string of last event; eg "2021-03-11 22:33:26"
Unifi_Camera_with_Event device name of camera of last event; eg "Camera_Reserve-UVC G3 Flex"
Unifi_Camera_Event_pathtoThumbnail path to last event thumbnail; eg "/Users/karlwachs/indigo/protect/Camera_Reserve-UVC G3 Flex_snapshot.jpeg"
- get snap shots through menu or actions at any time, with selectable resolution
- set parameters of cameras for IR-LED, status-LED, speaker, mic, motion trigger etc in menu and actions
- added debug option for protect in config
- the dev/state "smartDetect" is blank or "vehicle" or "person" if the smart detect option is enabled to detect objects for events
==> to enable: set camera to protect in config (just above debug)
and set repeat frequencies ...
all camears connected / adopted by protect will be created in the folder unifi_created.
- Code: Select all
1. enable protect in config (bottom, above debug section)
select "protect"
set repeat query for device state checks and event tracking
sel path for thumbnails
save
then the cameras will automatically be created in device folder unifi_created
2. Then trigger on any change camera xx dev/states["eventStart"] ==> new movement at camera xx
or on variable Unifi_Camera_Event_Date
the path to the thumbnail is in dev/state "eventJpeg" and in variable "Unifi_Camera_Event_pathtoThumbnail"
eg: "/Users/youruserid/Camera_living window G3 Flex_snapshot.jpeg"
the thumbnail are only availabe at the end of teh event (dev/states["eventEnd"] is changed to !=-1)
3. Get snapshots at anytime: setup action with in unifi action "CAMERAS get Snapshot" then execute at your pleasure
or use menu/cameras/snaphot for testing or onetime pictures
4. a door bell event is indicated as eventType ="ring" instead of "motion" in dev / states
The door bell needs a special chime if used directly with the door bell (same wire)
Both devices are in series = the same currents runs through both. The doorbell has a resistance R of ~ 150 Ohm. So at 24 v the current is ~ 180mA
When pressing the button the cable to the doorbell gets shorted = R=0 and it does not get any power. It likely lives of power stored in a super capacitor ( >1Farad). That that is used up after ~ 12 seconds.
To work with the unifi door bell you need a special chime. One that stops ringing on its own in less that 12 seconds (when the door bell is still up) and shortly interrupts the power to the door bell. Then the door bell comes back to live. The special chimes are mentioned in the unifi docs.
It also has as stand alone mode where the button does not short the cable, and a direct in line chime will not work
Setup protect in config:
The following states will be created for each camera :
menu options:
thumbnails jpegs:
variables:
reporting:
- Code: Select all
uniFiAP Protect Camera devices START =============================================================================================================================
ThumbNail HeatMap Device Events----------------------------------- is Volume- ir-LED----------------- stat
DevName---------------------- MAC#------------- ip#----------- DevType--- FWV----- On-resolutn On-resolutn lastSeen----- last-motion-- lastRing----- ---#of Mode dark mic spk En Sens Mode Lvl LED
Camera_back UVC G3 F0:9F:C2:C1:BA:95 192.168.1.64 G3 4.34.22 ena-640/480 ena-320/240 3-14 11:13:35 3-14 19:58:00 8 motion Day 100 100 ena low a-Filt-Onl 0 ena
Camera_Doorbell E0:63:DA:EF:EB:7B 192.168.1.79 G4 Doorbell4.34.22 ena-640/480 dis-320/240 3-15 16:39:30 3-15 16:39:31 3-15 14:31:25 640 motion Day 100 80 dis low auto 255 ena
Camera_Family room G3 Flex FC:EC:DA:1F:12:96 192.168.1.70 G3 Flex 4.34.22 ena-640/480 ena-320/240 3-14 11:13:35 3-13 04:33:12 51 motion Nite 100 100 dis low auto 255 dis
Camera_Front top UVC G4 Pro B4:FB:E4:05:B9:E9 192.168.1.74 G4 Pro 4.34.22 ena-1024/768 ena-320/240 3-14 11:13:35 3-15 16:39:29 2971 motion Day 100 100 dis low auto 255 ena
Camera_Garage Dome F0:9F:C2:14:46:17 192.168.1.67 G3 Dome 4.34.22 ena-640/480 ena-320/240 3-14 11:13:35 3-15 15:21:13 7 motion Day 100 100 dis low auto 255 ena
Camera_hallway UVC G3 Micro F0:9F:C2:C1:96:7B 192.168.1.62 G3 Micro 4.34.22 ena-640/480 ena-320/240 3-14 11:13:35 3-15 16:37:34 220 motion Day 100 100 dis low auto 255 ena
Camera_kitchen outside UVC G3 F0:9F:C2:C1:14:CB 192.168.1.65 G3 4.34.22 ena-640/480 ena-320/240 3-14 11:13:35 3-11 14:42:51 4 motion Day 100 100 dis low a-Filt-Onl 0 ena
Camera_Kons-Window F0:9F:C2:C1:C2:FD 192.168.1.68 G3 4.34.22 ena-640/480 ena-320/240 3-14 11:13:35 0 motion Day 100 100 ena low auto 255 ena
Camera_Leo Window B4:FB:E4:7F:5B:D3 192.168.1.69 G3 4.34.22 ena-640/480 ena-320/240 3-14 11:13:35 3-14 04:43:19 5 motion Day 100 100 dis med auto 255 ena
Camera_living room G3 Flex B4:FB:E4:9E:FE:31 192.168.1.73 G3 Flex 4.34.22 ena-640/480 ena-320/240 3-14 11:13:35 3-14 18:06:33 4 motion Day 100 100 dis low auto 255 ena
Camera_living window G3 Flex FC:EC:DA:1F:15:32 192.168.1.72 G3 Flex 4.34.22 ena-640/480 ena-320/240 3-14 11:13:35 3-15 16:12:35 344 motion Day 100 100 dis low off 0 ena
Camera_Side walk west G3 Flex FC:EC:DA:1F:15:5C 192.168.1.71 G3 Flex 4.34.22 ena-640/480 ena-320/240 3-14 11:13:35 3-15 16:36:53 304 motion Day 100 100 dis low off 0 ena
Camera_Study outside UVC G3 F0:9F:C2:C1:BA:F6 192.168.1.63 G3 4.34.22 ena-640/480 ena-320/240 3-14 11:13:35 3-15 15:19:03 62 motion Day 100 100 dis low auto 255 ena
Camera_UVC G3 Flex reserve 74:83:C2:3F:D3:E5 192.168.1.75 G3 Flex 4.34.22 ena-640/480 dis-320/240 3-12 09:59:11 3-12 10:00:21 5 motion Day 100 80 dis ? 0 dis
Camera_UVC G3 Instant 237D 74:AC:B9:9F:23:7D 192.168.1.76 G3 Instant 4.34.22 ena-640/480 dis-320/240 3-14 11:13:35 3-15 16:37:35 200 always Day 100 80 dis low auto 255 ena
uniFiAP Protect Camera devices END =============================================================================================================================