From a1cc21d4645eddd4a3ce8ea510eed77651e5b5ac Mon Sep 17 00:00:00 2001
From: nasseeder1 <>
Date: Tue, 1 Dec 2015 19:26:22 +0000
Subject: [PATCH] 49_SSCam: avoid messages "insufficient user privilege" even
though the user was set up properly
git-svn-id: https://svn.fhem.de/fhem/trunk@10068 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
fhem/CHANGED | 2 ++
fhem/FHEM/49_SSCam.pm | 51 +++++++++++++++++--------------------------
fhem/HISTORY | 3 +++
3 files changed, 25 insertions(+), 31 deletions(-)
diff --git a/fhem/CHANGED b/fhem/CHANGED
index ac78ff129..9646667a8 100644
--- a/fhem/CHANGED
+++ b/fhem/CHANGED
@@ -1,5 +1,7 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
+ - bugfix: 49_SSCam: avoid messages "insufficient user privilege" even
+ though the user was set up properly
- bugfix: 70_PIONEERAVR: suppressed Smartmatch is experimental warnings
- feature: 30_pilight_temp add attributes offsetTemp and offsetHumidity to
correct temperature and humidity
diff --git a/fhem/FHEM/49_SSCam.pm b/fhem/FHEM/49_SSCam.pm
index 3ee392902..4ed59b250 100644
--- a/fhem/FHEM/49_SSCam.pm
+++ b/fhem/FHEM/49_SSCam.pm
@@ -216,7 +216,7 @@ sub camstart {
$apiextrecpath = $hash->{APIEXTRECPATH};
$apiextrecmaxver = $hash->{APIEXTRECMAXVER};
$errorcode = "";
- $url = "http://$servername:$serverport/webapi/$apiextrecpath?api=SYNO.SurveillanceStation.ExternalRecording&method=Record&version=$apiextrecmaxver&cameraId=$camid&action=start&session=SurveillanceStation&_sid=$sid";
+ $url = "http://$servername:$serverport/webapi/$apiextrecpath?api=SYNO.SurveillanceStation.ExternalRecording&method=Record&version=$apiextrecmaxver&cameraId=$camid&action=start&session=SurveillanceStation&_sid=\"$sid\"";
$myjson = get $url;
# Evaluiere ob Daten im JSON-Format empfangen
@@ -245,7 +245,7 @@ sub camstart {
readingsEndUpdate($hash, 1);
$hash->{STATE} = "on";
- # bedingt Browseraktualisierung und Status der "Lampen"
+ # Generiert das Ereignis "on", bedingt Browseraktualisierung und Status der "Lampen"
{ fhem "trigger $device on" }
# Logausgabe
@@ -334,7 +334,7 @@ sub camstop {
$apiextrecmaxver = $hash->{APIEXTRECMAXVER};
$errorcode = "";
- $url = "http://$servername:$serverport/webapi/$apiextrecpath?api=SYNO.SurveillanceStation.ExternalRecording&method=Record&version=$apiextrecmaxver&cameraId=$camid&action=stop&session=SurveillanceStation&_sid=$sid";
+ $url = "http://$servername:$serverport/webapi/$apiextrecpath?api=SYNO.SurveillanceStation.ExternalRecording&method=Record&version=$apiextrecmaxver&cameraId=$camid&action=stop&session=SurveillanceStation&_sid=\"$sid\"";
$myjson = get $url;
# Evaluiere ob Daten im JSON-Format empfangen
@@ -362,8 +362,8 @@ sub camstop {
readingsEndUpdate($hash, 1);
$hash->{STATE} = "off";
- # bedingt Browseraktualisierung und Status der "Lampen"
- { fhem "trigger $device on" }
+ # Generiert das Ereignis "on", bedingt Browseraktualisierung und Status der "Lampen"
+ { fhem "trigger $device off" }
# Logausgabe
$logstr = "Camera $camname Recording stopped";
@@ -605,7 +605,7 @@ sub getcamid {
&printlog($hash,$logstr,"5");
# einlesen aller Kameras
- $url = "http://$servername:$serverport/webapi/$apicampath?api=SYNO.SurveillanceStation.Camera&version=$apicammaxver&method=List&session=SurveillanceStation&_sid=$sid";
+ $url = "http://$servername:$serverport/webapi/$apicampath?api=SYNO.SurveillanceStation.Camera&version=$apicammaxver&method=List&session=SurveillanceStation&_sid=\"$sid\"";
$myjson = get $url;
# Evaluiere ob Daten im JSON-Format empfangen
@@ -967,6 +967,10 @@ return($hash,$success);
SSCam
+ Using this Modul you are able to start and stop recordings of cameras which are defined in Synology Surveillance Station.
+ The recordings are stored in Synology Surveillance Station and are managed like the other (normal) recordings defined by Surveillance Station rules.
+ For example the recordings are stored for a defined time in Surveillance Station and will be deleted after that period.
+
Prerequisites
This module uses other CPAN-modules LWP and JSON. Consider to install these packages (Debian: libwww-perl, libjson-perl).
You also need to add an user in Synology DSM as member of Administrators group for using in this module.
@@ -978,24 +982,14 @@ return($hash,$success);
define <name> SSCam <Servername> <Port> <Username> <Password> <Cameraname> <RecordTime>
Defines a new camera device for SSCam. At first the devices have to be set up and operable in Synology Surveillance Station 7.0 and above.
- Using this Modul you are able to start and stop recordings of cameras defined in Synology Surveillance Station.
- The recordings are stored in Synology Surveillance Station Database
- and managed like the other (normal) recordings defined by Surveillance Station rules.
- The parameter describes the minimum Recordtime. Dependend on other factors like the performance of you Synology Diskstation and
+ The parameter "RecordTime" describes the minimum Recordtime. Dependend on other factors like the performance of you Synology Diskstation and
Surveillance Station the effective Recordtime could be longer.
The Modul SSCam ist based on functions of Synology Surveillance Station API.
Please refer the Web API Guide.
- At the time only HTTP-Protokoll is supported to call Synology DS.
-
-Known Issues
-
- Sometimes the Error 105 "Insuffucient privileges" occurs because of problems with Synology User check implementation.
- Until Synology is solving that problem I have implemented a workaround.
- Please consider it if you will get some entries like "Insuffucient privileges" in FHEM-Logfile.
-
+ At present only HTTP-Protokoll is supported to call Synology DS.
The parameters are in detail:
@@ -1063,6 +1057,10 @@ return($hash,$success);
SSCam
+ Mit diesem Modul kann die Aufnahme von in der Synology Surveillance Station definierten Kameras gestartet bzw. gestoppt werden.
+ Die Aufnahmen stehen in der Synology Surveillance Station zur Verfügung und unterliegen, wie jede andere Aufnahme, den in der Synology Surveillance Station eingestellten Regeln.
+ So werden zum Beispiel die Aufnahmen entsprechend ihrer Archivierungsfrist gehalten und dann gelöscht.
+
Vorbereitung
Dieses Modul nutzt weitere CPAN Module LWP und JSON. Bitte darauf achten diese Pakete zu installieren. (Debian: libwww-perl, libjson-perl).
Im DSM muß ebenfalls ein Nutzer als Mitglied der Administratorgruppe angelegt sein. Die Daten werden beim define des Gerätes benötigt.
@@ -1073,11 +1071,9 @@ return($hash,$success);
define <name> SSCam <Servername> <Port> <Username> <Password> <Cameraname> <RecordTime>
- Definiert eine neues Kamera für SSCam. Zunächst muß diese Kamera in der Synology Surveillance Station 7.0 oder höher eingebunden sein und entsprechend funktionieren.
- Mit diesem Modul kann die Aufnahme einer in der Synology Surveillance Station definierten Kamera gestartet oder gestoppt werden.
- Die Aufnahmen stehen in der Synology Surveillance Station Datenbank zur Verfügung und unterliegen wie jede andere Aufnahme den in der Synology Surveillance Station eingestellten Regeln.
+ Definiert eine neue Kamera für SSCam. Zunächst muß diese Kamera in der Synology Surveillance Station 7.0 oder höher eingebunden sein und entsprechend funktionieren.
- Der Parameter beschreibt die Mindestaufnahmezeit. Abhängig von Faktoren wie Performance der Synology Diskstation und der Surveillance Station
+ Der Parameter "RecordTime" beschreibt die Mindestaufnahmezeit. Abhängig von Faktoren wie Performance der Synology Diskstation und der Surveillance Station
kann die effektive Aufnahmezeit geringfügig länger sein.
Das Modul SSCam basiert auf Funktionen der Synology Surveillance Station API.
@@ -1086,14 +1082,7 @@ return($hash,$success);
Es müssen die Perl-Module LWP (Debian: libwww-perl) und JSON (Debian: libjson-perl) installiert sein.
Momentan wird nur das HTTP-Protokoll unterstützt um die Web-Services der Synology DS aufzurufen.
-Bekannte Probleme
-
- Manchmal taucht der Fehler 105 "Insuffucient privileges" auf wegen eines Problems in dem Standard Synology User check auf.
- Bis Synology diesen Fehler gefixt hat, habe ich einen Workaround eingebaut.
- Bitte diesen Umstand berücksichtigen wenn im FHEM-Logfile etliche Einträge der Form "Insuffucient privileges" auftauchen.
-
-
- Die Parameter sind im Einzelnen:
+ Die Parameter beschreiben im Einzelnen:
@@ -1119,7 +1108,7 @@ return($hash,$success);
Set
- Es gibt zwei Optionen für "Set".
+ Es gibt zur Zeit zwei Optionen für "Set".
"on" : startet die Aufnahme.
diff --git a/fhem/HISTORY b/fhem/HISTORY
index ecadeb59a..aee1892f0 100644
--- a/fhem/HISTORY
+++ b/fhem/HISTORY
@@ -653,3 +653,6 @@
- Mon Nov 16 2015 (telekatz)
- added new module 10_DUOFERNSTICK
- added new module 30_DUOFERN
+
+- Sun Nov 29 2015 (DS_Starter)
+ - added new module 49_SSCam to trigger records of cameras within Synology Surveillance Station
\ No newline at end of file