Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use SynoAI as a trigger for recording #102

Open
pinomat81 opened this issue Feb 8, 2022 · 5 comments
Open

Use SynoAI as a trigger for recording #102

pinomat81 opened this issue Feb 8, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@pinomat81
Copy link

Hello djdd87,

I had a look to my problems about launching recording using the SSS integrated cache recording.

The SSS API allows to start (and stop) to record (and use the cache) by using the webhook :
GET /webapi/entry.cgi?api=SYNO.SurveillanceStation.ExternalRecording&method=Record&version=1&cameraId=x&action=start
But it needs to be authenticated and it needs two webhooks (one for start/another for stop) !

I would like to use SynoAI to automatically stops if no motion has been detected during the x seconds.
That would be :

  1. Motion detected
  2. Start recording for x seconds
  3. While x seconds if motion is detected, add x seconds.
  4. Stop recording.

Do you thing this is doable ?

Thank you

@djdd87
Copy link
Owner

djdd87 commented Feb 8, 2022

Possibly, the code isn't really designed at the moment to detect when motion isn't detected though.

@djdd87 djdd87 added the enhancement New feature or request label Feb 8, 2022
@pinomat81
Copy link
Author

That's why a propose a timer so no detection is needed.

@ghost
Copy link

ghost commented Feb 8, 2022

Hi pinomat81

You can set the action rule in SSS to interruptible and tell it to stop recording after x seconds.

If you trigger the webhook once, it'll start recoding and stop after x seconds.

But if you trigger the webhook multiple times during the x seconds, it effectively 'restarts' the action rule, adding another x seconds to the recording.

So if SynoAI triggers for each motion detected, if it's within x seconds you should have a constant recording for the entire motion duration.

Only thing I'm sure sure of is if SSS splits the recoding/timeline into a file for each action rule trigger. You could always set the delay on success in SynoAI to a few seconds less than the action rule so it doesn't trigger so frequently.

Maybe give this a try and see if it works for you?

@djdd87
Copy link
Owner

djdd87 commented Feb 8, 2022

I will when I have time.

@pinomat81
Copy link
Author

Hey @p-u-a ,

Thank you for your answer.

I tried using an interruptible rule (if I understood correctly what you proposed) but I still get almost a perfect constant clip duration . The action rule can trigger every 15s and it records for 20s. It seems that the action rule continue recording and waits that the rule stops then restart a new record. That's annoying...
Important thing is that it seems that cache recording is used for external event rule (that's a good news), because you can see that clip duration is more than 20s certainly because I have 10s cache before the event and 5s after ;)

Capture_Object_Detected
Recorded_Clips
Rule_History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants