Page 1 of 1

Start camera recording on surveillance station by switch

Posted: Wednesday 19 August 2015 19:08
by markiemajax
Hello,

I run Domoticz on my DS214 together with my raspberry (incl. Piface ) .
On the contacts of piface I switched a contact of my alarm .
Now domoticz knows whether the alarm is activated.

What I would like is that surveillance station will start recording when the alarm is activated.
The camera I've connected a D-Link 930L .

I read about API on surveillance station , but I have no idea how I should use this in Domoticz .

Does anyone know how I should do this?

Regards,
Mark

Re: Start camera recording on surveillance station by switch

Posted: Thursday 20 August 2015 7:26
by gizmocuz
Hello Mark,

if you use the search option of the forum and enter 'synology record' you will find some ways todo it,
for example:

http://www.domoticz.com/forum/viewtopic ... ing#p21915

Re: Start camera recording on surveillance station by switch

Posted: Monday 23 November 2015 17:08
by markiemajax
I finaly got it working:

Create a dummy switch and adjust the on/off action (see attatchment).
(My dummy gets triggered when my alarm is on and there is motion.)

Add both of the scripts to /domoticz/scripts/, using winscp or some program.

Adjust the ip, port, login and pass in both the scripts. These are all inputs of the surveillance station.

Now surveillance station will start recording when the dummy switch is activated.

Re: Start camera recording on surveillance station by switch

Posted: Thursday 24 December 2015 23:47
by scatman
markiemajax wrote: Adjust the ip, port, login and pass in both the scripts. These are all inputs of the surveillance station.
Hi
Can I ask help ... I added both file to scripts and in log box I had this information:

2015-12-24 23:44:57.772 Executing script: /home/pi/domoticz/scripts/Turn_on.php
2015-12-24 23:44:57.783 Error: Error executing script command (/home/pi/domoticz/scripts/Turn_on.php). returned: 32256

I adjusted the ip, port, login and pass in both the scripts

$server = "http://192.168.178.130:9900";
$login = "admin";
$pass = "**********";

and I adjusted all important things on synology of the surveillance station.



Do you know what it's mind?

Re: Start camera recording on surveillance station by switch

Posted: Monday 22 February 2016 10:57
by JanKarel
Does anyone have experience with setting up something similar as Mark developed for a QNAP NAS?

JanKarel

Re: Start camera recording on surveillance station by switch

Posted: Friday 18 March 2016 15:17
by bbluff
HI to all,
I'am Noob about lua scripting and I would like to ask how to manage this:

I have a Synology NAS with Surveillance station and I can get on/off the SStation works with a SSH command / Tasker on my android phone, but now I would like to integrate that within a Domoticz dummy switch...

I run domoticz on Raspi, and I can't get the right lua code to access via SSH on Synology and launch the command I used to switch the surveillance...

Here the command SSH Surveillance ON:
/var/packages/SurveillanceStation/target/scripts/S82surveillance.sh start

and the OFF:
/var/packages/SurveillanceStation/target/scripts/S82surveillance.sh stop

please let me know

Inviato dal mio SM-G906K utilizzando Tapatalk

Re: RE: Re: Start camera recording on surveillance station by switch

Posted: Monday 21 March 2016 13:16
by bbluff
markiemajax wrote:I finaly got it working:

Create a dummy switch and adjust the on/off action (see attatchment).
(My dummy gets triggered when my alarm is on and there is motion.)

Add both of the scripts to /domoticz/scripts/, using winscp or some program.

Adjust the ip, port, login and pass in both the scripts. These are all inputs of the surveillance station.

Now surveillance station will start recording when the dummy switch is activated.
I changed the parameters and password but still get error:

Error: Error executing script command (/home/pi/domoticz/scripts/Turn_on.php). returned: 32512

I also put 777 on the two php but without success
Please help me

Inviato dal mio SM-G906K utilizzando Tapatalk

Re: Start camera recording on surveillance station by switch

Posted: Friday 22 December 2017 13:08
by mikkel75
bbluff wrote: Friday 18 March 2016 15:17 HI to all,
I'am Noob about lua scripting and I would like to ask how to manage this:

I have a Synology NAS with Surveillance station and I can get on/off the SStation works with a SSH command / Tasker on my android phone, but now I would like to integrate that within a Domoticz dummy switch...

