Start camera recording on surveillance station by switch

Moderator: leecollings

Post Reply
markiemajax
Posts: 17
Joined: Monday 18 May 2015 15:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.4834
Contact:

Start camera recording on surveillance station by switch

Post 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
User avatar
gizmocuz
Posts: 2352
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Start camera recording on surveillance station by switch

Post 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
Quality outlives Quantity!
markiemajax
Posts: 17
Joined: Monday 18 May 2015 15:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.4834
Contact:

Re: Start camera recording on surveillance station by switch

Post 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.
Attachments
Camera aan_uit.zip
(187.43 KiB) Downloaded 972 times
scatman
Posts: 17
Joined: Wednesday 26 August 2015 23:16
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.2563
Location: Poland
Contact:

Re: Start camera recording on surveillance station by switch

Post 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?
JanKarel
Posts: 5
Joined: Thursday 18 February 2016 18:15
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Start camera recording on surveillance station by switch

Post by JanKarel »

Does anyone have experience with setting up something similar as Mark developed for a QNAP NAS?

JanKarel
bbluff
Posts: 6
Joined: Tuesday 13 October 2015 23:14
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Start camera recording on surveillance station by switch

Post 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
bbluff
Posts: 6
Joined: Tuesday 13 October 2015 23:14
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

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

Post 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
mikkel75
Posts: 39
Joined: Thursday 08 December 2016 20:50
Target OS: Linux
Domoticz version:
Contact:

Re: Start camera recording on surveillance station by switch

Post 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
wopper125
Posts: 2
Joined: Wednesday 25 April 2018 21:05
Target OS: -
Domoticz version:
Contact:

Re: Start camera recording on surveillance station by switch

Post 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!
lee48
Posts: 1
Joined: Friday 04 May 2018 16:01
Target OS: -
Domoticz version:
Contact:

Re: Start camera recording on surveillance station by switch

Post by lee48 »

Thanks a lot Wopper, it helped me to solve this error.
patj71
Posts: 1
Joined: Tuesday 08 August 2017 20:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Start camera recording on surveillance station by switch

Post 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
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: Start camera recording on surveillance station by switch

Post 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...
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
wopper125
Posts: 2
Joined: Wednesday 25 April 2018 21:05
Target OS: -
Domoticz version:
Contact:

Re: Start camera recording on surveillance station by switch

Post 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.
pimseb
Posts: 42
Joined: Wednesday 13 September 2017 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Location: France
Contact:

Re: Start camera recording on surveillance station by switch

Post 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
Atis
Posts: 37
Joined: Monday 30 March 2020 7:30
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Start camera recording on surveillance station by switch

Post 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,
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests