Dahua IPC to MQTT App

I finally got this working with instructions from these post. Thank you all for posts and support. So I have now AppDaemon and Mosquitto MQTT addon installed. I’ve then created the binary sensor and an automation to trigger the recording once the movement is detected.

I then installed “Gallery panel for images and videos” to access and to visualize the videos Dahua has recorder.

Last problem I’m facing is the delay from the actual movement and the recording starts. There is about 3 second on ”missing”. I don’t know where this delay is coming: MQTT receives the message, automation tigger or video recording starts.

What kind of delays are you having and any ideas on how to make it shorter?