I run domoticz on Raspi, and I can't get the right lua code to access via SSH on Synology and launch the command I used to switch the surveillance...

Here the command SSH Surveillance ON:
/var/packages/SurveillanceStation/target/scripts/S82surveillance.sh start

and the OFF:
/var/packages/SurveillanceStation/target/scripts/S82surveillance.sh stop

please let me know

Inviato dal mio SM-G906K utilizzando Tapatalk
Did you find a solution to this? I'm also looking for a way to start recording based on Domoticz alarm switch..

Thanks

Re: Start camera recording on surveillance station by switch

Posted: Wednesday 25 April 2018 21:43
by wopper125
I ran into the same error 32512. what finally solved it for me was the following
follow markiemajax post but do not just add the files to the domoticz/scripts folder.
  • in the folder domoticz/scripts: create two new php script files (ie. Turn_on.php and Turn_off.php) and paste the contents from php script files from the downloaded zip file. Note : so do not copy and paste the files themselves but instead copy and paste its contents!
  • change the server, login and password
  • make the php files excutable with

    Code: Select all

    sudo chmod +x Turn_on.php 
    sudo chmod +x Turn_off.php
    
  • test if the script works in ssh:

    Code: Select all

    php Turn_on.php
    php Turn_off.php
  • Assign the scipts to the On- and Off action
I Hope this helps!

Re: Start camera recording on surveillance station by switch

Posted: Friday 04 May 2018 16:03
by lee48
Thanks a lot Wopper, it helped me to solve this error.

Re: Start camera recording on surveillance station by switch

Posted: Saturday 12 May 2018 1:55
by patj71
Script works fine, but how can I select which camera to start recording, all my cameras start to record using the script.
br Patrick

Re: Start camera recording on surveillance station by switch

Posted: Saturday 12 May 2018 8:15
by dannybloe
You will have to dive into the api I guess. The scripts loops over all cams and starts them all I believe (last time I looked). Shouldn't be so hard figure that out (and let me know when you did that coz I need it too ;-) )
Or create a dzVents script to do this...

Re: Start camera recording on surveillance station by switch

Posted: Monday 14 May 2018 13:03
by wopper125
patj71 wrote: Saturday 12 May 2018 1:55 Script works fine, but how can I select which camera to start recording, all my cameras start to record using the script.
br Patrick
look for this line in the script:

Code: Select all

if($cam->enabled ) {
replace with the code below.

Code: Select all

if($cam->enabled and $id_cam = XX) {)
replace the XX with the number of your camera. It should just be 1, 2, 3 etc.... I have two camara's so for me it was 1 for the first camera and 2 for my second camera. I have also created seperate on and off script files for each camera.

Re: Start camera recording on surveillance station by switch

Posted: Monday 11 February 2019 16:44
by pimseb
I was searching for camera recordings on surveillance station when I found this (quite old) post.
You don't really need this script anymore.
You can add an action rule directly in surveillance station, telling it that an external device will do some actions you want (send a notification, start recording ...)
Surveillance station will give you an URL that looks like :
https://ip:port/webapi/entry.cgi?api=SYNO.SurveillanceStation.ExternalEvent&method="Trigger"&version=1&eventId=1&eventName="This is external event1"&account="{account}"&password="{password}"

Just add this URL in your "action on / action off" field switch in domoticz.
For exemple if you have a motion detector set up in domoticz, you can tell surveillance station to record the video if a movement is detected

Re: Start camera recording on surveillance station by switch

Posted: Friday 20 November 2020 7:43
by Atis
pimseb wrote: Monday 11 February 2019 16:44 I was searching for camera recordings on surveillance station when I found this (quite old) post.
You don't really need this script anymore.
You can add an action rule directly in surveillance station, telling it that an external device will do some actions you want (send a notification, start recording ...)
Surveillance station will give you an URL that looks like :
https://ip:port/webapi/entry.cgi?api=SYNO.SurveillanceStation.ExternalEvent&method="Trigger"&version=1&eventId=1&eventName="This is external event1"&account="{account}"&password="{password}"

Just add this URL in your "action on / action off" field switch in domoticz.
For exemple if you have a motion detector set up in domoticz, you can tell surveillance station to record the video if a movement is detected

Hello,
I hope you can help me. I would like disable and enable the camera with URL. I try the syno document but can not working. Can you help how can I enable/disable one camera?
Thx,