Start camera recording on surveillance station by switch

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

Start camera recording on surveillance station by switch

Post by markiemajax » Wednesday 19 August 2015 19:08

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: 8608
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi
Domoticz version: beta
Location: Top of the world
Contact:

Re: Start camera recording on surveillance station by switch

Post by gizmocuz » Thursday 20 August 2015 7:26

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: 23
Joined: Monday 18 May 2015 15:45
Target OS: Raspberry Pi
Domoticz version: 3.4834
Contact:

Re: Start camera recording on surveillance station by switch

Post by markiemajax » Monday 23 November 2015 18:08

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 641 times

scatman
Posts: 26
Joined: Wednesday 26 August 2015 23:16
Target OS: Raspberry Pi
Domoticz version: 2.2563
Location: Poland
Contact:

Re: Start camera recording on surveillance station by switch

Post by scatman » Friday 25 December 2015 0:47

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: 6
Joined: Thursday 18 February 2016 19:15
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Start camera recording on surveillance station by switch

Post by JanKarel » Monday 22 February 2016 11:57

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

JanKarel

bbluff
Posts: 7
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 » Friday 18 March 2016 16: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

bbluff
Posts: 7
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 » Monday 21 March 2016 14:16

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: 32
Joined: Thursday 08 December 2016 21:50
Target OS: Linux
Domoticz version:
Contact:

Re: Start camera recording on surveillance station by switch

Post by mikkel75 » Friday 22 December 2017 14:08

bbluff wrote:
Friday 18 March 2016 16: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 » Wednesday 25 April 2018 21:43

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 » Friday 04 May 2018 16:03

Thanks a lot Wopper, it helped me to solve this error.

patj71
Posts: 4
Joined: Tuesday 08 August 2017 20:30
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Start camera recording on surveillance station by switch

Post by patj71 » 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

dannybloe
Posts: 1434
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi
Domoticz version:
Location: Ermelo
Contact:

Re: Start camera recording on surveillance station by switch

Post by dannybloe » Saturday 12 May 2018 8:15

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 » Monday 14 May 2018 13:03

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests