Are you looking at capturing motion detects from Protects? I was SSHing into my Cloud Key and found the log files that log all motion events. It looks quite easy to capture the motion events although the fastest way would be to load a very small script to do it.When you SSH I used root as the user name and the primary password when you setup the Cloud Key.
Here is a dump of the log file from a tail -F command. One could just take the verbose data or the detailed data. I think the verbose is much easier as it's realtime where the detailed data is not. I was using the -F flag just incase the file name changes which can happen with log files.
[CODE]tail -f /srv/unifi-protect/logs/events.cameras.log
2019-12-02T00:06:52.901Z - verbose: motion.start Living Room [18E829CF3569 @ 10.0.2.156] 1575245206817
2019-12-02T00:07:12.227Z - verbose: motion.stop Living Room [18E829CF3569 @ 10.0.2.156] 1575245239075
{ clockBestMonotonic: 58506459,
clockBestWall: 1575245218242,
clockMonotonic: 58528093,
clockWall: 1575245232075,
edgeType: 'stop',
eventId: 28,
eventType: 'motion',
levels: { '1': 50 },
motionHeatmap: 'heatmap_00000028.png',
motionSnapshot: 'motionsnap_00000028.jpg' }
2019-12-02T00:07:12.511Z - info: event saved
{ type: 'motion',
start: 1575245206817,
end: 1575245239075,
score: 50,
cameraId: '5de37069000a3903e7000405',
partitionId: null,
metadata: { objectType: null, objectCoords: null, objectConfidence: null },
id: '5de4559c03873903e7000851' }
2019-12-02T00:08:16.569Z - verbose: motion.start Living Room [18E829CF3569 @ 10.0.2.156] 1575245290476
2019-12-02T00:08:23.749Z - verbose: motion.stop Living Room [18E829CF3569 @ 10.0.2.156] 1575245310566
{ clockBestMonotonic: 58586914,
clockBestWall: 1575245298696,
clockMonotonic: 58599583,
clockWall: 1575245303566,
edgeType: 'stop',
eventId: 29,
eventType: 'motion',
levels: { '1': 84 },
motionHeatmap: 'heatmap_00000029.png',
motionSnapshot: 'motionsnap_00000029.jpg' }
2019-12-02T00:08:24.018Z - info: event saved
{ type: 'motion',
start: 1575245290476,
end: 1575245310566,
score: 84,
cameraId: '5de37069000a3903e7000405',
partitionId: null,
metadata: { objectType: null, objectCoords: null, objectConfidence: null },
id: '5de455f0023e3903e7000855' }
/CODE]
Here is a dump of the log file from a tail -F command. One could just take the verbose data or the detailed data. I think the verbose is much easier as it's realtime where the detailed data is not. I was using the -F flag just incase the file name changes which can happen with log files.
[CODE]tail -f /srv/unifi-protect/logs/events.cameras.log
2019-12-02T00:06:52.901Z - verbose: motion.start Living Room [18E829CF3569 @ 10.0.2.156] 1575245206817
2019-12-02T00:07:12.227Z - verbose: motion.stop Living Room [18E829CF3569 @ 10.0.2.156] 1575245239075
{ clockBestMonotonic: 58506459,
clockBestWall: 1575245218242,
clockMonotonic: 58528093,
clockWall: 1575245232075,
edgeType: 'stop',
eventId: 28,
eventType: 'motion',
levels: { '1': 50 },
motionHeatmap: 'heatmap_00000028.png',
motionSnapshot: 'motionsnap_00000028.jpg' }
2019-12-02T00:07:12.511Z - info: event saved
{ type: 'motion',
start: 1575245206817,
end: 1575245239075,
score: 50,
cameraId: '5de37069000a3903e7000405',
partitionId: null,
metadata: { objectType: null, objectCoords: null, objectConfidence: null },
id: '5de4559c03873903e7000851' }
2019-12-02T00:08:16.569Z - verbose: motion.start Living Room [18E829CF3569 @ 10.0.2.156] 1575245290476
2019-12-02T00:08:23.749Z - verbose: motion.stop Living Room [18E829CF3569 @ 10.0.2.156] 1575245310566
{ clockBestMonotonic: 58586914,
clockBestWall: 1575245298696,
clockMonotonic: 58599583,
clockWall: 1575245303566,
edgeType: 'stop',
eventId: 29,
eventType: 'motion',
levels: { '1': 84 },
motionHeatmap: 'heatmap_00000029.png',
motionSnapshot: 'motionsnap_00000029.jpg' }
2019-12-02T00:08:24.018Z - info: event saved
{ type: 'motion',
start: 1575245290476,
end: 1575245310566,
score: 84,
cameraId: '5de37069000a3903e7000405',
partitionId: null,
metadata: { objectType: null, objectCoords: null, objectConfidence: null },
id: '5de455f0023e3903e7000855' }
/CODE]
Comment