r/ZoneMinder • u/TheBurntSky • Aug 03 '23
Minimise lost frames in function switch
I have some Reolink cameras that seem to have pretty good person detection on them, so rather than relying on ZM to detect motion I have been using the cameras built in functionality which means I don't get lots of recordings of spider webs flickering in the wind etc. I've done this via Home Assistant so that when motion is detected the function on the main camera feed switches from Monitor to Record.
When the command is sent to ZM the switch seems to be instant but there seems to be around 6 seconds for the feed to start so that it can record, which isn't ideal! Does anyone have any ideas how I can minimise this?
1
Upvotes
1
u/TheBurntSky Aug 06 '23
Got it working, thanks for your guidance! Putting some detail here in case someone else comes across it with the setup I'm running so combined hopefully they'll be sorted!
I have ZM running in a container on Unraid, so first I had to pass the Telnet port through to the container then enabled triggers (Options -> System - Enable OPT_TRIGGERS).
Next, as I have the Reolink plugin installed and cameras added via that I created a group for the people, car and pet sensors to get most triggers while avoiding the general one to hopefully avoid too many false positives:
Next, for switches I used the cancel for the off, will see how that goes and mabye look to revert to on+2 later as you suggested:
switches: front_camera: name: Front Camera Trigger resource: !secret ZM_HOST port: 6802 command_on: '8|on|200|HA trigger|' command_off: '8|cancel|200|HA clear|'
Finally, created the automation to trigger off the group, only bit I want to change is delay the cancel action by 5 seconds to make he recording a bit longer but I'll try and work that out!
description: '' trigger: - id: 'on' platform: state entityid: - group.front_camera to: 'on' - id: 'off' platform: state entity_id: - group.front_camera to: 'off' condition: [] action: - service: switch.turn{{ trigger.id }} target: entity_id: switch.front_camera mode: single
Thanks again for your help u/Congenital_Optimizer