Page 1 of 1
Synology Surveillance Station
Posted: Friday 20 November 2020 7:54
by Atis
Hello,
I find synology Surveillance Station plugin for domoticz. I try 3 plugins but not work. I would like enable and disable some cameras.
Thank you,
Re: Synology Surveillance Station
Posted: Sunday 22 November 2020 15:55
by azonneveld
This can be done using the surveillance station API.
Described at page 55.
https://global.download.synology.com/do ... eb_API.pdf
Re: Synology Surveillance Station
Posted: Monday 23 November 2020 14:00
by Atis
Yes I find this API description, but I try and can not working.
http://192.168.10.2:5000/webapi/entry.c ... &password="*****"
I try enable Camera 1.
Re: Synology Surveillance Station
Posted: Tuesday 24 November 2020 8:40
by azonneveld
needs Admin account on SS. Test using a browser:
(I use '/cam' instead of the port)
Authenticate:
Code: Select all
http://IP/cam/webapi/auth.cgi?api=SYNO.API.Auth&method=Login&version=1&account=USER&passwd=PW&session=SurveillanceStation
Execute command:
Code: Select all
http://IP/cam/webapi/entry.cgi?&api="SYNO.SurveillanceStation.Camera"&version=9&method="Disable"&idList="ID"
If that works, create a bash script (not tested):
Code: Select all
#!/bin/sh
wget --save-cookies /var/tmp/cookies.txt \
--keep-session-cookies \
-O "/var/tmp/cookies.txt" "http://IP/cam/webapi/auth.cgi?api=SYNO.API.Auth&method=Login&version=1&account=USER&passwd=PW&session=SurveillanceStation"
wget --load-cookies /var/tmp/cookies.txt \
"http://IP/cam/webapi/entry.cgi?&api="SYNO.SurveillanceStation.Camera"&version=9&method="Disable"&idList="ID""
Call script from Domoticz Lua using:
Code: Select all
os.execute ('(/home/pi/domoticz/scripts/SCRIPTNAME.sh > /dev/null)&')
This addition prevents Domoticz waiting for the response:
Re: Synology Surveillance Station
Posted: Tuesday 24 November 2020 9:56
by Atis
azonneveld wrote: Tuesday 24 November 2020 8:40
needs Admin account on SS. Test using a browser:
(I use '/cam' instead of the port)
Authenticate:
Code: Select all
http://IP/cam/webapi/auth.cgi?api=SYNO.API.Auth&method=Login&version=1&account=USER&passwd=PW&session=SurveillanceStation
Execute command:
Code: Select all
http://IP/cam/webapi/entry.cgi?&api="SYNO.SurveillanceStation.Camera"&version=9&method="Disable"&idList="ID"
If that works, create a bash script (not tested):
Code: Select all
#!/bin/sh
wget --save-cookies /var/tmp/cookies.txt \
--keep-session-cookies \
-O "/var/tmp/cookies.txt" "http://IP/cam/webapi/auth.cgi?api=SYNO.API.Auth&method=Login&version=1&account=USER&passwd=PW&session=SurveillanceStation"
wget --load-cookies /var/tmp/cookies.txt \
"http://IP/cam/webapi/entry.cgi?&api="SYNO.SurveillanceStation.Camera"&version=9&method="Disable"&idList="ID""
Call script from Domoticz Lua using:
Code: Select all
os.execute ('(/home/pi/domoticz/scripts/SCRIPTNAME.sh > /dev/null)&')
This addition prevents Domoticz waiting for the response:
One url can not include command, username, password? I need 2 steps? One login and one command?
Re: Synology Surveillance Station
Posted: Tuesday 24 November 2020 10:16
by azonneveld
Atis wrote: Tuesday 24 November 2020 9:56
One url can not include command, username, password? I need 2 steps? One login and one command?
Perhaps, but this is how i use it.
If you find out how to simplify the requests, please post your findings.
Re: Synology Surveillance Station
Posted: Tuesday 24 November 2020 17:11
by Atis
azonneveld wrote: Tuesday 24 November 2020 10:16
Atis wrote: Tuesday 24 November 2020 9:56
One url can not include command, username, password? I need 2 steps? One login and one command?
Perhaps, but this is how i use it.
If you find out how to simplify the requests, please post your findings.
Thank you, the script working