diff --git a/fhem/CHANGED b/fhem/CHANGED
index 836f0f385..47f3fe72d 100644
--- a/fhem/CHANGED
+++ b/fhem/CHANGED
@@ -1,5 +1,8 @@
# 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.
+ - changed: 49_SSCam: usage of attribute \"livestreamprefix\" changed,
+ minor code changes, SSCamSTRM changed for compatibility
+ and new attributes with direct attribute help
- feature: 74_Unifi: Added readings for wan_ip and results of speedtest
- feature: 77_UWZ: new language support, french and hollandisch
- change: 93_DbRep: V8.6.0, devices and readings can be excluded by
diff --git a/fhem/FHEM/49_SSCam.pm b/fhem/FHEM/49_SSCam.pm
index ef77fc235..12adb9cde 100644
--- a/fhem/FHEM/49_SSCam.pm
+++ b/fhem/FHEM/49_SSCam.pm
@@ -36,9 +36,17 @@ package main;
use strict;
use warnings;
+eval "use JSON qw( decode_json );1;" or my $SScamMMDBI = "JSON"; # Debian: apt-get install libjson-perl
+use Data::Dumper; # Perl Core module
+use MIME::Base64;
+use Time::HiRes;
+use HttpUtils;
+# no if $] >= 5.017011, warnings => 'experimental';
# Versions History intern
our %SSCam_vNotesIntern = (
+ "7.3.1" => "31.10.2018 fix connection lost failure if several SSCamSTRM devices are defined and updated by longpoll from same parent device ",
+ "7.3.0" => "28.10.2018 usage of attribute \"livestreamprefix\" changed, exec SSCam_getStmUrlPath on boot ",
"7.2.1" => "23.10.2018 new routine SSCam_versionCheck, COMPATIBILITY changed to 8.2.1 ",
"7.2.0" => "20.10.2018 direct help for attributes, new get versionNotes command, fix PERL WARNING: Use of uninitialized value \$small, get versionNotes ",
"7.1.1" => "18.10.2018 Message of \"Your current/simulated SVS-version...\" changed, commandref corrected ",
@@ -83,6 +91,7 @@ our %SSCam_vNotesIntern = (
# Versions History extern
our %SSCam_vNotesExtern = (
+ "7.3.0" => "28.10.2018 In attribute \"livestreamprefix\" can now \"DEF\" be specified to overwrite livestream address by specification from device definition ",
"7.2.1" => "23.10.2018 COMPATIBILITY changed to 8.2.1 ",
"7.2.0" => "20.10.2018 direct help for attributes, new get versionNotes command, please see commandref for details ",
"7.1.1" => "18.10.2018 Message of \"current/simulated SVS-version...\" changed, commandref corrected ",
@@ -190,13 +199,6 @@ our %SSCam_vHintsExt_de = (
"Diese Vorlage kann zum Beispiel mit Paint.Net bearbeitet werden. ",
"1" => "Hilfreiche Hinweise zu SSCam im FHEM-Wiki"
);
-
-eval "use JSON qw( decode_json );1;" or my $SScamMMDBI = "JSON"; # Debian: apt-get install libjson-perl
-use Data::Dumper; # Perl Core module
-use MIME::Base64;
-use Time::HiRes;
-use HttpUtils;
-# no if $] >= 5.017011, warnings => 'experimental';
# getestete SVS-Version
my $compstat = "8.2.1";
@@ -433,7 +435,7 @@ sub SSCam_Attr($$$$) {
if($aName =~ m/ptzPanel_row.*|ptzPanel_Home|ptzPanel_use/) {
InternalTimer(gettimeofday()+0.7, "SSCam_addptzattr", "$name", 0);
}
-
+
if ($aName eq "disable") {
if($cmd eq "set") {
$do = ($aVal) ? 1 : 0;
@@ -556,8 +558,7 @@ sub SSCam_Attr($$$$) {
}
if($aName =~ m/pollcaminfoall/) {
return "The value of \"$aName\" has to be greater than 10 seconds." if($aVal <= 10);
- }
-
+ }
}
if ($cmd eq "del") {
@@ -1427,8 +1428,8 @@ sub SSCam_initonboot ($) {
if(SSCam_IsModelCam($hash)) {
# Kameraspezifische Infos holen
SSCam_getcaminfo($hash);
-
SSCam_getcapabilities($hash);
+ SSCam_getStmUrlPath($hash);
# Preset/Patrollisten in Hash einlesen zur PTZ-Steuerung
SSCam_getptzlistpreset($hash);
@@ -3806,8 +3807,6 @@ return SSCam_camop($hash);
sub SSCam_camop ($) {
my ($hash) = @_;
my $name = $hash->{NAME};
- my $serveraddr = $hash->{SERVERADDR};
- my $serverport = $hash->{SERVERPORT};
my $apicam = $hash->{HELPER}{APICAM};
my $apicampath = $hash->{HELPER}{APICAMPATH};
my $apicammaxver = $hash->{HELPER}{APICAMMAXVER};
@@ -3857,6 +3856,8 @@ sub SSCam_camop ($) {
my $OpMode = $hash->{OPMODE};
my $camid = $hash->{CAMID};
my $proto = $hash->{PROTOCOL};
+ my $serveraddr = $hash->{SERVERADDR};
+ my $serverport = $hash->{SERVERPORT};
my ($exturl,$winname,$attr,$room,$param);
my ($url,$snapid,$httptimeout,$expmode,$motdetsc);
@@ -4120,7 +4121,9 @@ sub SSCam_camop ($) {
Log3($name, 4, "$name - trigger external event \"$hash->{HELPER}{EVENTID}\"");
$url = "$proto://$serveraddr:$serverport/webapi/$apiextevtpath?api=$apiextevt&version=$apiextevtmaxver&method=Trigger&eventId=$hash->{HELPER}{EVENTID}&eventName=$hash->{HELPER}{EVENTID}&_sid=\"$sid\"";
- } elsif ($OpMode eq "runliveview" && $hash->{HELPER}{RUNVIEW} !~ m/snap|^live_.*hls$/) {
+ } elsif ($OpMode eq "runliveview" && $hash->{HELPER}{RUNVIEW} !~ m/snap|^live_.*hls$/) {
+ $exturl = AttrVal($name, "livestreamprefix", "$proto://$serveraddr:$serverport");
+ $exturl = ($exturl eq "DEF")?"$proto://$serveraddr:$serverport":$exturl;
if ($hash->{HELPER}{RUNVIEW} =~ m/live/) {
if($apiaudiostmmaxver) { # API "SYNO.SurveillanceStation.AudioStream" vorhanden ? (removed ab API v2.8)
$hash->{HELPER}{AUDIOLINK} = "$proto://$serveraddr:$serverport/webapi/$apiaudiostmpath?api=$apiaudiostm&version=$apiaudiostmmaxver&method=Stream&cameraId=$camid&_sid=$sid";
@@ -4128,7 +4131,6 @@ sub SSCam_camop ($) {
delete $hash->{HELPER}{AUDIOLINK} if($hash->{HELPER}{AUDIOLINK});
}
- $exturl = AttrVal($name, "livestreamprefix", "$proto://$serveraddr:$serverport");
if($apivideostmsmaxver) { # API "SYNO.SurveillanceStation.VideoStream" vorhanden ? (removed ab API v2.8)
# externe URL in Reading setzen
$exturl .= "/webapi/$apivideostmspath?api=$apivideostms&version=$apivideostmsmaxver&method=Stream&cameraId=$camid&format=mjpeg&_sid=$sid";
@@ -4142,7 +4144,6 @@ sub SSCam_camop ($) {
} else {
# Abspielen der letzten Aufnahme (EventId)
- $exturl = AttrVal($name, "livestreamprefix", "$proto://$serveraddr:$serverport");
# externe URL in Reading setzen
$exturl .= "/webapi/$apistmpath?api=$apistm&version=$apistmmaxver&method=EventStream&eventId=$hash->{HELPER}{CAMLASTRECID}×tamp=1&_sid=$sid";
@@ -4939,12 +4940,14 @@ sub SSCam_camop_parse ($) {
$unicastPath = $data->{'data'}[0]{'rtspPath'};
}
- # Rewrite Url's falls livestreamprefix ist gesetzt
+ # Rewrite Url's falls livestreamprefix ist gesetzt
if (AttrVal($name, "livestreamprefix", undef)) {
+ my $exturl = AttrVal($name, "livestreamprefix", "$proto://$serveraddr:$serverport");
+ $exturl = ($exturl eq "DEF")?"$proto://$serveraddr:$serverport":$exturl;
my @mjh = split(/\//, $mjpegHttp, 4);
- $mjpegHttp = AttrVal($name, "livestreamprefix", undef)."/".$mjh[3];
+ $mjpegHttp = $exturl."/".$mjh[3];
my @mxh = split(/\//, $mxpegHttp, 4);
- $mxpegHttp = AttrVal($name, "livestreamprefix", undef)."/".$mxh[3];
+ $mxpegHttp = $exturl."/".$mxh[3];
if($unicastPath) {
my @ucp = split(/[@\|:]/, $unicastPath);
my @lspf = split(/[\/\/\|:]/, AttrVal($name, "livestreamprefix", undef));
@@ -5778,18 +5781,15 @@ sub SSCam_refresh($$$$) {
}
# parentState des SSCamSTRM-Device mit Opmode updaten (mit/ohne Event)
- my @strmdvs = devspec2array("TYPE=SSCamSTRM:FILTER=PARENT=".$name);
- if(@strmdvs) {
- foreach (@strmdvs) {
- my $strmhash = $defs{$_};
- if($lpoll_strm) {
- readingsSingleUpdate($strmhash,"parentState", $hash->{OPMODE}, 1);
- } else {
- readingsSingleUpdate($strmhash,"parentState", $hash->{OPMODE}, 0);
- }
- }
+ if($hash->{HELPER}{STRMDEV}) {
+ my $strmhash = $defs{$hash->{HELPER}{STRMDEV}};
+ if($lpoll_strm) {
+ readingsSingleUpdate($strmhash,"parentState", $hash->{OPMODE}, 1);
+ } else {
+ readingsSingleUpdate($strmhash,"parentState", $hash->{OPMODE}, 0);
+ }
}
-
+
return;
}
@@ -7543,8 +7543,20 @@ attr <name> genericStrmHtmlTag <video $HTMLATTR controls autoplay>
livestreamprefix
- overwrites the specifications of protocol, servername and port for further use of the livestream address, e.g.
- as an link to external use. It has to be specified as "http(s)://<servername>:<port>"
+ Overwrites the specifications of protocol, servername and port for further use in livestream address and
+ StmKey.*-readings , e.g. as a link for external use.
+ It can be specified of two ways as follows:
+
+
+
+
DEF
: the protocol, servername and port as specified in device
+ definition is used
+
http(s)://<servername>:<port>
: your own address specification is used
+
+
+
+ Servername can be the name or the IP-address of your Synology Surveillance Station.
+
livestreamprefix
- überschreibt die Angaben zu Protokoll, Servernamen und Port zur Weiterverwendung der
- Livestreamadresse als z.B. externer Link. Anzugeben in der Form
- "http(s)://<servername>:<port>"
+ Überschreibt die Angaben zu Protokoll, Servernamen und Port in StmKey.*-Readings bzw. der Livestreamadresse zur
+ Weiterverwendung z.B. als externer Link.
+ Die Spezifikation kann auf zwei Arten erfolgen:
+
+
+
+
DEF
: es wird Protokoll, Servername und Port aus der Definition
+ des SSCam-Devices verwendet
+
http(s)://<servername>:<port>
: eine eigene Adressenangabe wird verwendet
+
+
+
+ Servername kann der Name oder die IP-Adresse der Synology Surveillance Station sein.
+
+
loginRetries
diff --git a/fhem/FHEM/49_SSCamSTRM.pm b/fhem/FHEM/49_SSCamSTRM.pm
index 590b39365..af4951585 100644
--- a/fhem/FHEM/49_SSCamSTRM.pm
+++ b/fhem/FHEM/49_SSCamSTRM.pm
@@ -26,34 +26,49 @@
# along with fhem. If not, see .
#
#########################################################################################################################
-# Versions History:
-#
-# 1.2.3 03.07.2018 behavior changed if device is disabled
-# 1.2.2 26.06.2018 make changes for generic stream dev
-# 1.2.1 23.06.2018 no name add-on if MODEL is snapgallery
-# 1.2.0 20.06.2018 running stream as human readable entry for SSCamSTRM-Device
-# 1.1.0 16.06.2018 attr hideDisplayName regarding to Forum #88667
-# 1.0.1 14.06.2018 commandref revised
-# 1.0.0 14.06.2018 switch to longpoll refresh
-# 0.4 13.06.2018 new attribute "noDetaillink" (deleted in V1.0.0)
-# 0.3 12.06.2018 new attribute "forcePageRefresh"
-# 0.2 11.06.2018 check in with SSCam 5.0.0
-# 0.1 10.06.2018 initial Version
-
package main;
use strict;
use warnings;
-my $SSCamSTRMVersion = "1.2.3";
+# Versions History intern
+our %SSCamSTRM_vNotesIntern = (
+ "1.4.1" => "31.10.2018 attribute \"autoLoop\" changed to \"autoRefresh\", new attribute \"autoRefreshFW\" ",
+ "1.4.0" => "29.10.2018 readingFnAttributes added ",
+ "1.3.0" => "28.10.2018 direct help for attributes, new attribute \"autoLoop\" ",
+ "1.2.4" => "27.10.2018 fix undefined subroutine &main::SSCam_ptzpanel (https://forum.fhem.de/index.php/topic,45671.msg850505.html#msg850505) ",
+ "1.2.3" => "03.07.2018 behavior changed if device is disabled ",
+ "1.2.2" => "26.06.2018 make changes for generic stream dev ",
+ "1.2.1" => "23.06.2018 no name add-on if MODEL is snapgallery ",
+ "1.2.0" => "20.06.2018 running stream as human readable entry for SSCamSTRM-Device ",
+ "1.1.0" => "16.06.2018 attr hideDisplayName regarding to Forum #88667 ",
+ "1.0.1" => "14.06.2018 commandref revised ",
+ "1.0.0" => "14.06.2018 switch to longpoll refresh ",
+ "0.4.0" => "13.06.2018 new attribute \"noDetaillink\" (deleted in V1.0.0) ",
+ "0.3.0" => "12.06.2018 new attribute \"forcePageRefresh\" ",
+ "0.2.0" => "11.06.2018 check in with SSCam 5.0.0 ",
+ "0.1.0" => "10.06.2018 initial Version "
+);
+
+# Standardvariablen und Forward-Declaration
+sub SSCam_ptzpanel($;$$);
+sub SSCam_StreamDev($$$);
################################################################
sub SSCamSTRM_Initialize($) {
my ($hash) = @_;
+ my $fwd = join(",",devspec2array("TYPE=FHEMWEB:FILTER=STATE=Initialized"));
+
$hash->{DefFn} = "SSCamSTRM_Define";
- $hash->{AttrList} = "disable:1,0 forcePageRefresh:1,0 htmlattr hideDisplayName:1,0 ";
+ $hash->{AttrList} = "autoRefresh:selectnumbers,120,0.2,1800,0,log10 ".
+ "autoRefreshFW:$fwd ".
+ "disable:1,0 ".
+ "forcePageRefresh:1,0 ".
+ "htmlattr ".
+ "hideDisplayName:1,0 ".
+ $readingFnAttributes;
$hash->{FW_summaryFn} = "SSCamSTRM_FwFn";
$hash->{FW_detailFn} = "SSCamSTRM_FwFn";
$hash->{AttrFn} = "SSCamSTRM_Attr";
@@ -76,7 +91,7 @@ sub SSCamSTRM_Define($$) {
$arg =~ s/'//g;
($hash->{PARENT},$hash->{MODEL}) = ((split(",",$arg))[0],(split(",",$arg))[2]);
- $hash->{VERSION} = $SSCamSTRMVersion;
+ $hash->{VERSION} = $hash->{VERSION} = (reverse sort(keys %SSCamSTRM_vNotesIntern))[0];
$hash->{LINK} = $link;
readingsSingleUpdate($hash,"state", "initialized", 1); # Init für "state"
@@ -108,13 +123,14 @@ return undef;
}
################################################################
-sub SSCamSTRM_FwFn($$$$) {
+sub SSCamSTRM_FwFn($;$$$) {
my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash is set for summaryFn.
my $hash = $defs{$d};
my $link = $hash->{LINK};
- # return undef if(IsDisabled($d));
-
+ RemoveInternalTimer($hash);
+ $hash->{HELPER}{FW} = $FW_wname;
+
$link = AnalyzePerlCommand(undef, $link) if($link =~ m/^{(.*)}$/s);
my $show = $defs{$hash->{PARENT}}->{HELPER}{ACTSTRM} if($hash->{MODEL} =~ /switched/);
$show = $show?"($show)":"";
@@ -133,10 +149,37 @@ sub SSCamSTRM_FwFn($$$$) {
} else {
$ret .= $link;
}
+
+ # Autorefresh nur des aufrufenden FHEMWEB-Devices
+ my $al = AttrVal($d, "autoRefresh", 0);
+ if($al) {
+ InternalTimer(gettimeofday()+$al, "SSCamSTRM_refresh", $hash, 0);
+ Log3($d, 5, "$d - next start of autoRefresh: ".FmtDateTime(gettimeofday()+$al));
+ }
return $ret;
}
+################################################################
+sub SSCamSTRM_refresh($) {
+ my ($hash) = @_;
+ my $d = $hash->{NAME};
+
+ # Seitenrefresh festgelegt durch SSCamSTRM-Attribut "autoRefresh" und "autoRefreshFW"
+ my $rd = AttrVal($d, "autoRefreshFW", $hash->{HELPER}{FW});
+ { map { FW_directNotify("#FHEMWEB:$_", "location.reload('true')", "") } $rd }
+
+ my $al = AttrVal($d, "autoRefresh", 0);
+ if($al) {
+ InternalTimer(gettimeofday()+$al, "SSCamSTRM_refresh", $hash, 0);
+ Log3($d, 5, "$d - next start of autoRefresh: ".FmtDateTime(gettimeofday()+$al));
+ } else {
+ RemoveInternalTimer($hash);
+ }
+
+return;
+}
+
1;
=pod
@@ -192,30 +235,51 @@ Dependend of the Streaming-Device state, different buttons are provided to start
-
disable
- deactivates the device definition
+
+
autoRefresh
+ If set, active browser pages of the FHEMWEB-Device which has called the SSCamSTRM-Device, are new reloaded after
+ the specified time (seconds). Browser pages of a particular FHEMWEB-Device to be refreshed can be specified by
+ attribute "autoRefreshFW" instead.
+ This may stabilize the video playback in some cases.
+
+
autoRefreshFW
+ If "autoRefresh" is activated, you can specify a particular FHEMWEB-Device whose active browser pages are refreshed
+ periodically.
+
+
+
+
+
disable
+ Deactivates the device.
+
+
+
+
forcePageRefresh
The attribute is evaluated by SSCam.
- If set, a reload of all browser pages with active FHEMWEB-connections will be enforced.
- This may be helpful if problems with longpoll are appear.
+ If set, a reload of all browser pages with active FHEMWEB connections will be enforced when particular camera operations
+ were finished.
+ This may stabilize the video playback in some cases.
+
hideDisplayName
- hide the device/alias name (link to detail view)
+ Hide the device/alias name (link to detail view).
htmlattr
- HTML attributes to be used for Streaming device e.g.:
+ Additional HTML tags to manipulate the streaming device.
@@ -275,31 +339,49 @@ Abhängig vom Zustand des Streaming-Devices werden zum Start von Aktionen unters
-
disable
- aktiviert/deaktiviert das Device
+
+
autoRefresh
+ Wenn gesetzt, werden aktive Browserseiten des FHEMWEB-Devices welches das SSCamSTRM-Device aufgerufen hat, nach der
+ eingestellten Zeit (Sekunden) neu geladen. Sollen statt dessen Broserseiten eines bestimmten FHEMWEB-Devices neu
+ geladen werden, kann dieses Device mit dem Attribut "autoRefreshFW" festgelegt werden.
+ Dies kann in manchen Fällen die Wiedergabe innerhalb einer Anwendung stabilisieren.
+
+
autoRefreshFW
+ Ist "autoRefresh" aktiviert, kann mit diesem Attribut das FHEMWEB-Device bestimmt werden dessen aktive Browserseiten
+ regelmäßig neu geladen werden sollen.
+
+
+
+
+
disable
+ Aktiviert/deaktiviert das Device.
+
+
+
+
forcePageRefresh
Das Attribut wird durch SSCam ausgewertet.
- Wenn gesetzt, wird ein Reload aller Browserseiten mit aktiven FHEMWEB-Verbindungen bei bestimmten Aktionen erzwungen.
- Das kann hilfreich sein, falls es mit Longpoll Probleme geben sollte.
- eingefügt ist.
+ Wenn gesetzt, wird ein Reload aller Browserseiten mit aktiven FHEMWEB-Verbindungen nach dem Abschluß bestimmter
+ SSCam-Befehle erzwungen.
+ Dies kann in manchen Fällen die Wiedergabe innerhalb einer Anwendung stabilisieren.
+
hideDisplayName
- verbirgt den Device/Alias-Namen (Link zur Detailansicht)
+ Verbirgt den Device/Alias-Namen (Link zur Detailansicht).
htmlattr
- HTML-Attribute zur Darstellungsänderung des SSCam Streaming Device z.B.:
+ Zusätzliche HTML Tags zur Darstellungsänderung im Streaming Device.
diff --git a/fhem/contrib/DS_Starter/49_SSCam.pm b/fhem/contrib/DS_Starter/49_SSCam.pm
deleted file mode 100644
index 3422c6216..000000000
--- a/fhem/contrib/DS_Starter/49_SSCam.pm
+++ /dev/null
@@ -1,9158 +0,0 @@
-########################################################################################################################
-# $Id: 49_SSCam.pm 17584 2018-10-21 09:34:54Z DS_Starter $
-#########################################################################################################################
-# 49_SSCam.pm
-#
-# (c) 2015-2018 by Heiko Maaz
-# e-mail: Heiko dot Maaz at t-online dot de
-#
-# This Module can be used to operate Cameras defined in Synology Surveillance Station 7.0 or higher.
-# It's based on and uses Synology Surveillance Station API.
-#
-# This script is part of fhem.
-#
-# Fhem is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# Fhem is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with fhem. If not, see .
-#
-#########################################################################################################################
-#
-# Definition: define SSCam [ServerPort] [Protocol]
-#
-# Example of defining a Cam-device: define CamCP1 SSCAM Carport 192.168.2.20 [5000] [HTTP(S)]
-# Example of defining a SVS-device: define SDS1 SSCAM SVS 192.168.2.20 [5000] [HTTP(S)]
-#
-
-package main;
-
-use strict;
-use warnings;
-eval "use JSON qw( decode_json );1;" or my $SScamMMDBI = "JSON"; # Debian: apt-get install libjson-perl
-use Data::Dumper; # Perl Core module
-use MIME::Base64;
-use Time::HiRes;
-use HttpUtils;
-# no if $] >= 5.017011, warnings => 'experimental';
-
-# Versions History intern
-our %SSCam_vNotesIntern = (
- "7.3.1" => "31.10.2018 fix connection lost failure if several SSCamSTRM devices are defined and updated by longpoll from same parent device ",
- "7.3.0" => "28.10.2018 usage of attribute \"livestreamprefix\" changed, exec SSCam_getStmUrlPath on boot ",
- "7.2.1" => "23.10.2018 new routine SSCam_versionCheck, COMPATIBILITY changed to 8.2.1 ",
- "7.2.0" => "20.10.2018 direct help for attributes, new get versionNotes command, fix PERL WARNING: Use of uninitialized value \$small, get versionNotes ",
- "7.1.1" => "18.10.2018 Message of \"Your current/simulated SVS-version...\" changed, commandref corrected ",
- "7.1.0" => "02.09.2018 PIR Sensor enable/disable, SSCam_Set/SSCam_Get optimized ",
- "7.0.1" => "27.08.2018 enable/disable issue (https://forum.fhem.de/index.php/topic,45671.msg830869.html#msg830869) ",
- "7.0.0" => "27.07.2018 compatibility to API v2.8 ",
- "6.0.1" => "04.07.2018 Reading CamFirmware ",
- "6.0.0" => "03.07.2018 HTTPS Support, buttons for refresh SSCamSTRM-devices ",
- "5.3.0" => "29.06.2018 changes regarding to \"createStreamDev ... generic\", refresh reading parentState of all, SSCamSTRM devices with PARENT=SSCam-device, control elements for runView within fhemweb, new CamLive.*-Readings, minor fixes ",
- "5.2.7" => "26.06.2018 fix state turns to \"off\" even though cam is disabled ",
- "5.2.6" => "20.06.2018 running stream as human readable entry for SSCamSTRM-Device, goAbsPTZ fix set-entry für non-PTZ ",
- "5.2.5" => "18.06.2018 trigger lastsnap_fw to SSCamSTRM-Device only if snap was done by it. ",
- "5.2.4" => "17.06.2018 SSCam_composegallery added and write warning if old composegallery-weblink device is used ",
- "5.2.3" => "16.06.2018 no SSCamSTRM refresh when snapgetinfo was running without taken a snap by SSCamSTRM-Device ",
- "5.2.2" => "16.06.2018 compatibility to SSCamSTRM V 1.1.0 ",
- "5.2.1" => "14.06.2018 design change of SSCam_StreamDev, change in event generation for SSCam_StreamDev, fix global vars ",
- "5.2.0" => "14.06.2018 support longpoll refresh of SSCamSTRM-Devices ",
- "5.1.0" => "13.06.2018 more control elements (Start/Stop Recording, Take Snapshot) in func SSCam_StreamDev, control of detaillink is moved to SSCamSTRM-device ",
- "5.0.1" => "12.06.2018 control of page refresh improved (for e.g. Floorplan,Dashboard) ",
- "5.0.0" => "11.06.2018 HLS Streaming, Buttons for Streaming-Devices, use of module SSCamSTRM for Streaming-Devices, deletion of Streaming-devices if SSCam-device is deleted, some more improvements, minor bugfixes ",
- "4.3.0" => "27.05.2018 HLS preparation changed ",
- "4.2.0" => "22.05.2018 PTZ-Panel integrated to created StreamDevice ",
- "4.1.0" => "05.05.2018 use SYNO.SurveillanceStation.VideoStream instead of SYNO.SurveillanceStation.VideoStreaming, preparation for hls ",
- "4.0.0" => "01.05.2018 AudioStream possibility added ",
- "3.10.0" => "24.04.2018 createStreamDev added, new features lastrec_fw_MJPEG, lastrec_fw_MPEG4/H.264 added to playback MPEG4/H.264 videos ",
- "3.9.2" => "21.04.2018 minor fixes ",
- "3.9.1" => "20.04.2018 Attribute ptzPanel_use, initial webcommands in DeviceOverview changed, minor fixes ptzPanel ",
- "3.9.0" => "17.04.2018 control panel & PTZcontrol weblink device for PTZ cams ",
- "3.8.4" => "06.04.2018 Internal MODEL changed to SVS or \"CamVendor - CamModel\" for Cams ",
- "3.8.3" => "05.04.2018 bugfix V3.8.2, \$OpMode \"Start\" changed, composegallery changed ",
- "3.8.2" => "04.04.2018 \$attr replaced by AttrVal, SSCam_wdpollcaminfo redesigned ",
- "3.8.1" => "04.04.2018 some codereview like new sub SSCam_jboolmap ",
- "3.8.0" => "03.04.2018 new reading PresetHome, setHome command, minor fixes ",
- "3.7.0" => "26.03.2018 minor details of setPreset changed, new command delPreset ",
- "3.6.0" => "25.03.2018 setPreset command, changed SSCam_wdpollcaminfo, SSCam_getcaminfoall ",
- "3.5.0" => "22.03.2018 new get command listPresets ",
- "3.4.0" => "21.03.2018 new commands startTracking, stopTracking ",
- "3.3.1" => "20.03.2018 new readings CapPTZObjTracking, CapPTZPresetNumber ",
- "3.3.0" => "25.02.2018 code review, API bug fix of runview lastrec, commandref revised (forum:#84953) ",
- "1.0.0" => "12.12.2015 initial, changed completly to HttpUtils_NonblockingGet "
-);
-
-# Versions History extern
-our %SSCam_vNotesExtern = (
- "7.3.0" => "28.10.2018 In attribute \"livestreamprefix\" can now \"DEF\" be specified to overwrite livestream address by specification from device definition ",
- "7.2.1" => "23.10.2018 COMPATIBILITY changed to 8.2.1 ",
- "7.2.0" => "20.10.2018 direct help for attributes, new get versionNotes command, please see commandref for details ",
- "7.1.1" => "18.10.2018 Message of \"current/simulated SVS-version...\" changed, commandref corrected ",
- "7.1.0" => "02.09.2018 PIR Sensor enable/disable, SSCam_Set/SSCam_Get optimized ",
- "7.0.1" => "27.08.2018 enable/disable issue (https://forum.fhem.de/index.php/topic,45671.msg830869.html#msg830869) ",
- "7.0.0" => "27.07.2018 compatibility to API v2.8 ",
- "6.0.1" => "04.07.2018 Reading CamFirmware ",
- "6.0.0" => "03.07.2018 HTTPS Support, buttons for refresh SSCamSTRM-devices ",
- "5.2.7" => "26.06.2018 fix state turns to \"off\" even though cam is disabled ",
- "5.2.5" => "18.06.2018 trigger lastsnap_fw to SSCamSTRM-Device only if snap was done by it. ",
- "5.2.4" => "17.06.2018 SSCam_composegallery added and write warning if old composegallery-weblink device is used ",
- "5.2.2" => "16.06.2018 compatibility to SSCamSTRM V 1.1.0 ",
- "5.2.1" => "14.06.2018 design change of SSCam_StreamDev, change in event generation for SSCam_StreamDev, fix global vars ",
- "5.2.0" => "14.06.2018 support longpoll refresh of SSCamSTRM-Devices ",
- "5.1.0" => "13.06.2018 more control elements (Start/Stop Recording, Take Snapshot) in func SSCam_StreamDev, control of detaillink is moved to SSCamSTRM-device ",
- "5.0.1" => "12.06.2018 control of page refresh improved (for e.g. Floorplan,Dashboard) ",
- "4.2.0" => "22.05.2018 PTZ-Panel integrated to created StreamDevice ",
- "4.0.0" => "01.05.2018 AudioStream possibility added ",
- "3.10.0" => "24.04.2018 createStreamDev added, new features lastrec_fw_MJPEG, lastrec_fw_MPEG4/H.264 added to playback MPEG4/H.264 videos ",
- "3.9.1" => "20.04.2018 Attribute ptzPanel_use, initial webcommands in DeviceOverview changed, minor fixes ptzPanel ",
- "3.9.0" => "17.04.2018 control panel & PTZcontrol weblink device for PTZ cams ",
- "3.8.4" => "06.04.2018 Internal MODEL changed to SVS or \"CamVendor - CamModel\" for Cams ",
- "3.8.3" => "05.04.2018 bugfix V3.8.2, \$OpMode \"Start\" changed, composegallery changed ",
- "3.6.0" => "25.03.2018 setPreset command ",
- "3.5.0" => "22.03.2018 new get command listPresets ",
- "3.4.0" => "21.03.2018 new commands startTracking, stopTracking ",
- "3.3.1" => "20.03.2018 new readings CapPTZObjTracking, CapPTZPresetNumber ",
- "3.3.0" => "25.02.2018 code review, API bug fix of runview lastrec, commandref revised (forum:#84953) ",
- "3.2.4" => "18.11.2017 fix bug don't retrieve SSCam_getptzlistpreset if cam is disabled ",
- "3.2.3" => "08.10.2017 set optimizeParams, get caminfo (simple), minor bugfix, commandref revised ",
- "3.2.0" => "27.09.2017 new command get listLog, change to \$hash->{HELPER}{\".SNAPHASH\"} for avoid huge \"list\"-report ",
- "3.1.0" => "26.09.2017 move extevent from CAM to SVS model, Reading PollState enhanced for CAM-Model, minor fixes ",
- "3.0.0" => "23.09.2017 Internal MODEL SVS or CAM -> distinguish/support Cams and SVS in different devices new comand get storedCredentials, commandref revised ",
- "2.9.0" => "20.09.2017 new function get homeModeState, minor fixes at simu_SVSversion, commandref revised ",
- "2.6.0" => "06.08.2017 new command createSnapGallery ",
- "2.5.4" => "05.08.2017 analyze \$hash->{CL} in SetFn bzw. GetFn, set snapGallery only if snapGalleryBoost=1 is set, some snapGallery improvements and fixes ",
- "2.5.3" => "02.08.2017 implement snapGallery as set-command ",
- "2.2.2" => "11.06.2017 bugfix SSCam_login, SSCam_login_return, Forum: https://forum.fhem.de/index.php/topic,45671.msg646701.html#msg646701 ",
- "1.39.0" => "20.01.2017 compatibility to SVS 8.0.0, Version in Internals, execute SSCam_getsvsinfo after set credentials ",
- "1.37.0" => "10.10.2016 bugfix Experimental keys on scalar is now forbidden (Perl >= 5.23) (Forum: #msg501709) ",
- "1.34.0" => "15.09.2016 simu_SVSversion changed, added 407 errorcode message, external recording changed for SVS 7.2 ",
- "1.33.0" => "21.08.2016 function get stmUrlPath added, fit to new commandref style, attribute showStmInfoFull added ",
- "1.31.0" => "15.08.2016 Attr \"noQuotesForSID\" added, avoid possible 402 - permission denied problems in some SVS/DS-combinations ",
- "1.28.0" => "30.06.2016 Attr \"showPassInLog\" added, per default no password will be shown in log ",
- "1.27.0" => "29.06.2016 Attr \"simu_SVSversion\" added, sub login_nonbl changed, sub camret_nonbl changed (getlistptzpreset) due to 7.2 problem ",
- "1.26.2" => "05.05.2016 change: get \"snapfileinfo\" will get back an Infomessage if Reading \"LastSnapId\" isn't available ",
- "1.26.1" => "27.04.2016 bugfix module will not load due to Unknown warnings category 'experimental' when using an older perl version ",
- "1.26.0" => "22.04.2016 Attribute \"disable\" to deactivate the module added ",
- "1.25.0" => "18.04.2016 motion detection parameters can be entered if motion detection by camera or SVS is used ",
- "1.24.0" => "16.04.2016 behavior of \"set ... on\" changed, Attr \"recextend\" added, bugfix: setstate-warning if FHEM will restarted and SVS is not reachable (Forum: #308) ",
- "1.22.0" => "27.03.2016 bugfix \"link_open\" doesn't work after last update ",
- "1.21.0" => "23.03.2016 added \"lastrec\", \"lastrec_open\" to playback last recording ",
- "1.20.0" => "09.03.2016 command \"extevent\" added ",
- "1.19.3" => "07.03.2016 bugfix \"uninitialized value \$lastrecstarttime\", \"uninitialized value \$lastrecstoptime\", new attribute \"videofolderMap\" ",
- "1.19.2" => "06.03.2016 Reading \"CamLastRec\" added which contains Path/name of last recording ",
- "1.19.1" => "28.02.2016 enhanced command runView by option \"link_open\" to open a streamlink immediately ",
- "1.19.0" => "25.02.2016 functions for cam-livestream added ",
- "1.18.1" => "21.02.2016 fixed a problem that the state is \"disable\" instead of \"disabled\" if a camera is disabled and FHEM will be restarted ",
- "1.18.0" => "20.02.2016 function \"get ... eventlist\" added, Reading \"CamEventNum\" added which containes total number of camera events, change usage of reading \"LastUpdateTime\" ",
- "1.17.0" => "19.02.2016 function \"runPatrol\" added that starts predefined patrols of PTZ-cameras, Reading \"CamDetMotSc\" added ",
- "1.16.0" => "16.02.2016 set up of motion detection source now possible ",
- "1.15.0" => "15.02.2016 control of exposure mode day, night & auto is possible now ",
- "1.14.0" => "14.02.2016 The port in DEF-String is optional now, if not given, default port 5000 is used ",
- "1.13.2" => "13.02.2016 fixed a problem that manual updates using \"getcaminfoall\" are leading to additional pollingloops if polling is used, attribute \"debugactivetoken\" added for debugging-use ",
- "1.13.1" => "12.02.2016 fixed a problem that a usersession won't be destroyed if a function couldn't be executed successfully ",
- "1.12.0" => "08.02.2016 added function \"move\" for continuous PTZ action ",
- "1.11.0" => "05.02.2016 added function \"goPreset\" and \"goAbsPTZ\" to control the move of PTZ lense to absolute positions (http://forum.fhem.de/index.php/topic,45671.msg404275.html#msg404275), (http://forum.fhem.de/index.php/topic,45671.msg404892.html#msg404892) ",
- "1.10.0" => "02.02.2016 added function \"svsinfo\" to get informations about installed SVS-package, if Availability = \"disconnected\" then \"state\"-value will be \"disconnected\" too, saved Credentials were deleted from file if a device will be deleted ",
- "1.7.0" => "18.01.2016 Attribute \"httptimeout\" added ",
- "1.6.0" => "16.01.2016 Change the define-string related to rectime. (http://forum.fhem.de/index.php/topic,45671.msg391664.html#msg391664) ",
- "1.5.1" => "11.01.2016 Vars \"USERNAME\" and \"RECTIME\" removed from internals, Var (Internals) \"SERVERNAME\" changed to \"SERVERADDR\" ",
- "1.5.0" => "04.01.2016 Function \"Get\" for creating Camera-Readings integrated, Attributs pollcaminfoall, pollnologging added, Function for Polling Cam-Infos added. ",
- "1.4.0" => "23.12.2015 function \"enable\" and \"disable\" for SS-Cams added, changed timout of Http-calls to a higher value ",
- "1.3.0" => "19.12.2015 function \"snap\" for taking snapshots added, fixed a bug that functions may impact each other ",
- "1.0.0" => "12.12.2015 initial, changed completly to HttpUtils_NonblockingGet "
-);
-
-# Hint Hash en
-our %SSCam_vHintsExt_en = (
- "5" => "Find more Informations about manage users and the appropriate privilege profiles in ".
- "Surveillance Station online help ",
- "4" => "The message Meldung \"WARNING - The current/simulated SVS-version ... may be incompatible with SSCam version...\" means that ".
- "the used SSCam version was currently not tested with the installed version of Synology Surveillance Station (Reading \"SVSversion\"). ".
- "The compatible SVS-Version is printed out in the Internal COMPATIBILITY.\n".
- "Actions: At first please update your SSCam version. If the message does appear furthermore, please inform the SSCam Maintainer. ".
- "To ignore this message temporary, you may reduce the verbose level of your SSCam device. ",
- "3" => "Link to SSCam english commandRef ",
- "2" => "You can create own PTZ-control icons with a template available in SVN which can be downloaded here: contrib/sscam/black_btn_CAM_Template.pdn.\n".
- "This template can be edited with Paint.Net for example. ",
- "1" => "Some helpful FHEM-Wiki notes"
-);
-
-# Hint Hash de
-our %SSCam_vHintsExt_de = (
- "5" => "Informationen zum Management von Usern und entsprechenden Rechte-Profilen sind in der ".
- "Surveillance Station Online-Hilfe zu finden.",
-
- "4" => "Die Meldung \"WARNING - The current/simulated SVS-version ... may be incompatible with SSCam version...\" ist ein Hinweis darauf, dass ".
- "die eingesetzte SSCam Version noch nicht mit der verwendeten Version von Synology Surveillance Station (Reading \"SVSversion\") getestet ".
- "wurde. Die kompatible SVS-Version ist im Internal COMPATIBILITY ersichtlich.\n".
- "Maßnahmen: Bitte SSCam zunächst updaten. Sollte die Meldung weiterhin auftreten, bitte den SSCam Maintainer informieren. Zur ".
- "vorübergehenden Ignorierung kann der verbose Level des SSCam-Devices entsprechend reduziert werden. ",
- "3" => "Link zur deutschen SSCam commandRef ",
- "2" => "Zur Erstellung eigener PTZ-Steuericons gibt es eine Vorlage im SVN die hier contrib/sscam/black_btn_CAM_Template.pdn heruntergeladen werden kann.\n".
- "Diese Vorlage kann zum Beispiel mit Paint.Net bearbeitet werden. ",
- "1" => "Hilfreiche Hinweise zu SSCam im FHEM-Wiki"
-);
-
-# getestete SVS-Version
-my $compstat = "8.2.1";
-
-# Aufbau Errorcode-Hashes (siehe Surveillance Station Web API)
-my %SSCam_errauthlist = (
- 100 => "Unknown error",
- 101 => "The account parameter is not specified",
- 102 => "API does not exist",
- 400 => "Invalid user or password",
- 401 => "Guest or disabled account",
- 402 => "Permission denied - DSM-Session: make sure user is member of Admin-group, SVS-Session: make sure SVS package is started, make sure FHEM-Server IP won't be blocked in DSM automated blocking list",
- 403 => "One time password not specified",
- 404 => "One time password authenticate failed",
- 405 => "method not allowd - maybe the password is too long",
- 407 => "Permission denied - make sure FHEM-Server IP won't be blocked in DSM automated blocking list",
-);
-
-my %SSCam_errlist = (
- 100 => "Unknown error",
- 101 => "Invalid parameters",
- 102 => "API does not exist",
- 103 => "Method does not exist",
- 104 => "This API version is not supported",
- 105 => "Insufficient user privilege",
- 106 => "Connection time out",
- 107 => "Multiple login detected",
- 117 => "need manager rights in SurveillanceStation for operation",
- 400 => "Execution failed",
- 401 => "Parameter invalid",
- 402 => "Camera disabled",
- 403 => "Insufficient license",
- 404 => "Codec activation failed",
- 405 => "CMS server connection failed",
- 407 => "CMS closed",
- 410 => "Service is not enabled",
- 412 => "Need to add license",
- 413 => "Reach the maximum of platform",
- 414 => "Some events not exist",
- 415 => "message connect failed",
- 417 => "Test Connection Error",
- 418 => "Object is not exist",
- 419 => "Visualstation name repetition",
- 439 => "Too many items selected",
- 502 => "Camera disconnected",
- 600 => "Presetname and PresetID not found in Hash",
-);
-
-# Standardvariablen
-my $SSCam_slim = 3; # default Anzahl der abzurufenden Schnappschüsse mit snapGallery
-my $SSCAM_snum = "1,2,3,4,5,6,7,8,9,10"; # mögliche Anzahl der abzurufenden Schnappschüsse mit snapGallery
-
-use vars qw($FW_ME); # webname (default is fhem), used by 97_GROUP/weblink
-use vars qw($FW_subdir); # Sub-path in URL, used by FLOORPLAN/weblink
-use vars qw($FW_room); # currently selected room
-use vars qw($FW_detail); # currently selected device for detail view
-
-sub SSCam_Initialize($) {
- my ($hash) = @_;
- $hash->{DefFn} = "SSCam_Define";
- $hash->{UndefFn} = "SSCam_Undef";
- $hash->{DeleteFn} = "SSCam_Delete";
- $hash->{SetFn} = "SSCam_Set";
- $hash->{GetFn} = "SSCam_Get";
- $hash->{AttrFn} = "SSCam_Attr";
- # Aufrufe aus FHEMWEB
- $hash->{FW_summaryFn} = "SSCam_FWsummaryFn";
- $hash->{FW_detailFn} = "SSCam_FWdetailFn";
- $hash->{FW_deviceOverview} = 1;
-
- $hash->{AttrList} =
- "disable:1,0 ".
- "genericStrmHtmlTag ".
- "httptimeout ".
- "htmlattr ".
- "livestreamprefix ".
- "loginRetries:1,2,3,4,5,6,7,8,9,10 ".
- "videofolderMap ".
- "pollcaminfoall ".
- "snapGalleryBoost:0,1 ".
- "snapGallerySize:Icon,Full ".
- "snapGalleryNumber:$SSCAM_snum ".
- "snapGalleryColumns ".
- "snapGalleryHtmlAttr ".
- "pollnologging:1,0 ".
- "debugactivetoken:1,0 ".
- "rectime ".
- "recextend:1,0 ".
- "noQuotesForSID:1,0 ".
- "session:SurveillanceStation,DSM ".
- "showPassInLog:1,0 ".
- "showStmInfoFull:1,0 ".
- "simu_SVSversion:7.2-xxxx,7.1-xxxx,8.0.0-xxxx,8.1.5-xxxx,8.2.0-xxxx ".
- "webCmd ".
- $readingFnAttributes;
-
-return undef;
-}
-
-################################################################
-sub SSCam_Define($@) {
- # Die Define-Funktion eines Moduls wird von Fhem aufgerufen wenn der Define-Befehl für ein Gerät ausgeführt wird
- # Welche und wie viele Parameter akzeptiert werden ist Sache dieser Funktion. Die Werte werden nach dem übergebenen Hash in ein Array aufgeteilt
- # define CamCP1 SSCAM Carport 192.168.2.20 [5000]
- # ($hash) [1] [2] [3] [4]
- #
- my ($hash, $def) = @_;
- my $name = $hash->{NAME};
-
- return "Error: Perl module ".$SScamMMDBI." is missing. Install it on Debian with: sudo apt-get install libjson-perl" if($SScamMMDBI);
-
- my @a = split("[ \t][ \t]*", $def);
-
- if(int(@a) < 4) {
- return "You need to specify more parameters.\n". "Format: define SSCAM [Port]";
- }
-
- my $camname = $a[2];
- my $serveraddr = $a[3];
- my $serverport = $a[4] ? $a[4] : 5000;
- my $proto = $a[5] ? lc($a[5]) : "http";
-
- $hash->{SERVERADDR} = $serveraddr;
- $hash->{SERVERPORT} = $serverport;
- $hash->{CAMNAME} = $camname;
- $hash->{VERSION} = (reverse sort(keys %SSCam_vNotesIntern))[0];
- $hash->{MODEL} = ($camname =~ m/^SVS$/i)?"SVS":"CAM"; # initial, CAM wird später ersetzt durch CamModel
- $hash->{PROTOCOL} = $proto;
- $hash->{COMPATIBILITY} = $compstat; # getestete SVS-version Kompatibilität
-
- # benötigte API's in $hash einfügen
- $hash->{HELPER}{APIINFO} = "SYNO.API.Info"; # Info-Seite für alle API's, einzige statische Seite !
- $hash->{HELPER}{APIAUTH} = "SYNO.API.Auth"; # API used to perform session login and logout
- $hash->{HELPER}{APISVSINFO} = "SYNO.SurveillanceStation.Info";
- $hash->{HELPER}{APIEVENT} = "SYNO.SurveillanceStation.Event";
- $hash->{HELPER}{APIEXTREC} = "SYNO.SurveillanceStation.ExternalRecording";
- $hash->{HELPER}{APIEXTEVT} = "SYNO.SurveillanceStation.ExternalEvent";
- $hash->{HELPER}{APICAM} = "SYNO.SurveillanceStation.Camera"; # stark geändert ab API v2.8
- $hash->{HELPER}{APISNAPSHOT} = "SYNO.SurveillanceStation.SnapShot";
- $hash->{HELPER}{APIPTZ} = "SYNO.SurveillanceStation.PTZ";
- $hash->{HELPER}{APIPRESET} = "SYNO.SurveillanceStation.PTZ.Preset";
- $hash->{HELPER}{APICAMEVENT} = "SYNO.SurveillanceStation.Camera.Event";
- $hash->{HELPER}{APIVIDEOSTM} = "SYNO.SurveillanceStation.VideoStreaming"; # verwendet in Response von "SYNO.SurveillanceStation.Camera: GetLiveViewPath" -> StreamKey-Methode
- # $hash->{HELPER}{APISTM} = "SYNO.SurveillanceStation.Streaming"; # provides methods to get Live View or Event video stream, removed in API v2.8
- $hash->{HELPER}{APISTM} = "SYNO.SurveillanceStation.Stream"; # Beschreibung ist falsch und entspricht "SYNO.SurveillanceStation.Streaming" auch noch ab v2.8
- $hash->{HELPER}{APIHM} = "SYNO.SurveillanceStation.HomeMode";
- $hash->{HELPER}{APILOG} = "SYNO.SurveillanceStation.Log";
- $hash->{HELPER}{APIAUDIOSTM} = "SYNO.SurveillanceStation.AudioStream"; # Audiostream mit SID, removed in API v2.8
- $hash->{HELPER}{APIVIDEOSTMS} = "SYNO.SurveillanceStation.VideoStream"; # Videostream mit SID, removed in API v2.8
-
- # Startwerte setzen
- if(SSCam_IsModelCam($hash)) {
- $attr{$name}{webCmd} = "on:off:snap:enable:disable:runView:stopView"; # initiale Webkommandos setzen
- } else {
- $attr{$name}{webCmd} = "homeMode";
- $attr{$name}{webCmdLabel} = "HomeMode";
- }
- $hash->{HELPER}{ACTIVE} = "off"; # Funktionstoken "off", Funktionen können sofort starten
- $hash->{HELPER}{OLDVALPOLLNOLOGGING} = "0"; # Loggingfunktion für Polling ist an
- $hash->{HELPER}{OLDVALPOLL} = "0";
- $hash->{HELPER}{RECTIME_DEF} = "15"; # Standard für rectime setzen, überschreibbar durch Attribut "rectime" bzw. beim "set .. on-for-time"
- $hash->{HELPER}{OLDPTZHOME} = "";
- $hash->{".ptzhtml"} = "";
- $hash->{HELPER}{HLSSTREAM} = "inactive"; # Aktivitätsstatus HLS-Streaming
- $hash->{HELPER}{SNAPLIMIT} = 0; # abgerufene Anzahl Snaps
- $hash->{HELPER}{TOTALCNT} = 0; # totale Anzahl Snaps
-
- readingsBeginUpdate($hash);
- readingsBulkUpdate($hash,"PollState","Inactive"); # es ist keine Gerätepolling aktiv
- if(SSCam_IsModelCam($hash)) {
- readingsBulkUpdate($hash,"Availability", "???"); # Verfügbarkeit ist unbekannt
- readingsBulkUpdate($hash,"state", "off"); # Init für "state" , Problemlösung für setstate, Forum #308
- } else {
- readingsBulkUpdate($hash,"state", "Initialized"); # Init für "state" wenn SVS
- }
- readingsEndUpdate($hash,1);
-
- SSCam_getcredentials($hash,1); # Credentials lesen und in RAM laden ($boot=1)
-
- # initiale Routinen nach Restart ausführen , verzögerter zufälliger Start
- RemoveInternalTimer($hash, "SSCam_initonboot");
- InternalTimer(gettimeofday()+int(rand(30)), "SSCam_initonboot", $hash, 0);
-
-return undef;
-}
-
-################################################################
-sub SSCam_Undef($$) {
- my ($hash, $arg) = @_;
- SSCam_logout($hash);
- RemoveInternalTimer($hash);
-return undef;
-}
-
-################################################################
-sub SSCam_Delete($$) {
- my ($hash, $arg) = @_;
- my $index = $hash->{TYPE}."_".$hash->{NAME}."_credentials";
- my $name = $hash->{NAME};
-
- # gespeicherte Credentials löschen
- setKeyValue($index, undef);
-
- # löschen snapGallerie-Device falls vorhanden
- my $sgdev = "SSCam.$hash->{NAME}.snapgallery";
- CommandDelete($hash->{CL},"$sgdev");
-
- # alle Streaming-Devices löschen falls vorhanden
- CommandDelete($hash->{CL},"TYPE=SSCamSTRM:FILTER=PARENT=$name");
-
-return undef;
-}
-
-################################################################
-sub SSCam_Attr($$$$) {
- my ($cmd,$name,$aName,$aVal) = @_;
- my $hash = $defs{$name};
- my ($do,$val);
-
- # $cmd can be "del" or "set"
- # $name is device name
- # aName and aVal are Attribute name and value
-
- # dynamisch PTZ-Attribute setzen (wichtig beim Start wenn Reading "DeviceType" nicht gesetzt ist)
- if ($cmd eq "set" && ($aName =~ m/ptzPanel_.*/)) {
- foreach my $n (0..9) {
- $n = sprintf("%2.2d",$n);
- addToDevAttrList($name, "ptzPanel_row$n");
- }
- addToDevAttrList($name, "ptzPanel_iconPrefix");
- addToDevAttrList($name, "ptzPanel_iconPath");
- }
-
- if($aName =~ m/ptzPanel_row.*|ptzPanel_Home|ptzPanel_use/) {
- InternalTimer(gettimeofday()+0.7, "SSCam_addptzattr", "$name", 0);
- }
-
- if ($aName eq "disable") {
- if($cmd eq "set") {
- $do = ($aVal) ? 1 : 0;
- }
- $do = 0 if($cmd eq "del");
- if(SSCam_IsModelCam($hash)) {
- $val = ($do == 1 ? "inactive" : "off");
- } else {
- $val = ($do == 1 ? "disabled" : "initialized");
- }
-
- readingsSingleUpdate($hash, "state", $val, 1);
- readingsSingleUpdate($hash, "PollState", "Inactive", 1) if($do == 1);
- readingsSingleUpdate($hash, "Availability", "???", 1) if($do == 1 && SSCam_IsModelCam($hash));
- }
-
- if ($aName eq "showStmInfoFull") {
- if($cmd eq "set") {
- $do = ($aVal) ? 1 : 0;
- }
- $do = 0 if($cmd eq "del");
-
- if ($do == 0) {
- delete($defs{$name}{READINGS}{StmKeymjpegHttp});
- delete($defs{$name}{READINGS}{LiveStreamUrl});
- delete($defs{$name}{READINGS}{StmKeyUnicst});
- delete($defs{$name}{READINGS}{StmKeyUnicstOverHttp});
- delete($defs{$name}{READINGS}{StmKeymxpegHttp});
- }
- }
-
- if ($aName eq "snapGallerySize") {
- if($cmd eq "set") {
- $do = ($aVal eq "Icon")?1:2;
- }
- $do = 0 if($cmd eq "del");
-
- if ($do == 0) {
- delete($hash->{HELPER}{".SNAPHASH"}) if(AttrVal($name,"snapGalleryBoost",0)); # Snaphash nur löschen wenn Snaps gepollt werden
- Log3($name, 4, "$name - Snapshot hash deleted");
- } elsif (AttrVal($name,"snapGalleryBoost",0)) {
- # snap-Infos abhängig ermitteln wenn gepollt werden soll
- my ($slim,$ssize);
- $hash->{HELPER}{GETSNAPGALLERY} = 1;
- $slim = AttrVal($name,"snapGalleryNumber",$SSCam_slim); # Anzahl der abzurufenden Snaps
- $ssize = $do;
- RemoveInternalTimer("SSCam_getsnapinfo");
- InternalTimer(gettimeofday()+0.7, "SSCam_getsnapinfo", "$name:$slim:$ssize", 0);
- }
- }
-
- if ($aName eq "snapGalleryBoost") {
- if($cmd eq "set") {
- $do = ($aVal == 1)?1:0;
- }
- $do = 0 if($cmd eq "del");
-
- if ($do == 0) {
- delete($hash->{HELPER}{".SNAPHASH"}); # Snaphash löschen
- Log3($name, 4, "$name - Snapshot hash deleted");
-
- } else {
- # snapgallery regelmäßig neu einlesen wenn Polling ein
- return "When you want activate \"snapGalleryBoost\", you have to set the attribute \"pollcaminfoall\" first because the functionality depends on retrieving snapshots periodical."
- if(!AttrVal($name,"pollcaminfoall",0));
-
- my ($slim,$ssize);
- $hash->{HELPER}{GETSNAPGALLERY} = 1;
- $slim = AttrVal($name,"snapGalleryNumber",$SSCam_slim); # Anzahl der abzurufenden Snaps
- my $sg = AttrVal($name,"snapGallerySize","Icon"); # Auflösung Image
- $ssize = ($sg eq "Icon")?1:2;
- RemoveInternalTimer("SSCam_getsnapinfo");
- InternalTimer(gettimeofday()+0.7, "SSCam_getsnapinfo", "$name:$slim:$ssize", 0);
- }
- }
-
- if ($aName eq "snapGalleryNumber" && AttrVal($name,"snapGalleryBoost",0)) {
- my ($slim,$ssize);
- if($cmd eq "set") {
- $do = ($aVal != 0)?1:0;
- }
- $do = 0 if($cmd eq "del");
-
- if ($do == 0) {
- $slim = 3;
- } else {
- $slim = $aVal;
- }
-
- $hash->{HELPER}{GETSNAPGALLERY} = 1;
- my $sg = AttrVal($name,"snapGallerySize","Icon"); # Auflösung Image
- $ssize = ($sg eq "Icon")?1:2;
- RemoveInternalTimer("SSCam_getsnapinfo");
- InternalTimer(gettimeofday()+0.7, "SSCam_getsnapinfo", "$name:$slim:$ssize", 0);
- }
-
- if ($aName eq "simu_SVSversion") {
- delete $hash->{HELPER}{APIPARSET};
- delete $hash->{HELPER}{SID};
- delete $hash->{CAMID};
- RemoveInternalTimer($hash, "SSCam_getcaminfoall");
- InternalTimer(gettimeofday()+0.5, "SSCam_getcaminfoall", $hash, 0);
- }
-
- if($aName =~ m/pollcaminfoall/ && $init_done == 1) {
- RemoveInternalTimer($hash, "SSCam_getcaminfoall");
- InternalTimer(gettimeofday()+1.0, "SSCam_getcaminfoall", $hash, 0);
- RemoveInternalTimer($hash, "SSCam_wdpollcaminfo");
- InternalTimer(gettimeofday()+1.5, "SSCam_wdpollcaminfo", $hash, 0);
- }
-
- if($aName =~ m/pollnologging/ && $init_done == 1) {
- RemoveInternalTimer($hash, "SSCam_wdpollcaminfo");
- InternalTimer(gettimeofday()+1.0, "SSCam_wdpollcaminfo", $hash, 0);
- }
-
- if ($cmd eq "set") {
- if ($aName =~ m/httptimeout|snapGalleryColumns|rectime|pollcaminfoall/) {
- unless ($aVal =~ /^\d+$/) { return " The Value for $aName is not valid. Use only figures 1-9 !";}
- }
- if($aName =~ m/pollcaminfoall/) {
- return "The value of \"$aName\" has to be greater than 10 seconds." if($aVal <= 10);
- }
- }
-
- if ($cmd eq "del") {
- if ($aName =~ m/pollcaminfoall/ ) {
- # Polling nicht ausschalten wenn snapGalleryBoost ein (regelmäßig neu einlesen)
- return "Please switch off \"snapGalleryBoost\" first if you want to deactivate \"pollcaminfoall\" because the functionality of \"snapGalleryBoost\" depends on retrieving snapshots periodical."
- if(AttrVal($name,"snapGalleryBoost",0));
- }
- }
-
-return undef;
-}
-
-################################################################
-sub SSCam_Set($@) {
- my ($hash, @a) = @_;
- return "\"set X\" needs at least an argument" if ( @a < 2 );
- my $name = $a[0];
- my $opt = $a[1];
- my $prop = $a[2];
- my $prop1 = $a[3];
- my $prop2 = $a[4];
- my $prop3 = $a[5];
- my $camname = $hash->{CAMNAME};
- my $success;
- my $setlist;
- my @prop;
-
- return if(IsDisabled($name));
-
- if(!$hash->{CREDENTIALS}) {
- # initiale setlist für neue Devices
- $setlist = "Unknown argument $opt, choose one of ".
- "credentials "
- ;
- } elsif(SSCam_IsModelCam($hash)) {
- # selist für Cams
- my $hlslfw = SSCam_IsHLSCap($hash)?",live_fw_hls,":",";
- $setlist = "Unknown argument $opt, choose one of ".
- "credentials ".
- ((ReadingsVal("$name", "CapPTZPan", "false") ne "false") ? "delPreset:".ReadingsVal("$name","Presets","")." " : "").
- "expmode:auto,day,night ".
- "on ".
- "off:noArg ".
- "motdetsc:disable,camera,SVS ".
- "snap:noArg ".
- (AttrVal($name, "snapGalleryBoost",0)?(AttrVal($name,"snapGalleryNumber",undef) || AttrVal($name,"snapGalleryBoost",0))?"snapGallery:noArg ":"snapGallery:$SSCAM_snum ":" ").
- "createSnapGallery:noArg ".
- "createStreamDev:generic,mjpeg,switched ".
- ((ReadingsVal("$name", "CapPTZPan", "false") ne "false") ? "createPTZcontrol:noArg ": "").
- "enable:noArg ".
- "disable:noArg ".
- "optimizeParams ".
- ((ReadingsVal("$name", "CapPIR", "false") ne "false") ? "pirSensor:activate,deactivate ": "").
- "runView:live_fw".$hlslfw."live_link,live_open,lastrec_fw,lastrec_fw_MJPEG,lastrec_fw_MPEG4/H.264,lastrec_open,lastsnap_fw ".
- ((ReadingsVal("$name", "CapPTZPan", "false") ne "false") ? "setPreset ": "").
- ((ReadingsVal("$name", "CapPTZPan", "false") ne "false") ? "setHome:---currentPosition---,".ReadingsVal("$name","Presets","")." " : "").
- "stopView:noArg ".
- ((ReadingsVal("$name", "CapPTZObjTracking", "false") ne "false") ? "startTracking:noArg " : "").
- ((ReadingsVal("$name", "CapPTZObjTracking", "false") ne "false") ? "stopTracking:noArg " : "").
- ((ReadingsVal("$name", "CapPTZDirections", 0) > 0) ? "move"." " : "").
- ((ReadingsVal("$name", "CapPTZPan", "false") ne "false") ? "runPatrol:".ReadingsVal("$name", "Patrols", "")." " : "").
- ((ReadingsVal("$name", "CapPTZPan", "false") ne "false") ? "goPreset:".ReadingsVal("$name", "Presets", "")." " : "").
- ((ReadingsVal("$name", "CapPTZAbs", "false") ne "false") ? "goAbsPTZ"." " : "").
- ((ReadingsVal("$name", "CapPTZDirections", 0) > 0) ? "move"." " : "");
- } else {
- # setlist für SVS Devices
- $setlist = "Unknown argument $opt, choose one of ".
- "credentials ".
- "extevent:1,2,3,4,5,6,7,8,9,10 ".
- ($hash->{HELPER}{APIHMMAXVER}?"homeMode:on,off ": "");
- }
-
- if ($opt eq "credentials") {
- return "Credentials are incomplete, use username password" if (!$prop || !$prop1);
- return "Password is too long. It is limited up to and including 20 characters." if (length $prop1 > 20);
- delete $hash->{HELPER}{SID} if($hash->{HELPER}{SID});
- ($success) = SSCam_setcredentials($hash,$prop,$prop1);
- $hash->{HELPER}{ACTIVE} = "off";
-
- if($success) {
- SSCam_getcaminfoall($hash,0);
- RemoveInternalTimer($hash, "SSCam_getptzlistpreset");
- InternalTimer(gettimeofday()+11, "SSCam_getptzlistpreset", $hash, 0);
- RemoveInternalTimer($hash, "SSCam_getptzlistpatrol");
- InternalTimer(gettimeofday()+12, "SSCam_getptzlistpatrol", $hash, 0);
- SSCam_versionCheck($hash);
- return "Username and Password saved successfully";
- } else {
- return "Error while saving Username / Password - see logfile for details";
- }
-
- }
-
- if ($opt eq "on" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- if (defined($prop)) {
- unless ($prop =~ /^\d+$/) { return " The Value for \"$opt\" is not valid. Use only figures 0-9 without decimal places !";}
- $hash->{HELPER}{RECTIME_TEMP} = $prop;
- }
- SSCam_camstartrec($hash);
-
- } elsif ($opt eq "off" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- SSCam_camstoprec($hash);
-
- } elsif ($opt eq "snap" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- $hash->{HELPER}{SNAPBYSTRMDEV} = 1 if ($prop); # $prop wird mitgegeben durch Snap by SSCamSTRM-Device
- SSCam_camsnap($hash);
-
- } elsif ($opt eq "startTracking" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- if ($hash->{HELPER}{APIPTZMAXVER} < 5) {return "Function \"$opt\" needs a higher version of Surveillance Station";}
- SSCam_starttrack($hash);
-
- } elsif ($opt eq "stopTracking" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- if ($hash->{HELPER}{APIPTZMAXVER} < 5) {return "Function \"$opt\" needs a higher version of Surveillance Station";}
- SSCam_stoptrack($hash);
-
- } elsif ($opt eq "snapGallery" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- my $ret = SSCam_getclhash($hash);
- return $ret if($ret);
-
- if(!AttrVal($name, "snapGalleryBoost",0)) {
- # Snaphash ist nicht vorhanden und wird neu abgerufen und ausgegeben
- $hash->{HELPER}{GETSNAPGALLERY} = 1;
-
- # snap-Infos für Gallerie abrufen
- my ($sg,$slim,$ssize);
- $slim = $prop?AttrVal($name,"snapGalleryNumber",$prop):AttrVal($name,"snapGalleryNumber",$SSCam_slim); # Anzahl der abzurufenden Snapshots
- $ssize = (AttrVal($name,"snapGallerySize","Icon") eq "Icon")?1:2; # Image Size 1-Icon, 2-Full
-
- SSCam_getsnapinfo("$name:$slim:$ssize");
-
- } else {
- # Snaphash ist vorhanden und wird zur Ausgabe aufbereitet (Polling ist aktiv)
- my $htmlCode = SSCam_composegallery($name);
- for (my $k=1; (defined($hash->{HELPER}{CL}{$k})); $k++ ) {
- if ($hash->{HELPER}{CL}{$k}->{COMP}) {
- # CL zusammengestellt (Auslösung durch Notify)
- asyncOutput($hash->{HELPER}{CL}{$k}, "$htmlCode");
- } else {
- # Output wurde über FHEMWEB ausgelöst
- return $htmlCode;
- }
- }
- delete($hash->{HELPER}{CL});
- }
-
- } elsif ($opt eq "createSnapGallery" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- my ($ret,$sgdev);
- return "Before use \"$opt\" you have to set the attribute \"snapGalleryBoost\" first due to the technology of retrieving snapshots automatically is needed."
- if(!AttrVal($name,"snapGalleryBoost",0));
- $sgdev = "SSCamSTRM.$name.snapgallery";
- $ret = CommandDefine($hash->{CL},"$sgdev SSCamSTRM {SSCam_composegallery('$name','$sgdev','snapgallery')}");
- return $ret if($ret);
- my $room = "SnapGallery";
- $attr{$sgdev}{room} = $room;
- return "Snapgallery device \"$sgdev\" created and assigned to room \"$room\".";
-
- } elsif ($opt eq "createPTZcontrol" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- my $ptzcdev = "SSCamSTRM.$name.PTZcontrol";
- my $ret = CommandDefine($hash->{CL},"$ptzcdev SSCamSTRM {SSCam_ptzpanel('$name','$ptzcdev','ptzcontrol')}");
- return $ret if($ret);
- my $room = AttrVal($name,"room","PTZcontrol");
- $attr{$ptzcdev}{room} = $room;
- $attr{$ptzcdev}{group} = $name."_PTZcontrol";
- return "PTZ control device \"$ptzcdev\" created and assigned to room \"$room\".";
-
- } elsif ($opt eq "createStreamDev" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- my ($livedev,$ret);
-
- if($prop =~ /mjpeg/) {
- $livedev = "SSCamSTRM.$name.mjpeg";
- $ret = CommandDefine($hash->{CL},"$livedev SSCamSTRM {SSCam_StreamDev('$name','$livedev','mjpeg')}");
- return $ret if($ret);
- }
- if($prop =~ /generic/) {
- $livedev = "SSCamSTRM.$name.generic";
- $ret = CommandDefine($hash->{CL},"$livedev SSCamSTRM {SSCam_StreamDev('$name','$livedev','generic')}");
- return $ret if($ret);
- }
- if($prop =~ /switched/) {
- $livedev = "SSCamSTRM.$name.switched";
- $ret = CommandDefine($hash->{CL},"$livedev SSCamSTRM {SSCam_StreamDev('$name','$livedev','switched')}");
- return $ret if($ret);
- }
-
- my $room = AttrVal($name,"room","Livestream");
- $attr{$livedev}{room} = $room;
- return "Livestream device \"$livedev\" created and assigned to room \"$room\".";
-
- } elsif ($opt eq "enable" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- SSCam_camenable($hash);
-
- } elsif ($opt eq "disable" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- SSCam_camdisable($hash);
-
- } elsif ($opt eq "motdetsc" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- if (!$prop || $prop !~ /^(disable|camera|SVS)$/) { return " \"$opt\" needs one of those arguments: disable, camera, SVS !";}
-
- $hash->{HELPER}{MOTDETSC} = $prop;
-
- if ($prop1) {
- # check ob Zahl zwischen 1 und 99
- return "invalid value for sensitivity (SVS or camera) - use number between 1 - 99" if ($prop1 !~ /^([1-9]|[1-9][0-9])*$/);
- $hash->{HELPER}{MOTDETSC_PROP1} = $prop1;
- }
- if ($prop2) {
- # check ob Zahl zwischen 1 und 99
- return "invalid value for threshold (SVS) / object size (camera) - use number between 1 - 99" if ($prop2 !~ /^([1-9]|[1-9][0-9])*$/);
- $hash->{HELPER}{MOTDETSC_PROP2} = $prop2;
- }
- if ($prop3) {
- # check ob Zahl zwischen 1 und 99
- return "invalid value for threshold (SVS) / object size (camera) - use number between 1 - 99" if ($prop3 !~ /^([1-9]|[1-9][0-9])*$/);
- $hash->{HELPER}{MOTDETSC_PROP3} = $prop3;
- }
- SSCam_cammotdetsc($hash);
-
- } elsif ($opt eq "expmode" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- unless ($prop) { return " \"$opt\" needs one of those arguments: auto, day, night !";}
-
- $hash->{HELPER}{EXPMODE} = $prop;
- SSCam_camexpmode($hash);
-
- } elsif ($opt eq "homeMode" && !SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- unless ($prop) { return " \"$opt\" needs one of those arguments: on, off !";}
-
- $hash->{HELPER}{HOMEMODE} = $prop;
- SSCam_sethomemode($hash);
-
- } elsif ($opt eq "goPreset" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- if (!$prop) {return "Function \"goPreset\" needs a \"Presetname\" as an argument";}
-
- $hash->{HELPER}{GOPRESETNAME} = $prop;
- $hash->{HELPER}{PTZACTION} = "gopreset";
- SSCam_doptzaction($hash);
-
- } elsif ($opt eq "optimizeParams" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- my %cpcl = (ntp => 1, mirror => 2, flip => 4, rotate => 8);
- SSCam_extoptpar($hash,$prop,\%cpcl) if($prop);
- SSCam_extoptpar($hash,$prop1,\%cpcl) if($prop1);
- SSCam_extoptpar($hash,$prop2,\%cpcl) if($prop2);
- SSCam_setoptpar($hash);
-
- } elsif ($opt eq "pirSensor" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- if(ReadingsVal("$name", "CapPIR", "false") eq "false") {return "Function \"$opt\" not possible. Camera \"$name\" don't have a PIR sensor."}
- if(!$prop) {return "Function \"$opt\" needs an argument";}
- $hash->{HELPER}{PIRACT} = ($prop eq "activate")?0:($prop eq "deactivate")?-1:5;
- if($hash->{HELPER}{PIRACT} == 5) {return " Illegal argument for \"$opt\" detected, use \"activate\" or \"activate\" !";}
- SSCam_piract($hash);
-
- } elsif ($opt eq "runPatrol" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- if (!$prop) {return "Function \"$opt\" needs a \"Patrolname\" as an argument";}
-
- $hash->{HELPER}{GOPATROLNAME} = $prop;
- $hash->{HELPER}{PTZACTION} = "runpatrol";
- SSCam_doptzaction($hash);
-
- } elsif ($opt eq "goAbsPTZ" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- if ($prop eq "up" || $prop eq "down" || $prop eq "left" || $prop eq "right") {
- if ($prop eq "up") {$hash->{HELPER}{GOPTZPOSX} = 320; $hash->{HELPER}{GOPTZPOSY} = 480;}
- if ($prop eq "down") {$hash->{HELPER}{GOPTZPOSX} = 320; $hash->{HELPER}{GOPTZPOSY} = 0;}
- if ($prop eq "left") {$hash->{HELPER}{GOPTZPOSX} = 0; $hash->{HELPER}{GOPTZPOSY} = 240;}
- if ($prop eq "right") {$hash->{HELPER}{GOPTZPOSX} = 640; $hash->{HELPER}{GOPTZPOSY} = 240;}
-
- $hash->{HELPER}{PTZACTION} = "goabsptz";
- SSCam_doptzaction($hash);
- return undef;
-
- } else {
- if ($prop !~ /\d+/ || $prop1 !~ /\d+/ || abs($prop) > 640 || abs($prop1) > 480) {
- return "Function \"goAbsPTZ\" needs two coordinates, posX=0-640 and posY=0-480, as arguments or use up, down, left, right instead";
- }
-
- $hash->{HELPER}{GOPTZPOSX} = abs($prop);
- $hash->{HELPER}{GOPTZPOSY} = abs($prop1);
-
- $hash->{HELPER}{PTZACTION} = "goabsptz";
- SSCam_doptzaction($hash);
-
- return undef;
- }
- return "Function \"goAbsPTZ\" needs two coordinates, posX=0-640 and posY=0-480, as arguments or use up, down, left, right instead";
-
- } elsif ($opt eq "move" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- return "PTZ version of Synology API isn't set. Use \"get $name scanVirgin\" first." if(!$hash->{HELPER}{APIPTZMAXVER});
-
- if($hash->{HELPER}{APIPTZMAXVER} <= 4) {
- if (!defined($prop) || ($prop !~ /^up$|^down$|^left$|^right$|^dir_\d$/)) {return "Function \"move\" needs an argument like up, down, left, right or dir_X (X = 0 to CapPTZDirections-1)";}
- $hash->{HELPER}{GOMOVEDIR} = $prop;
-
- } elsif ($hash->{HELPER}{APIPTZMAXVER} >= 5) {
- if (!defined($prop) || ($prop !~ /^right$|^upright$|^up$|^upleft$|^left$|^downleft$|^down$|^downright$/)) {return "Function \"move\" needs an argument like right, upright, up, upleft, left, downleft, down, downright ";}
- my %dirs = (
- right => 0,
- upright => 4,
- up => 8,
- upleft => 12,
- left => 16,
- downleft => 20,
- down => 24,
- downright => 28,
- );
- $hash->{HELPER}{GOMOVEDIR} = $dirs{$prop};
- }
-
- $hash->{HELPER}{GOMOVETIME} = defined($prop1) ? $prop1 : 1;
-
- $hash->{HELPER}{PTZACTION} = "movestart";
- SSCam_doptzaction($hash);
-
- } elsif ($opt eq "runView" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- if ($prop eq "live_open") {
- if ($prop1) {$hash->{HELPER}{VIEWOPENROOM} = $prop1;} else {delete $hash->{HELPER}{VIEWOPENROOM};}
- $hash->{HELPER}{OPENWINDOW} = 1;
- $hash->{HELPER}{WLTYPE} = "link";
- $hash->{HELPER}{ALIAS} = "LiveView";
- $hash->{HELPER}{RUNVIEW} = "live_open";
- $hash->{HELPER}{ACTSTRM} = ""; # sprechender Name des laufenden Streamtyps für SSCamSTRM
- } elsif ($prop eq "live_link") {
- $hash->{HELPER}{OPENWINDOW} = 0;
- $hash->{HELPER}{WLTYPE} = "link";
- $hash->{HELPER}{ALIAS} = "LiveView";
- $hash->{HELPER}{RUNVIEW} = "live_link";
- $hash->{HELPER}{ACTSTRM} = ""; # sprechender Name des laufenden Streamtyps für SSCamSTRM
- } elsif ($prop eq "lastrec_open") {
- if ($prop1) {$hash->{HELPER}{VIEWOPENROOM} = $prop1;} else {delete $hash->{HELPER}{VIEWOPENROOM};}
- $hash->{HELPER}{OPENWINDOW} = 1;
- $hash->{HELPER}{WLTYPE} = "link";
- $hash->{HELPER}{ALIAS} = "LastRecording";
- $hash->{HELPER}{RUNVIEW} = "lastrec_open";
- $hash->{HELPER}{ACTSTRM} = ""; # sprechender Name des laufenden Streamtyps für SSCamSTRM
- } elsif ($prop eq "lastrec_fw") { # Video in iFrame eingebettet
- $hash->{HELPER}{OPENWINDOW} = 0;
- $hash->{HELPER}{WLTYPE} = "iframe";
- $hash->{HELPER}{ALIAS} = " ";
- $hash->{HELPER}{RUNVIEW} = "lastrec";
- $hash->{HELPER}{ACTSTRM} = "last Recording"; # sprechender Name des laufenden Streamtyps für SSCamSTRM
- } elsif ($prop eq "lastrec_fw_MJPEG") { # “video/avi” – MJPEG format event
- $hash->{HELPER}{OPENWINDOW} = 0;
- $hash->{HELPER}{WLTYPE} = "image";
- $hash->{HELPER}{ALIAS} = " ";
- $hash->{HELPER}{RUNVIEW} = "lastrec";
- $hash->{HELPER}{ACTSTRM} = "last Recording"; # sprechender Name des laufenden Streamtyps für SSCamSTRM
- } elsif ($prop eq "lastrec_fw_MPEG4/H.264") { # “video/mp4” – MPEG4/H.264 format event
- $hash->{HELPER}{OPENWINDOW} = 0;
- $hash->{HELPER}{WLTYPE} = "video";
- $hash->{HELPER}{ALIAS} = " ";
- $hash->{HELPER}{RUNVIEW} = "lastrec";
- $hash->{HELPER}{ACTSTRM} = "last Recording"; # sprechender Name des laufenden Streamtyps für SSCamSTRM
- } elsif ($prop eq "live_fw") {
- $hash->{HELPER}{OPENWINDOW} = 0;
- $hash->{HELPER}{WLTYPE} = "image";
- $hash->{HELPER}{ALIAS} = " ";
- $hash->{HELPER}{RUNVIEW} = "live_fw";
- $hash->{HELPER}{ACTSTRM} = "MJPEG Livestream"; # sprechender Name des laufenden Streamtyps für SSCamSTRM
- } elsif ($prop eq "live_fw_hls") {
- return "API \"SYNO.SurveillanceStation.VideoStream\" is not available or Reading \"CamStreamFormat\" is not \"HLS\". May be your API version is 2.8 or higher." if(!SSCam_IsHLSCap($hash));
- $hash->{HELPER}{OPENWINDOW} = 0;
- $hash->{HELPER}{WLTYPE} = "hls";
- $hash->{HELPER}{ALIAS} = "View only on compatible browsers";
- $hash->{HELPER}{RUNVIEW} = "live_fw_hls";
- $hash->{HELPER}{ACTSTRM} = "HLS Livestream"; # sprechender Name des laufenden Streamtyps für SSCamSTRM
- } elsif ($prop eq "lastsnap_fw") {
- $hash->{HELPER}{LSNAPBYSTRMDEV} = 1 if($prop1); # Anzeige durch SSCamSTRM-Device ausgelöst
- $hash->{HELPER}{LSNAPBYDEV} = 1 if(!$prop1); # Anzeige durch SSCam ausgelöst
- $hash->{HELPER}{OPENWINDOW} = 0;
- $hash->{HELPER}{WLTYPE} = "base64img";
- $hash->{HELPER}{ALIAS} = " ";
- $hash->{HELPER}{RUNVIEW} = "lastsnap_fw";
- $hash->{HELPER}{ACTSTRM} = "last Snapshot"; # sprechender Name des laufenden Streamtyps für SSCamSTRM
- } else {
- return "$prop isn't a valid option of runview, use one of live_fw, live_link, live_open, lastrec_fw, lastrec_open, lastsnap_fw";
- }
- SSCam_runliveview($hash);
-
- } elsif ($opt eq "hlsreactivate" && SSCam_IsModelCam($hash)) {
- # ohne SET-Menüeintrag
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- SSCam_hlsreactivate($hash);
-
- } elsif ($opt eq "hlsactivate" && SSCam_IsModelCam($hash)) {
- # ohne SET-Menüeintrag
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- SSCam_hlsactivate($hash);
-
- } elsif ($opt eq "refresh" && SSCam_IsModelCam($hash)) {
- # ohne SET-Menüeintrag
- if($prop =~ /STRM/) {
- # Event in allen SSCamSTRM-Devices erzeugen um Contentwiedergabe aufzufrischen
- SSCam_refresh($hash,0,0,1); # kein Room-Refresh, kein SSCam-state-Event, SSCamSTRM-Event
- }
-
- } elsif ($opt eq "extevent" && !SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- $hash->{HELPER}{EVENTID} = $prop;
- SSCam_extevent($hash);
-
- } elsif ($opt eq "stopView" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- SSCam_stopliveview($hash);
-
- } elsif ($opt eq "setPreset" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- if (!$prop) {return "Syntax of function \"$opt\" was wrong. Please use \"set $name setPreset []\" ";}
- $hash->{HELPER}{PNUMBER} = $prop;
- $hash->{HELPER}{PNAME} = $prop1?$prop1:$prop; # wenn keine Presetname angegeben -> Presetnummer als Name verwenden
- $hash->{HELPER}{PSPEED} = $prop2 if($prop2);
- SSCam_setPreset($hash);
-
- } elsif ($opt eq "setHome" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- if (!$prop) {return "Function \"$opt\" needs a \"Presetname\" as argument";}
- $hash->{HELPER}{SETHOME} = $prop;
- SSCam_setHome($hash);
-
- } elsif ($opt eq "delPreset" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- if (!$prop) {return "Function \"$opt\" needs a \"Presetname\" as argument";}
- $hash->{HELPER}{DELPRESETNAME} = $prop;
- SSCam_delPreset($hash);
-
- } else {
- return "$setlist";
- }
-
-return;
-}
-
-################################################################
-sub SSCam_Get($@) {
- my ($hash, @a) = @_;
- return "\"get X\" needs at least an argument" if ( @a < 2 );
- my $name = shift @a;
- my $opt = shift @a;
- my $arg = shift @a;
- my $arg1 = shift @a;
- my $arg2 = shift @a;
- my $ret = "";
- my $getlist;
-
- if(!$hash->{CREDENTIALS}) {
- return;
-
- } elsif(SSCam_IsModelCam($hash)) {
- # getlist für Cams
- $getlist = "Unknown argument $opt, choose one of ".
- "caminfoall:noArg ".
- "caminfo:noArg ".
- ((AttrVal($name,"snapGalleryNumber",undef) || AttrVal($name,"snapGalleryBoost",0))
- ?"snapGallery:noArg ":"snapGallery:$SSCAM_snum ").
- ((ReadingsVal("$name", "CapPTZPresetNumber", 0) != 0) ? "listPresets:noArg " : "").
- "snapinfo:noArg ".
- "svsinfo:noArg ".
- "snapfileinfo:noArg ".
- "eventlist:noArg ".
- "stmUrlPath:noArg ".
- "storedCredentials:noArg ".
- "scanVirgin:noArg ".
- "versionNotes "
- ;
- } else {
- # getlist für SVS Devices
- $getlist = "Unknown argument $opt, choose one of ".
- "caminfoall:noArg ".
- ($hash->{HELPER}{APIHMMAXVER}?"homeModeState:noArg ": "").
- "svsinfo:noArg ".
- "listLog ".
- "storedCredentials:noArg ".
- "scanVirgin:noArg ".
- "versionNotes "
- ;
- }
-
- return if(IsDisabled($name));
-
- if ($opt eq "caminfo") {
- # "1" ist Statusbit für manuelle Abfrage, kein Einstieg in Pollingroutine
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- SSCam_getcaminfo($hash);
-
- } elsif ($opt eq "caminfoall") {
- # "1" ist Statusbit für manuelle Abfrage, kein Einstieg in Pollingroutine
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- SSCam_getcaminfoall($hash,1);
-
- } elsif ($opt eq "homeModeState" && !SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- SSCam_gethomemodestate($hash);
-
- } elsif ($opt eq "listLog" && !SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- # übergebenen CL-Hash (FHEMWEB) in Helper eintragen
- SSCam_getclhash($hash,1);
-
- SSCam_extlogargs($hash,$arg) if($arg);
- SSCam_extlogargs($hash,$arg1) if($arg1);
- SSCam_extlogargs($hash,$arg2) if($arg2);
- SSCam_getsvslog($hash);
-
- } elsif ($opt eq "listPresets" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- # übergebenen CL-Hash (FHEMWEB) in Helper eintragen
- SSCam_getclhash($hash,1);
- SSCam_getpresets($hash);
-
- } elsif ($opt eq "svsinfo") {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- SSCam_getsvsinfo($hash);
-
- } elsif ($opt eq "storedCredentials") {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- # Credentials abrufen
- my ($success, $username, $password) = SSCam_getcredentials($hash,0);
- unless ($success) {return "Credentials couldn't be retrieved successfully - see logfile"};
- return "Stored Credentials for $name - Username: $username, Password: $password";
-
- } elsif ($opt eq "snapGallery" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- my $txt = SSCam_getclhash($hash);
- return $txt if($txt);
-
- if(!AttrVal($name, "snapGalleryBoost",0)) {
- # Snaphash ist nicht vorhanden und wird abgerufen
- $hash->{HELPER}{GETSNAPGALLERY} = 1;
-
- # snap-Infos für Gallerie abrufen
- my ($sg,$slim,$ssize);
- $slim = $arg?AttrVal($name,"snapGalleryNumber",$arg):AttrVal($name,"snapGalleryNumber",$SSCam_slim); # Anzahl der abzurufenden Snapshots
- $ssize = (AttrVal($name,"snapGallerySize","Icon") eq "Icon")?1:2; # Image Size 1-Icon, 2-Full
-
- SSCam_getsnapinfo("$name:$slim:$ssize");
-
- } else {
- # Snaphash ist vorhanden und wird zur Ausgabe aufbereitet
- my $htmlCode = SSCam_composegallery($name);
- for (my $k=1; (defined($hash->{HELPER}{CL}{$k})); $k++ ) {
- if ($hash->{HELPER}{CL}{$k}->{COMP}) {
- # CL zusammengestellt (Auslösung durch Notify)
- asyncOutput($hash->{HELPER}{CL}{$k}, "$htmlCode");
- } else {
- # Output wurde über FHEMWEB ausgelöst
- return $htmlCode;
- }
- }
- delete($hash->{HELPER}{CL});
- }
-
- } elsif ($opt eq "snapinfo" && SSCam_IsModelCam($hash)) {
- # Schnappschußgalerie abrufen (snapGalleryBoost) oder nur Info des letzten Snaps
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- my ($slim,$ssize) = SSCam_snaplimsize($hash);
- SSCam_getsnapinfo("$name:$slim:$ssize");
-
- } elsif ($opt eq "snapfileinfo" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- if (!ReadingsVal("$name", "LastSnapId", undef)) {return "Reading LastSnapId is empty - please take a snapshot before !"}
- SSCam_getsnapfilename($hash);
-
- } elsif ($opt eq "eventlist" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- SSCam_geteventlist ($hash);
-
- } elsif ($opt eq "stmUrlPath" && SSCam_IsModelCam($hash)) {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- SSCam_getStmUrlPath ($hash);
-
- } elsif ($opt eq "scanVirgin") {
- if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- SSCam_sessionoff($hash);
- delete $hash->{HELPER}{APIPARSET};
- delete $hash->{CAMID};
- # alte Readings außer state löschen
- my @allrds = keys%{$defs{$name}{READINGS}};
- foreach my $key(@allrds) {
- # Log3 ($name, 1, "DbRep $name - Reading Schlüssel: $key");
- delete($defs{$name}{READINGS}{$key}) if($key ne "state");
- }
- # "1" ist Statusbit für manuelle Abfrage, kein Einstieg in Pollingroutine
- SSCam_getcaminfoall($hash,1);
-
- } elsif ($opt =~ /versionNotes/) {
- my $header = "Module release information ";
- my $header1 = "Helpful hints ";
- my %hs;
-
- # Ausgabetabelle erstellen
- my ($ret,$val0,$val1);
- my $i = 0;
-
- $ret = "";
-
- # Hints
- if(!$arg || $arg =~ /hints/ || $arg =~ /[\d]+/) {
- $ret .= sprintf("
";
- $i++;
- if ($i & 1) {
- # $i ist ungerade
- $ret .= "
";
- } else {
- $ret .= "
";
- }
- }
- $ret .= "
";
- $ret .= "";
- $ret .= "
";
- $ret .= "
";
- }
-
- $ret .= "";
-
- return $ret;
-
- } else {
- return "$getlist";
- }
-
-return $ret; # not generate trigger out of command
-}
-
-######################################################################################
-# Kamera Liveview Anzeige in FHEMWEB
-######################################################################################
-# wird von FW aufgerufen. $FW_wname = aufrufende Webinstanz, $d = aufrufendes
-# Device (z.B. CamCP1)
-sub SSCam_FWsummaryFn ($$$$) {
- my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash is set for summaryFn in FHEMWEB
- my $hash = $defs{$d};
- my $name = $hash->{NAME};
- my $link = $hash->{HELPER}{LINK};
- my $wltype = $hash->{HELPER}{WLTYPE};
- my $ret;
- my $alias;
-
- return if(!$hash->{HELPER}{LINK} || ReadingsVal($d, "state", "") =~ /^dis.*/ || IsDisabled($name));
-
- # Definition Tasten
- my $imgblank = ""; # nicht sichtbare Leertaste
- my $cmdstop = "cmd=set $d stopView"; # Stream deaktivieren
- my $imgstop = "";
- my $cmdhlsreact = "cmd=set $d hlsreactivate"; # HLS Stream reaktivieren
- my $imghlsreact = "";
- my $cmdmjpegrun = "cmd=set $d runView live_fw"; # MJPEG Stream aktivieren
- my $imgmjpegrun = "";
- my $cmdhlsrun = "cmd=set $d runView live_fw_hls"; # HLS Stream aktivieren
- my $imghlsrun = "";
- my $cmdlrirun = "cmd=set $d runView lastrec_fw"; # Last Record IFrame
- my $imglrirun = "";
- my $cmdlh264run = "cmd=set $d runView lastrec_fw_MPEG4/H.264"; # Last Record H.264
- my $imglh264run = "";
- my $cmdlmjpegrun = "cmd=set $d runView lastrec_fw_MJPEG"; # Last Record MJPEG
- my $imglmjpegrun = "";
- my $cmdlsnaprun = "cmd=set $d runView lastsnap_fw STRM"; # Last SNAP
- my $imglsnaprun = "";
- my $cmdrecendless = "cmd=set $d on 0"; # Endlosaufnahme Start
- my $imgrecendless = "";
- my $cmdrecstop = "cmd=set $d off"; # Aufnahme Stop
- my $imgrecstop = "";
- my $cmddosnap = "cmd=set $d snap STRM"; # Snapshot auslösen mit Kennzeichnung "by STRM-Device"
- my $imgdosnap = "";
-
-
- my $attr = AttrVal($d, "htmlattr", " ");
- Log3($name, 4, "$name - SSCam_FWsummaryFn called - FW_wname: $FW_wname, device: $d, room: $room, attributes: $attr");
-
- if($wltype eq "image") {
- $ret = " ";
- $ret .= "$imgstop ";
- $ret .= $imgblank;
- if($hash->{HELPER}{RUNVIEW} =~ /live_fw/) {
- if(ReadingsVal($d, "Record", "Stop") eq "Stop") {
- # Aufnahmebutton endlos Start
- $ret .= "$imgrecendless ";
- } else {
- # Aufnahmebutton Stop
- $ret .= "$imgrecstop ";
- }
- $ret .= "$imgdosnap ";
- }
- $ret .= " ";
- if($hash->{HELPER}{AUDIOLINK} && ReadingsVal($d, "CamAudioType", "Unknown") !~ /Unknown/) {
- $ret .= "";
- }
-
- } elsif($wltype eq "iframe") {
- $ret = "";
- $ret .= " ";
- $ret .= "$imgstop ";
- if($hash->{HELPER}{AUDIOLINK} && ReadingsVal($d, "CamAudioType", "Unknown") !~ /Unknown/) {
- $ret .= "";
- }
-
- } elsif($wltype eq "embed") {
- $ret = "
-
-
- Credentials
-
-
- After a camera-device is defined, firstly it is needed to save the credentials. This will be done with command:
-
-
- set <name> credentials <username> <password>
-
-
- The password length has a maximum of 20 characters.
- The operator can, dependend on what functions are planned to execute, create an user in DSM respectively in Synology
- Surveillance Station as well.
- If the user is member of admin-group, he has access to all module functions. Without this membership the user can only
- execute functions with lower need of rights.
- The required minimum rights to execute functions are listed in a table further down.
-
- Alternatively to DSM-user a user created in SVS can be used. Also in that case a user of type "manager" has the right to
- execute all functions,
- whereat the access to particular cameras can be restricted by the privilege profile (please see help function in SVS for
- details).
- As best practice it is proposed to create an user in DSM as well as in SVS too:
-
-
-
DSM-User as member of admin group: unrestricted test of all module functions -> session: DSM
-
SVS-User as Manager or observer: adjusted privilege profile -> session: SurveillanceStation
-
-
-
- Using the Attribute "session" can be selected, if the session should be established to DSM or the
- SVS instead. Further informations about user management in SVS are available by execute
- "get <name> versionNotes 5".
- If the session will be established to DSM, SVS Web-API methods are available as well as further API methods of other API's
- what possibly needed for processing.
-
- After device definition the default is "login to DSM", that means credentials with admin rights can be used to test all camera-functions firstly.
- After this the credentials can be switched to a SVS-session with a restricted privilege profile as needed on dependency what module functions are want to be executed.
-
- The following list shows the minimum rights that the particular module function needs.
-
-
-
-
set ... on
session: ServeillanceStation - observer with enhanced privilege "manual recording"
-
set ... off
session: ServeillanceStation - observer with enhanced privilege "manual recording"
-
set ... snap
session: ServeillanceStation - observer
-
set ... delPreset
session: ServeillanceStation - observer
-
set ... disable
session: ServeillanceStation - manager
-
set ... enable
session: ServeillanceStation - manager
-
set ... expmode
session: ServeillanceStation - manager
-
set ... extevent
session: DSM - user as member of admin-group
-
set ... goPreset
session: ServeillanceStation - observer with privilege objective control of camera
-
set ... homeMode
ssession: ServeillanceStation - observer with privilege Home Mode switch (valid for SVS-device ! )
-
set ... motdetsc
session: ServeillanceStation - manager
-
set ... runPatrol
session: ServeillanceStation - observer with privilege objective control of camera
-
set ... goAbsPTZ
session: ServeillanceStation - observer with privilege objective control of camera
-
set ... move
session: ServeillanceStation - observer with privilege objective control of camera
-
set ... runView
session: ServeillanceStation - observer with privilege liveview of camera
-
set ... setHome
session: ServeillanceStation - observer
-
set ... setPreset
session: ServeillanceStation - observer
-
set ... snap
session: ServeillanceStation - observer
-
set ... snapGallery
session: ServeillanceStation - observer
-
set ... stopView
-
-
set ... credentials
-
-
get ... caminfo[all]
session: ServeillanceStation - observer
-
get ... eventlist
session: ServeillanceStation - observer
-
get ... listLog
session: ServeillanceStation - observer
-
get ... listPresets
session: ServeillanceStation - observer
-
get ... scanVirgin
session: ServeillanceStation - observer
-
get ... svsinfo
session: ServeillanceStation - observer
-
get ... snapfileinfo
session: ServeillanceStation - observer
-
get ... snapinfo
session: ServeillanceStation - observer
-
get ... stmUrlPath
session: ServeillanceStation - observer
-
-
-
-
-
-
-HTTP-Timeout Settings
-
-
- All functions of SSCam use HTTP-calls to SVS Web API.
- The default-value of HTTP-Timeout amounts 4 seconds. You can set the attribute "httptimeout" > 0 to adjust the value as needed in your technical environment.
-
-
-
-
-
-
-Set
-
-
- The specified set-commands are available for CAM/SVS-devices or only valid for CAM-devices or rather for SVS-Devices.
- They can be selected in the drop-down-menu of the particular device.
-
-
-
-
set <name> createStreamDev [generic | mjpeg | switched] (valid for CAM)
-
- A separate Streaming-Device (type SSCamSTRM) will be created. This device can be used as a discrete device in a dashboard for example.
- The current room of the parent camera device is assigned to the new device if it is set there.
-
-
-
-
-
-
generic
- the streaming device playback a content determined by attribute "genericStrmHtmlTag"
-
mjpeg
- the streaming device playback a permanent MJPEG video stream (Streamkey method)
-
switched
- playback of different streaming types. Buttons for mode control are provided.
-
-
-
-
- You can control the design with HTML tags in attribute "htmlattr" of the camera device or by the
- specific attributes of the SSCamSTRM-device itself.
- In "switched"-Devices are buttons provided for mode control.
- If HLS (HTTP Live Streaming) is used in Streaming-Device of type "switched", then the camera has to be set to video format
- H.264 in the Synology Surveillance Station and the SVS-Version has to support the HLS format.
- Therefore the selection button of HLS is only provided by the Streaming-Device if the Reading "CamStreamFormat" contains
- "HLS".
- HTTP Live Streaming is currently only available on Mac Safari or modern mobile iOS/Android devices.
- In devices of type "switched" buttons for controlling the media type to start are provided.
- A Streaming-Device of type "generic" needs the complete definition of HTML-Tags by the attribute "genericStrmHtmlTag".
- These tags specify the content to playback.
- The variables $HTMLATTR, $NAME are placeholder and absorb the attribute "htmlattr" (if set) respectively the SSCam-Devicename.
-
-
-
-
-
-
set <name> createPTZcontrol (valid for PTZ-CAM)
-
- A separate PTZ-control panel will be created (type SSCamSTRM). The current room of the parent camera device is
- assigned if it is set there.
- With the "ptzPanel_.*"-attributes or respectively the specific attributes of the SSCamSTRM-device
- the properties of the control panel can be affected.
-
-
-
-
-
set <name> createSnapGallery (valid for CAM)
-
- A snapshot gallery will be created as a separate device (type SSCamSTRM). The device will be provided in
- room "SnapGallery".
- With the "snapGallery..."-attributes respectively the specific attributes of the SSCamSTRM-device
- you are able to manipulate the properties of the new snapshot gallery device.
-
-
-
-
-
set <name> credentials <username> <password> (valid for CAM/SVS)
-
- set username / password combination for access the Synology Surveillance Station.
- See Credentials for further informations.
-
-
-
-
-
-
set <name> delPreset <PresetName> (valid for PTZ-CAM)
-
- Deletes a preset "<PresetName>". In FHEMWEB a drop-down list with current available presets is provieded.
-
-
-
-
-
-
set <name> [enable|disable] (valid for CAM)
-
- For deactivating / activating a list of cameras or all cameras by Regex-expression, subsequent two
- examples using "at":
-
- define a13 at 21:46 set CamCP1,CamFL,CamHE1,CamTER disable (enable)
- define a14 at 21:46 set Cam.* disable (enable)
-
-
- A bit more convenient is it to use a dummy-device for enable/disable all available cameras in Surveillance Station.
- At first the Dummy will be created.
-
-
- With combination of two created notifies, respectively one for "enable" and one for "diasble", you are able to switch all cameras into "enable" or "disable" state at the same time if you set the dummy to "enable" or "disable".
-
set <name> expmode [day|night|auto] (valid for CAM)
-
- With this command you are able to control the exposure mode and can set it to day, night or automatic mode.
- Thereby, for example, the behavior of camera LED's will be suitable controlled.
- The successful switch will be reported by the reading CamExposureMode (command "get ... caminfoall").
-
- Note:
- The successfully execution of this function depends on if SVS supports that functionality of the connected camera.
- Is the field for the Day/Night-mode shown greyed in SVS -> IP-camera -> optimization -> exposure mode, this function will be probably unsupported.
-
-
-
-
-
set <name> extevent [ 1-10 ] (valid for SVS)
-
- This command triggers an external event (1-10) in SVS.
- The actions which will are used have to be defined in the actionrule editor of SVS at first. There are the events 1-10 possible.
- In the message application of SVS you may select Email, SMS or Mobil (DS-Cam) messages to release if an external event has been triggerd.
- Further informations can be found in the online help of the actionrule editor.
- The used user needs to be a member of the admin-group and DSM-session is needed too.
-
-
-
-
-
set <name> goAbsPTZ [ X Y | up | down | left | right ] (valid for CAM)
-
- This command can be used to move a PTZ-camera to an arbitrary absolute X/Y-coordinate, or to absolute position using up/down/left/right.
- The option is only available for cameras which are having the Reading "CapPTZAbs=true". The property of a camera can be requested with "get <name> caminfoall" .
-
-
- Example for a control to absolute X/Y-coordinates:
-
-
- set <name> goAbsPTZ 120 450
-
-
- In this example the camera lense moves to position X=120 und Y=450.
- The valuation is:
-
-
-
- The lense can be moved in smallest steps to very large steps into the desired direction.
- If necessary the procedure has to be repeated to bring the lense into the desired position.
-
- If the motion should be done with the largest possible increment the following command can be used for simplification:
-
-
- set <name> goAbsPTZ up [down|left|right]
-
-
- In this case the lense will be moved with largest possible increment into the given absolute position.
- Also in this case the procedure has to be repeated to bring the lense into the desired position if necessary.
-
-
-
-
-
set <name> goPreset <Preset> (valid for CAM)
-
- Using this command you can move PTZ-cameras to a predefined position.
- The Preset-positions have to be defined first of all in the Synology Surveillance Station. This usually happens in the PTZ-control of IP-camera setup in SVS.
- The Presets will be read ito FHEM with command "get <name> caminfoall" (happens automatically when FHEM restarts). The import process can be repeated regular by camera polling.
- A long polling interval is recommendable in this case because of the Presets are only will be changed if the user change it in the IP-camera setup itself.
-
-
- Here it is an example of a PTZ-control depended on IR-motiondetector event:
-
-
- define CamFL.Preset.Wandschrank notify MelderTER:on.* set CamFL goPreset Wandschrank, ;; define CamFL.Preset.record at +00:00:10 set CamFL on 5 ;;;; define s3 at +*{3}00:00:05 set CamFL snap ;; define CamFL.Preset.back at +00:00:30 set CamFL goPreset Home
-
-
- Operating Mode:
-
- The IR-motiondetector registers a motion. Hereupon the camera "CamFL" moves to Preset-posion "Wandschrank". A recording with the length of 5 seconds starts 10 seconds later.
- Because of the prerecording time of the camera is set to 10 seconds (cf. Reading "CamPreRecTime"), the effectice recording starts when the camera move begins.
- When the recording starts 3 snapshots with an interval of 5 seconds will be taken as well.
- After a time of 30 seconds in position "Wandschrank" the camera moves back to postion "Home".
-
- An extract of the log illustrates the process:
-
-
- 2016.02.04 15:02:14 2: CamFL - Camera Flur_Vorderhaus has moved to position "Wandschrank"
- 2016.02.04 15:02:24 2: CamFL - Camera Flur_Vorderhaus Recording with Recordtime 5s started
- 2016.02.04 15:02:29 2: CamFL - Snapshot of Camera Flur_Vorderhaus has been done successfully
- 2016.02.04 15:02:30 2: CamFL - Camera Flur_Vorderhaus Recording stopped
- 2016.02.04 15:02:34 2: CamFL - Snapshot of Camera Flur_Vorderhaus has been done successfully
- 2016.02.04 15:02:39 2: CamFL - Snapshot of Camera Flur_Vorderhaus has been done successfully
- 2016.02.04 15:02:44 2: CamFL - Camera Flur_Vorderhaus has moved to position "Home"
-
-
-
-
-
-
set <name> homeMode [on|off] (valid for SVS)
-
- Switch the HomeMode of the Surveillance Station on or off.
- Further informations about HomeMode you can find in the Synology Onlinehelp.
-
-
-
-
-
set <name> motdetsc [camera|SVS|disable] (valid for CAM)
-
- The command "motdetsc" (stands for "motion detection source") switchover the motion detection to the desired mode.
- If motion detection will be done by camera / SVS without any parameters, the original camera motion detection settings are kept.
- The successful execution of that opreration one can retrace by the state in SVS -> IP-camera -> event detection -> motion.
-
- For the motion detection further parameter can be specified. The available options for motion detection by SVS are "sensitivity" and "threshold".
-
-
-
-
-
set <name> motdetsc SVS [sensitivity] [threshold]
# command pattern
-
set <name> motdetsc SVS 91 30
# set the sensitivity to 91 and threshold to 30
-
set <name> motdetsc SVS 0 40
# keep the old value of sensitivity, set threshold to 40
-
set <name> motdetsc SVS 15
# set the sensitivity to 15, threshold keep unchanged
-
-
-
-
- If the motion detection is used by camera, there are the options "sensitivity", "object size", "percentage for release" available.
-
-
-
-
-
set <name> motdetsc camera [sensitivity] [threshold] [percentage]
# command pattern
-
set <name> motdetsc camera 89 0 20
# set the sensitivity to 89, percentage to 20
-
set <name> motdetsc camera 0 40 10
# keep old value for sensitivity, set threshold to 40, percentage to 10
-
set <name> motdetsc camera 30
# set the sensitivity to 30, other values keep unchanged
-
-
-
-
- Please consider always the sequence of parameters. Unwanted options have to be set to "0" if further options which have to be changed are follow (see example above).
- The numerical values are between 1 - 99 (except special case "0").
-
- The each available options are dependend of camera type respectively the supported functions by SVS. Only the options can be used they are available in
- SVS -> edit camera -> motion detection. Further informations please read in SVS online help.
-
- With the command "get <name> caminfoall" the Reading "CamMotDetSc" also will be updated which documents the current setup of motion detection.
- Only the parameters and parameter values supported by SVS at present will be shown. The camera itself may offer further options to adjust.
set <name> move [ right | up | down | left | dir_X ] [Sekunden] (valid for CAM up to SVS version 7.1)
- set <name> move [ right | upright | up | upleft | left | downleft | down | downright ] [Sekunden] (valid for CAM and SVS Version 7.2 and above)
-
- With this command a continuous move of a PTZ-camera will be started. In addition to the four basic directions up/down/left/right is it possible to use angular dimensions
- "dir_X". The grain size of graduation depends on properties of the camera and can be identified by the Reading "CapPTZDirections".
-
- The radian measure of 360 degrees will be devided by the value of "CapPTZDirections" and describes the move drections starting with "0=right" counterclockwise.
- That means, if a camera Reading is "CapPTZDirections = 8" it starts with dir_0 = right, dir_2 = top, dir_4 = left, dir_6 = bottom and respectively dir_1, dir_3, dir_5 and dir_7
- the appropriate directions between. The possible moving directions of cameras with "CapPTZDirections = 32" are correspondingly divided into smaller sections.
-
- In opposite to the "set <name> goAbsPTZ"-command starts "set <name> move" a continuous move until a stop-command will be received.
- The stop-command will be generated after the optional assignable time of [seconds]. If that retention period wouldn't be set by the command, a time of 1 second will be set implicit.
-
- Examples:
-
-
- set <name> move up 0.5 : moves PTZ 0,5 Sek. (plus processing time) to the top
- set <name> move dir_1 1.5 : moves PTZ 1,5 Sek. (plus processing time) to top-right
- set <name> move dir_20 0.7 : moves PTZ 1,5 Sek. (plus processing time) to left-bottom ("CapPTZDirections = 32)"
-
-
-
-
-
-
set <name> [on [<rectime>] | off] (valid for CAM)
-
- The command "set <name> on" starts a recording. The default recording time takes 15 seconds. It can be changed by
- the attribute "rectime" individualy.
- With the attribute (respectively the default value) provided recording time can be overwritten
- once by "set <name> on <rectime>".
- The recording will be stopped after processing time "rectime"automatically.
-
- A special case is start recording by "set <name> on 0" respectively the attribute value "rectime = 0". In that case
- a endless-recording will be started. One have to stop this recording by command "set <name> off" explicitely.
-
- The recording behavior can be impacted with attribute "recextend" furthermore as explained as follows.
-
- Attribute "recextend = 0" or not set (default):
-
-
if, for example, a recording with rectimeme=22 is started, no other startcommand (for a recording) will be accepted until this started recording is finished.
- A hint will be logged in case of verboselevel = 3.
-
-
-
- Attribute "recextend = 1" is set:
-
-
a before started recording will be extend by the recording time "rectime" if a new start command is received. That means, the timer for the automatic stop-command will be
- renewed to "rectime" given bei the command, attribute or default value. This procedure will be repeated every time a new start command for recording is received.
- Therefore a running recording will be extended until no start command will be get.
-
-
a before started endless-recording will be stopped after recordingtime 2rectime" if a new "set on"-command is received (new set of timer). If it is unwanted make sure you
- don't set the attribute "recextend" in case of endless-recordings.
-
-
-
- Examples for simple Start/Stop a Recording:
-
-
-
-
set <name> on [rectime]
starts a recording of camera <name>, stops automatically after [rectime] (default 15s or defined by attribute)
-
set <name> off
stops the recording of camera <name>
-
-
-
-
-
-
set <name> optimizeParams [mirror:<value>] [flip:<value>] [rotate:<value>] [ntp:<value>] (gilt für CAM)
-
- Set one or several properties of the camera. The video can be mirrored (mirror), turned upside down (flip) or
- rotated (rotate). Specified properties must be supported by the camera type. With "ntp" you can set a time server the camera
- use for time synchronization.
-
- <value> can be for:
-
-
mirror, flip, rotate: true | false
-
ntp: the name or the IP-address of time server
-
-
-
- Examples:
- set <name> optimizeParams mirror:true flip:true ntp:time.windows.com
- # The video will be mirrored, turned upside down and the time server is set to "time.windows.com".
- set <name> optimizeParams ntp:Surveillance%20Station
- # The Surveillance Station is set as time server. (NTP-service has to be activated in DSM)
- set <name> optimizeParams mirror:true flip:false rotate:true
- # The video will be mirrored and rotated round 90 degrees.
-
-
-
-
-
-
set <name> pirSensor [activate | deactivate] (valid for CAM)
-
- Activates / deactivates the infrared sensor of the camera (only posible if the camera has got a PIR sensor).
-
-
-
-
-
set <name> runPatrol <Patrolname> (valid for CAM)
-
- This commans starts a predefined patrol (tour) of a PTZ-camera.
- At first the patrol has to be predefined in the Synology Surveillance Station. It can be done in the PTZ-control of IP-Kamera Setup -> PTZ-control -> patrol.
- The patrol tours will be read with command "get <name> caminfoall" which is be executed automatically when FHEM restarts.
- The import process can be repeated regular by camera polling. A long polling interval is recommendable in this case because of the patrols are only will be changed
- if the user change it in the IP-camera setup itself.
- Further informations for creating patrols you can get in the online-help of Surveillance Station.
-
- MJPEG-Livestream. Audio playback is provided if possible.
-
live_fw_hls
- HLS-Livestream (currently only Mac Safari Browser and mobile iOS/Android-Devices)
-
live_link
- Link of a MJPEG-Livestream
-
live_open [<room>]
- opens MJPEG-Livestream in separate Browser window
-
lastrec_fw
- playback last recording as iFrame object
-
lastrec_fw_MJPEG
- usable if last recording has format MJPEG
-
lastrec_fw_MPEG4/H.264
- usable if last recording has format MPEG4/H.264
-
lastrec_open [<room>]
- playback last recording in a separate Browser window
-
lastsnap_fw
- playback last snapshot
-
-
-
-
- With "live_fw, live_link" a MJPEG-Livestream will be started, either as an embedded image
- or as a generated link.
- The option "live_open" starts a new browser window with a MJPEG-Livestream. If the optional "<room>" is set, the
- window will only be started if the specified room is currently opened in a FHEMWEB-session.
- If a HLS-Stream by "live_fw_hls" is requested, the camera has to be setup to video format H.264 (not MJPEG) in the
- Synology Surveillance Station and the SVS-Version has to support the HLS format.
- Therefore this possibility is only present if the Reading "CamStreamFormat" is set to "HLS".
-
-
- Access to the last recording of a camera can be done using "lastrec_fw.*" respectively "lastrec_open".
- By "lastrec_fw" the recording will be opened in an iFrame. There are some control elements provided if available.
- The "lastrec_open" command can be extended optionally by a room. In this case the new window opens only, if the
- room is the same as a FHEMWEB-session has currently opened.
- The command "set <name> runView lastsnap_fw" shows the last snapshot of the camera embedded.
- The Streaming-Device properties can be affected by HTML-tags in attribute "htmlattr".
-
-
- The command "set <name> runView live_open" starts the stream immediately in a new browser window.
- A browser window will be initiated to open for every FHEMWEB-session which is active. If you want to change this behavior,
- you can use command "set <name> runView live_open <room>". In this case the new window opens only, if the
- room is the same as a FHEMWEB-session has currently opened.
- The settings of attribute "livestreamprefix" overwrite the data for protocol, servername and
- port in reading "LiveStreamUrl".
- By "livestreamprefix" the LivestreamURL (is shown if attribute "showStmInfoFull" is set) can
- be modified and used for distribution and external access to the Livestream.
-
- The livestream can be stopped again by command "set <name> stopView".
- The "runView" function also switches Streaming-Devices of type "switched" into the appropriate mode.
-
- Dependend of the content to playback, different control buttons are provided:
-
-
-
-
Start Recording
- starts an endless recording
-
Stop Recording
- stopps the recording
-
Take Snapshot
- take a snapshot
-
Switch off
- stops a running playback
-
-
-
-
- Note for HLS (HTTP Live Streaming):
- The video starts with a technology caused delay. Every stream will be segemented into some little video files
- (with a lenth of approximately 10 seconds) and is than delivered to the client.
- The video format of the camera has to be set to H.264 in the Synology Surveillance Station and not every camera type is
- a proper device for HLS-Streaming.
- At the time only the Mac Safari Browser and modern mobile iOS/Android-Devices are able to playback HLS-Streams.
-
-
-
-
-
-
set <name> setHome <PresetName> (valid for PTZ-CAM)
-
- Set the Home-preset to a predefined preset name "<PresetName>" or the current position of the camera.
-
-
-
-
-
-
set <name> setPreset <PresetNumber> [<PresetName>] [<Speed>] (valid for PTZ-CAM)
-
- Sets a Preset with name "<PresetName>" to the current postion of the camera. The speed can be defined
- optionally (<Speed>). If no PresetName is specified, the PresetNummer is used as name.
- For this reason <PresetName> is defined as optional, but should usually be set.
-
-
-
-
-
-
set <name> snap (valid for CAM)
-
- A snapshot can be triggered with:
-
- set <name> snap
-
-
- Subsequent some Examples for taking snapshots:
-
- If a serial of snapshots should be released, it can be done using the following notify command.
- For the example a serial of snapshots are to be triggerd if the recording of a camera starts.
- When the recording of camera "CamHE1" starts (Attribut event-on-change-reading -> "Record" has to be set), then 3 snapshots at intervals of 2 seconds are triggered.
-
-
- define he1_snap_3 notify CamHE1:Record.*on define h3 at +*{3}00:00:02 set CamHE1 snap
-
-
- Release of 2 Snapshots of camera "CamHE1" at intervals of 6 seconds after the motion sensor "MelderHE1" has sent an event,
- can be done e.g. with following notify-command:
-
-
- define he1_snap_2 notify MelderHE1:on.* define h2 at +*{2}00:00:06 set CamHE1 snap
-
-
- The ID and the filename of the last snapshot will be displayed as value of variable "LastSnapId" respectively "LastSnapFilename" in the device-Readings.
-
-
-
-
-
set <name> snapGallery [1-10] (valid for CAM)
-
- The command is only available if the attribute "snapGalleryBoost=1" is set.
- It creates an output of the last [x] snapshots as well as "get ... snapGallery". But differing from "get" with
- attribute "snapGalleryBoost=1" no popup will be created. The snapshot gallery will be depicted as
- an browserpage instead. All further functions and attributes are appropriate the "get <name> snapGallery"
- command.
- If you want create a snapgallery output by triggering, e.g. with an "at" or "notify", you should use the
- "get <name> snapGallery" command instead of "set".
-
-
-
-
-
set <name> startTracking (valid for CAM with tracking capability)
-
- Starts object tracking of camera.
- The command is only available if surveillance station has recognised the object tracking capability of camera
- (Reading "CapPTZObjTracking").
-
-
-
-
-
set <name> stopTracking (valid for CAM with tracking capability)
-
- Stops object tracking of camera.
- The command is only available if surveillance station has recognised the object tracking capability of camera
- (Reading "CapPTZObjTracking").
-
-
-
-
-
-
-
-
-Get
-
-
- With SSCam the properties of SVS and defined Cameras could be retrieved.
- The specified get-commands are available for CAM/SVS-devices or only valid for CAM-devices or rather for SVS-Devices.
- They can be selected in the drop-down-menu of the particular device.
-
-
-
get <name> caminfoall (valid for CAM/SVS)
- get <name> caminfo (valid for CAM)
-
- Dependend of the type of camera (e.g. Fix- or PTZ-Camera) the available properties are retrieved and provided as Readings.
- For example the Reading "Availability" will be set to "disconnected" if the camera would be disconnected from Synology
- Surveillance Station and can't be used for further processing like creating events.
- "getcaminfo" retrieves a subset of "getcaminfoall".
-
-
-
-
-
get <name> eventlist (valid for CAM)
-
- The Reading "CamEventNum" and "CamLastRecord" will be refreshed which containes the total number
- of in SVS registered camera events and the path/name of the last recording.
- This command will be implicit executed when "get <name> caminfoall" is running.
- The attribute "videofolderMap" replaces the content of reading "VideoFolder". You can use it for
- example if you have mounted the videofolder of SVS under another name or path and want to access by your local pc.
-
-
-
-
-
get <name> homeModeState (valid for SVS)
-
- HomeMode-state of the Surveillance Station will be retrieved.
-
-
-
-
-
get <name> listLog [severity:<Loglevel>] [limit:<Number of lines>] [match:<Searchstring>] (valid for SVS)
-
- Fetches the Surveillance Station Log from Synology server. Without any further options the whole log will be retrieved.
- You can specify all or any of the following options:
-
-
-
<Loglevel> - Information, Warning or Error. Only datasets having this severity are retrieved (default: all)
-
<Number of lines> - the specified number of lines (newest) of the log are retrieved (default: all)
-
<Searchstring> - only log entries containing the searchstring are retrieved (Note: no Regex possible, the searchstring will be given into the call to SVS)
-
-
-
- Examples
-
- get <name> listLog severity:Error limit:5
- Reports the last 5 Log entries with severity "Error"
- get <name> listLog severity:Information match:Carport
- Reports all Log entries with severity "Information" and containing the string "Carport"
- get <name> listLog severity:Warning
- Reports all Log entries with severity "Warning"
-
-
-
- If the polling of SVS is activated by setting the attribute "pollcaminfoall", the reading
- "LastLogEntry" will be created.
- In the protocol-setup of the SVS you can adjust what data you want to log. For further informations please have a look at
- Synology Online-Help.
-
-
-
-
-
get <name> listPresets (valid for PTZ-CAM)
-
- Get a popup with a lists of presets saved for the camera.
-
-
-
-
-
get <name> scanVirgin (valid for CAM/SVS)
-
- This command is similar to get caminfoall, informations relating to SVS and the camera will be retrieved.
- In difference to caminfoall in either case a new session ID will be generated (do a new login), the camera ID will be
- new identified and all necessary API-parameters will be new investigated.
-
-
-
-
-
get <name> snapGallery [1-10] (valid for CAM)
-
- A popup with the last [x] snapshots will be created. If the attribute "snapGalleryBoost" is set,
- the last snapshots (default 3) are requested by polling and they will be stored in the FHEM-servers main memory.
- This method is helpful to speed up the output especially in case of full size images, but it can be possible
- that NOT the newest snapshots are be shown if they have not be initialized by the SSCAm-module itself.
- The function can also be triggered, e.g. by an "at" or "notify". In that case the snapshotgallery will be displayed on all
- connected FHEMWEB instances as a popup.
-
- To control this function behavior there are further attributes:
-
-
-
snapGalleryBoost
-
snapGalleryColumns
-
snapGalleryHtmlAttr
-
snapGalleryNumber
-
snapGallerySize
-
- available.
-
-
-
- Note:
- Depended from quantity and resolution (quality) of the snapshot images adequate CPU and/or main memory
- ressources are needed.
-
-
-
-
-
get <name> snapfileinfo (valid for CAM)
-
- The filename of the last snapshot will be retrieved. This command will be executed with "get <name> snap"
- automatically.
-
-
-
-
-
get <name> snapinfo (valid for CAM)
-
- Informations about snapshots will be retrieved. Heplful if snapshots are not triggerd by SSCam, but by motion detection of the camera or surveillance
- station instead.
-
-
-
-
-
get <name> stmUrlPath (valid for CAM)
-
- This command is to fetch the streamkey information and streamurl using that streamkey. The reading "StmKey" will be filled when this command will be executed and can be used
- to send it and run by your own application like a browser (see example).
- If the attribute "showStmInfoFull" is set, additional stream readings like "StmKeyUnicst", "StmKeymjpegHttp" will be shown and can be used to run the
- appropriate livestream without session id. Is the attribute "livestreamprefix" (usage: "http(s)://<hostname><port>) used, the servername / port will be replaced if necessary.
- The strUrlPath function will be included automatically if polling is used.
-
-
- Example to create an http-call to a livestream using StmKey:
-
-
-
- cameraId (Internal CAMID) and StmKey has to be replaced by valid values.
-
- Note:
-
- If you use the stream-call from external and replace hostname / port with valid values and open your router ip ports, please
- make shure that no unauthorized person could get this sensible data !
-
-
-
-
-
get <name> storedCredentials (valid for CAM/SVS)
-
- Shows the stored login credentials in a popup as plain text.
-
-
-
-
-
get <name> svsinfo (valid for CAM/SVS)
-
- Determines common informations about the installed SVS-version and other properties.
-
-
-
-
-
get <name> versionNotes [hints | rel | <key>] (valid for CAM/SVS)
-
- Shows realease informations and/or hints about the module. It contains only main release informations for module users.
- If no options are specified, both release informations and hints will be shown. "rel" shows only release informations and
- "hints" shows only hints. By the <key>-specification only the hint with the specified number is shown.
-
-
-
-
-
- Polling of Camera/SVS-Properties
-
- Retrieval of Camera-Properties can be done automatically if the attribute "pollcaminfoall" will be set to a value > 10.
- As default that attribute "pollcaminfoall" isn't be set and the automatic polling isn't be active.
- The value of that attribute determines the interval of property-retrieval in seconds. If that attribute isn't be set or < 10 the automatic polling won't be started
- respectively stopped when the value was set to > 10 before.
-
- The attribute "pollcaminfoall" is monitored by a watchdog-timer. Changes of the attribute-value will be checked every 90 seconds and transact corresponding.
- Changes of the pollingstate and pollinginterval will be reported in FHEM-Logfile. The reporting can be switched off by setting the attribute "pollnologging=1".
- Thereby the needless growing of the logfile can be avoided. But if verbose level is set to 4 or above even though the attribute "pollnologging" is set as well, the polling
- will be actived due to analysis purposes.
-
- If FHEM will be restarted, the first data retrieval will be done within 60 seconds after start.
-
- The state of automatic polling will be displayed by reading "PollState":
-
-
-
PollState = Active - automatic polling will be executed with interval correspondig value of attribute "pollcaminfoall"
-
PollState = Inactive - automatic polling won't be executed
-
- If polling is used, the interval should be adjusted only as short as needed due to the detected camera values are predominantly static.
- A feasible guide value for attribute "pollcaminfoall" could be between 600 - 1800 (s).
- Per polling call and camera approximately 10 - 20 Http-calls will are stepped against Surveillance Station.
- Because of that if HTTP-Timeout (pls. refer Attribut "httptimeout") is set to 4 seconds, the theoretical processing time couldn't be higher than 80 seconds.
- Considering a safety margin, in that example you shouldn't set the polling interval lower than 160 seconds.
-
- If several Cameras are defined in SSCam, attribute "pollcaminfoall" of every Cameras shouldn't be set exactly to the same value to avoid processing bottlenecks
- and thereby caused potential source of errors during request Synology Surveillance Station.
- A marginal difference between the polling intervals of the defined cameras, e.g. 1 second, can already be faced as
- sufficient value.
-
-
-
-
-
-Internals
-
- The meaning of used Internals is depicted in following list:
-
-
CAMID - the ID of camera defined in SVS, the value will be retrieved automatically on the basis of SVS-cameraname
-
CAMNAME - the name of the camera in SVS
-
COMPATIBILITY - information up to which SVS-version the module version is currently released/tested (see also Reading "compstate")
-
CREDENTIALS - the value is "Set" if Credentials are set
-
NAME - the cameraname in FHEM
-
MODEL - distinction between camera device (CAM) and Surveillance Station device (SVS)
-
OPMODE - the last executed operation of the module
-
SERVERADDR - IP-Address of SVS Host
-
SERVERPORT - SVS-Port
-
-
-
-
-
-Attributes
-
-
-
-
-
-
debugactivetoken
- if set the state of active token will be logged - only for debugging, don't use it in normal operation !
-
-
-
disable
- deactivates the device definition
-
-
-
genericStrmHtmlTag
- This attribute contains HTML-Tags for video-specification in a Streaming-Device of type "generic".
- (see also "set <name> createStreamDev generic")
livestreamprefix
- Overwrites the specifications of protocol, servername and port for further use in livestream address and
- StmKey.*-readings , e.g. as a link for external use.
- It can be specified of two ways as follows:
-
-
-
-
DEF
: the protocol, servername and port as specified in device
- definition is used
-
http(s)://<servername>:<port>
: your own address specification is used
-
-
-
- Servername can be the name or the IP-address of your Synology Surveillance Station.
-
-
-
-
loginRetries
- set the amount of login-repetitions in case of failure (default = 3)
-
-
-
noQuotesForSID
- this attribute may be helpful in some cases to avoid errormessage "402 - permission denied" and makes login
- possible.
-
-
-
pollcaminfoall
- Interval of automatic polling the Camera properties (if <= 10: no polling, if > 10: polling with interval)
-
-
-
pollnologging
- "0" resp. not set = Logging device polling active (default), "1" = Logging device polling inactive
-
-
-
ptzPanel_Home
- In the PTZ-control panel the Home-Icon (in attribute "ptzPanel_row02") is automatically assigned to the value of
- Reading "PresetHome".
- With "ptzPanel_Home" you can change the assignment to another preset from the available Preset list.
-
-
-
ptzPanel_iconPath
- Path for icons used in PTZ-control panel, default is "www/images/sscam".
- The attribute value will be used for all icon-files except *.svg.
-
-
-
ptzPanel_iconPrefix
- Prefix for icons used in PTZ-control panel, default is "black_btn_".
- The attribute value will be used for all icon-files except *.svg.
- If the used icon-files begin with e.g. "black_btn_" ("black_btn_CAMDOWN.png"), the icon needs to be defined in
- attributes "ptzPanel_row[00-09]" just with the subsequent part of name, e.g. "CAMDOWN.png".
-
-
-
-
ptzPanel_row[00-09] <command>:<icon>,<command>:<icon>,...
- For PTZ-cameras the attributes "ptzPanel_row00" to "ptzPanel_row04" are created automatically for usage by
- the PTZ-control panel.
- The attributes contain a comma spareated list of command:icon-combinations (buttons) each panel line.
- One panel line can contain a random number of buttons. The attributes "ptzPanel_row00" to "ptzPanel_row04" can't be
- deleted because of they are created automatically again in that case.
- The user can change or complement the attribute values. These changes are conserved.
- If needed the assignment for Home-button in "ptzPanel_row02" can be changed by attribute "ptzPanel_Home".
- The icons are searched in path "ptzPanel_iconPath". The value of "ptzPanel_iconPrefix" is prepend to the icon filename.
- Own extensions of the PTZ-control panel can be done using the attributes "ptzPanel_row05" to "ptzPanel_row09".
- For creation of own icons a template is provided in the SVN. Further information can be get by "get <name> versionNotes 2".
-
-
- Note:
- For an empty field please use ":CAMBLANK.png" respectively ":CAMBLANK.png,:CAMBLANK.png,:CAMBLANK.png,..." for an empty
- line.
-
-
-
- Example:
- attr <name> ptzPanel_row00 move upleft:CAMUPLEFTFAST.png,:CAMBLANK.png,move up:CAMUPFAST.png,:CAMBLANK.png,move upright:CAMUPRIGHTFAST.png
- # The command "move upleft" is transmitted to the camera by pressing the button(icon) "CAMUPLEFTFAST.png".
-
-
-
-
-
-
ptzPanel_use
- Switch the usage of a PTZ-control panel in detail view respectively a created StreamDevice off or on
- (default: on).
-
-
-
rectime
- determines the recordtime when a recording starts. If rectime = 0 an endless recording will be started. If
- it isn't defined, the default recordtime of 15s is activated
-
-
-
recextend
- "rectime" of a started recording will be set new. Thereby the recording time of the running recording will be
- extended
-
-
-
session
- selection of login-Session. Not set or set to "DSM" -> session will be established to DSM (Sdefault).
- "SurveillanceStation" -> session will be established to SVS.
- For establish a sesion with Surveillance Station you have to create a user with suitable privilege profile in SVS.
- If you need more infomations please execute "get <name> versionNotes 5".
-
-
-
simu_SVSversion
- simulates another SVS version. (only a lower version than the installed one is possible !)
-
-
-
snapGalleryBoost
- If set, the last snapshots (default 3) will be retrieved by Polling, will be stored in the FHEM-servers main memory
- and can be displayed by the "set/get ... snapGallery" command.
- This mode is helpful if many or full size images shall be displayed.
- If the attribute is set, you can't specify arguments in addition to the "set/get ... snapGallery" command.
- (see also attribut "snapGalleryNumber")
-
-
-
snapGalleryColumns
- The number of snapshots which shall appear in one row of the gallery popup (default 3).
-
-
-
snapGalleryHtmlAttr
- the image parameter can be controlled by this attribute.
- If the attribute isn't set, the value of attribute "htmlattr" will be used.
- If "htmlattr" is also not set, default parameters are used instead (width="500" height="325").
snapGalleryNumber
- The number of snapshots to retrieve (default 3).
-
-
-
snapGallerySize
- By this attribute the quality of the snapshot images can be controlled (default "Icon").
- If mode "Full" is set, the images are retrieved with their original available resolution. That requires more ressources
- and may slow down the display. By setting attribute "snapGalleryBoost=1" the display may accelerated, because in that case
- the images will be retrieved by continuous polling and need only bring to display.
-
-
-
showStmInfoFull
- additional stream informations like LiveStreamUrl, StmKeyUnicst, StmKeymjpegHttp will be created
-
-
-
showPassInLog
- if set the used password will be shown in logfile with verbose 4. (default = 0)
-
-
-
videofolderMap
- replaces the content of reading "VideoFolder", Usage if e.g. folders are mountet with different names than original
- (SVS)
-
-
-
verbose
-
-
- Different Verbose-Level are supported.
- Those are in detail:
-
-
-
-
0
- Start/Stop-Event will be logged
-
1
- Error messages will be logged
-
2
- messages according to important events were logged
-
3
- sended commands will be logged
-
4
- sended and received informations will be logged
-
5
- all outputs will be logged for error-analyses. Caution: a lot of data could be written into logfile !
-
- Using the polling mechanism or retrieval by "get"-call readings are provieded, The meaning of the readings are listed in subsequent table:
- The transfered Readings can be deversified dependend on the type of camera.
-
-
-
-
CamAudioType
- Indicating audio type
-
Availability
- Availability of Camera (disabled, enabled, disconnected, other)
-
CamEventNum
- delivers the total number of in SVS registered events of the camera
-
CamExposureControl
- indicating type of exposure control
-
CamExposureMode
- current exposure mode (Day, Night, Auto, Schedule, Unknown)
-
CamForceEnableMulticast
- Is the camera forced to enable multicast.
-
CamIP
- IP-Address of Camera
-
CamLastRec
- Path / name of the last recording
-
CamLastRecTime
- date / starttime / endtime of the last recording
-
CamLiveFps
- Frames per second of Live-Stream
-
CamLiveMode
- Source of Live-View (DS, Camera)
-
camLiveQuality
- Live-Stream quality set in SVS
-
camLiveResolution
- Live-Stream resolution set in SVS
-
camLiveStreamNo
- used Stream-number for Live-Stream
-
CamModel
- Model of camera
-
CamMotDetSc
- state of motion detection source (disabled, by camera, by SVS) and their parameter
-
CamNTPServer
- set time server
-
CamPort
- IP-Port of Camera
-
CamPreRecTime
- Duration of Pre-Recording (in seconds) adjusted in SVS
-
CamPtSpeed
- adjusted value of Pan/Tilt-activities (setup in SVS)
-
CamRecShare
- shared folder on disk station for recordings
-
CamRecVolume
- Volume on disk station for recordings
-
CamStreamFormat
- the current format of video streaming
-
CamVideoType
- Indicating video type
-
CamVendor
- Identifier of camera producer
-
CamVideoFlip
- Is the video flip
-
CamVideoMirror
- Is the video mirror
-
CamVideoRotate
- Is the video rotate
-
CapAudioOut
- Capability to Audio Out over Surveillance Station (false/true)
-
CapChangeSpeed
- Capability to various motion speed
-
CapPIR
- has the camera a PIR sensor feature
-
CapPTZAbs
- Capability to perform absolute PTZ action
-
CapPTZAutoFocus
- Capability to perform auto focus action
-
CapPTZDirections
- the PTZ directions that camera support
-
CapPTZFocus
- mode of support for focus action
-
CapPTZHome
- Capability to perform home action
-
CapPTZIris
- mode of support for iris action
-
CapPTZObjTracking
- Capability to perform objekt-tracking
-
CapPTZPan
- Capability to perform pan action
-
CapPTZPresetNumber
- The maximum number of preset supported by the model. 0 stands for preset incapability
-
CapPTZTilt
- mode of support for tilt action
-
CapPTZZoom
- Capability to perform zoom action
-
DeviceType
- device type (Camera, Video_Server, PTZ, Fisheye)
-
Error
- message text of last error
-
Errorcode
- error code of last error
-
HomeModeState
- HomeMode-state (SVS-version 8.1.0 and above)
-
LastLogEntry
- the neweset entry of Surveillance Station Log (only if SVS-device and if attribute pollcaminfoall is set)
-
LastSnapFilename
- the filename of the last snapshot
-
LastSnapId
- the ID of the last snapshot
-
LastSnapTime
- timestamp of the last snapshot
-
LastUpdateTime
- date / time the last update of readings by "caminfoall"
-
LiveStreamUrl
- the livestream URL if stream is started (is shown if attribute "showStmInfoFull" is set)
-
Patrols
- in Synology Surveillance Station predefined patrols (at PTZ-Cameras)
-
PollState
- shows the state of automatic polling
-
PresetHome
- Name of Home-position (at PTZ-Cameras)
-
Presets
- in Synology Surveillance Station predefined Presets (at PTZ-Cameras)
-
Record
- if recording is running = Start, if no recording is running = Stop
-
StmKey
- current streamkey. it can be used to open livestreams without session id
-
StmKeyUnicst
- Uni-cast stream path of the camera. (attribute "showStmInfoFull" has to be set)
-
StmKeymjpegHttp
- Mjpeg stream path(over http) of the camera (attribute "showStmInfoFull" has to be set)
-
SVScustomPortHttp
- Customized port of Surveillance Station (HTTP) (to get with "svsinfo")
-
SVScustomPortHttps
- Customized port of Surveillance Station (HTTPS) (to get with "svsinfo")
-
SVSlicenseNumber
- The total number of installed licenses (to get with "svsinfo")
-
SVSuserPriv
- The effective rights of the user used for log in (to get with "svsinfo")
-
SVSversion
- package version of the installed Surveillance Station (to get with "svsinfo")
-
UsedSpaceMB
- used disk space of recordings by Camera
-
VideoFolder
- Path to the recorded video
-
compstate
- state of compatibility (compares current/simulated SVS-version with Internal COMPATIBILITY)
-
-
-
-
-
-
-
-
-=end html
-=begin html_DE
-
-
-
SSCam
-
- Mit diesem Modul können Operationen von in der Synology Surveillance Station (SVS) definierten Kameras und Funktionen
- der SVS ausgeführt werden. Es basiert auf der SVS API und unterstützt die SVS ab Version 7.
- Zur Zeit werden folgende Funktionen unterstützt:
-
-
-
Start einer Aufnahme
-
Stop einer Aufnahme (per Befehl bzw. automatisch nach Ablauf der Aufnahmedauer)
-
Aufnehmen eines Schnappschusses und Ablage in der Synology Surveillance Station
-
Deaktivieren einer Kamera in Synology Surveillance Station
-
Aktivieren einer Kamera in Synology Surveillance Station
-
Steuerung der Belichtungsmodi Tag, Nacht bzw. Automatisch
-
Umschaltung der Ereigniserkennung durch Kamera, durch SVS oder deaktiviert
-
steuern der Erkennungsparameterwerte Empfindlichkeit, Schwellwert, Objektgröße und Prozentsatz für Auslösung
-
Abfrage von Kameraeigenschaften (auch mit Polling) sowie den Eigenschaften des installierten SVS-Paketes
-
Bewegen an eine vordefinierte Preset-Position (bei PTZ-Kameras)
-
Start einer vordefinierten Überwachungstour (bei PTZ-Kameras)
-
Positionieren von PTZ-Kameras zu absoluten X/Y-Koordinaten
starten und beenden von Kamera-Livestreams incl. Audiowiedergabe, anzeigen der letzten Aufnahme oder des letzten Schnappschusses
-
Abruf und Ausgabe der Kamera Streamkeys sowie Stream-Urls (Nutzung von Kamera-Livestreams ohne Session Id)
-
abspielen der letzten Aufnahme bzw. Anzeige des letzten Schnappschusses
-
anzeigen der gespeicherten Anmeldeinformationen (Credentials)
-
Ein- bzw. Ausschalten des Surveillance Station HomeMode und abfragen des HomeMode-Status
-
abrufen des Surveillance Station Logs, auswerten des neuesten Eintrags als Reading
-
erzeugen einer Gallerie der letzten 1-10 Schnappschüsse (als Popup oder permanentes Device)
-
Start bzw. Stop Objekt Tracking (nur unterstützte PTZ-Kameras mit dieser Fähigkeit)
-
Setzen/Löschen eines Presets (bei PTZ-Kameras)
-
Setzen der Home-Position (bei PTZ-Kameras)
-
erstellen eines Paneels zur Kamera-Steuerung. (bei PTZ-Kameras)
-
erzeugen unterschiedlicher Typen von separaten Streaming-Devices (createStreamDev)
-
Aktivierung / Deaktivierung eines kamerainternen PIR-Sensors
-
-
-
-
- Die Aufnahmen stehen in der Synology Surveillance Station (SVS) 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 gespeichert und dann gelöscht.
- Dieses Modul nutzt das Perl-Modul JSON.
- Auf Debian-Linux basierenden Systemen kann es installiert werden mit:
-
- sudo apt-get install libjson-perl
-
- Das Modul verwendet für HTTP-Calls die nichtblockierenden Funktionen von HttpUtils bzw. HttpUtils_NonblockingGet.
- Im DSM bzw. der Synology Surveillance Station muß ein Nutzer angelegt sein. Die Zugangsdaten werden später über ein Set-Kommando dem angelegten Gerät zugewiesen.
- Nähere Informationen dazu unter Credentials
-
- Überblick über die Perl-Module welche von SSCam genutzt werden:
-
- Bei der Definition wird zwischen einer Kamera-Definition und der Definition einer Surveillance Station (SVS), d.h.
- der Applikation selbst auf der Diskstation, unterschieden.
- Abhängig von der Art des definierten Devices wird das Internal MODEL auf "<Hersteller> - <Kameramodell>" oder
- SVS gesetzt und eine passende Teilmenge der beschriebenen set/get-Befehle dem Device zugewiesen.
- Der Gültigkeitsbereich von set/get-Befehlen ist nach dem jeweiligen Befehl angegeben "gilt für CAM, SVS, CAM/SVS".
-
-
- Eine Kamera wird definiert mit:
-
- define <Name> SSCAM <Kameraname in SVS> <ServerAddr> [Port] [Protocol]
-
-
- Zunächst muß diese Kamera in der Synology Surveillance Station 7.0 oder höher eingebunden sein und entsprechend
- funktionieren.
-
- Ein SVS-Device zur Steuerung von Funktionen der Surveillance Station wird definiert mit:
-
- Wird eine neue Kamera definiert, wird diesem Device zunächst eine Standardaufnahmedauer von 15 zugewiesen.
- Über das Attribut "rectime" kann die Aufnahmedauer für jede Kamera individuell angepasst werden. Der Wert "0" für "rectime" führt zu einer Endlosaufnahme, die durch "set <name> off" wieder gestoppt werden muß.
- Ein Logeintrag mit einem entsprechenden Hinweis auf diesen Umstand wird geschrieben.
-
- Wird das Attribut "rectime" gelöscht, greift wieder der Default-Wert (15s) für die Aufnahmedauer.
-
- Mit dem Befehl"set <name> on [rectime]" wird die Aufnahmedauer temporär festgelegt und überschreibt einmalig sowohl den Defaultwert als auch den Wert des gesetzten Attributs "rectime".
- Auch in diesem Fall führt "set <name> on 0" zu einer Daueraufnahme.
-
- Eine eventuell in der SVS eingestellte Dauer der Voraufzeichnung wird weiterhin berücksichtigt.
-
- Erkennt das Modul die definierte Kamera als PTZ-Device (Reading "DeviceType = PTZ"), wird automatisch ein
- Steuerungspaneel in der Detailansicht erstellt. Dieses Paneel setzt SVS >= 7.1 voraus. Die Eigenschaften und das
- Verhalten des Paneels können mit den Attributen "ptzPanel_.*" beeinflusst werden.
- Siehe dazu auch den Befehl"set <name> createPTZcontrol".
-
-
-
-
-
- Credentials
-
-
- Nach dem Definieren des Gerätes müssen zuerst die Zugangsparameter gespeichert werden. Das geschieht mit dem Befehl:
-
-
- set <name> credentials <Username> <Passwort>
-
-
- Die Passwortlänge beträgt maximal 20 Zeichen.
- Der Anwender kann in Abhängigkeit der beabsichtigten einzusetzenden Funktionen einen Nutzer im DSM bzw. in der Surveillance
- Station einrichten.
- Ist der DSM-Nutzer der Gruppe Administratoren zugeordnet, hat er auf alle Funktionen Zugriff. Ohne diese Gruppenzugehörigkeit
- können nur Funktionen mit niedrigeren Rechtebedarf ausgeführt werden. Die benötigten Mindestrechte der Funktionen sind in
- der Tabelle weiter unten aufgeführt.
-
- Alternativ zum DSM-Nutzer kann ein in der SVS angelegter Nutzer verwendet werden. Auch in diesem Fall hat ein Nutzer vom
- Typ Manager das Recht alle Funktionen auszuführen, wobei der Zugriff auf bestimmte Kameras/ im Privilegienprofil beschränkt
- werden kann (siehe Hilfefunktion in SVS).
- Als Best Practice wird vorgeschlagen, jeweils einen User im DSM und einen in der SVS anzulegen:
-
-
-
DSM-User als Mitglied der Admin-Gruppe: uneingeschränkter Test aller Modulfunktionen -> session: DSM
-
SVS-User als Manager oder Betrachter: angepasstes Privilegienprofil -> session: SurveillanceStation
-
-
-
- Über das Attribut "session" kann ausgewählt werden, ob die Session mit dem DSM oder der SVS
- aufgebaut werden soll. Weitere Informationen zum Usermanagement in der SVS sind verfügbar mit
- "get <name> versionNotes 5".
- Erfolgt der Session-Aufbau mit dem DSM, stehen neben der SVS Web-API auch darüber hinausgehende API-Zugriffe zur Verfügung,
- die unter Umständen zur Verarbeitung benötigt werden.
-
- Nach der Gerätedefinition ist die Grundeinstellung "Login in das DSM", d.h. es können Credentials mit Admin-Berechtigungen
- genutzt werden um zunächst alle Funktionen der Kameras testen zu können. Danach können die Credentials z.B. in Abhängigkeit
- der benötigten Funktionen auf eine SVS-Session mit entsprechend beschränkten Privilegienprofil umgestellt werden.
-
- Die nachfolgende Aufstellung zeigt die Mindestanforderungen der jeweiligen Modulfunktionen an die Nutzerrechte.
-
-
-
-
set ... credentials
-
-
set ... delPreset
session: ServeillanceStation - Betrachter
-
set ... disable
session: ServeillanceStation - Manager
-
set ... enable
session: ServeillanceStation - Manager
-
set ... expmode
session: ServeillanceStation - Manager
-
set ... extevent
session: DSM - Nutzer Mitglied von Admin-Gruppe
-
set ... goPreset
session: ServeillanceStation - Betrachter mit Privileg Objektivsteuerung der Kamera
-
set ... homeMode
session: ServeillanceStation - Betrachter mit Privileg Home-Modus schalten ( gilt für SVS-Device ! )
-
set ... goAbsPTZ
session: ServeillanceStation - Betrachter mit Privileg Objektivsteuerung der Kamera
-
set ... move
session: ServeillanceStation - Betrachter mit Privileg Objektivsteuerung der Kamera
-
set ... motdetsc
session: ServeillanceStation - Manager
-
set ... on
session: ServeillanceStation - Betrachter mit erweiterten Privileg "manuelle Aufnahme"
-
set ... off
session: ServeillanceStation - Betrachter mit erweiterten Privileg "manuelle Aufnahme"
-
set ... runView
session: ServeillanceStation - Betrachter mit Privileg Liveansicht für Kamera
-
set ... runPatrol
session: ServeillanceStation - Betrachter mit Privileg Objektivsteuerung der Kamera
-
set ... setHome
session: ServeillanceStation - Betrachter
-
set ... setPreset
session: ServeillanceStation - Betrachter
-
set ... snap
session: ServeillanceStation - Betrachter
-
set ... snapGallery
session: ServeillanceStation - Betrachter
-
set ... stopView
-
-
get ... caminfo[all]
session: ServeillanceStation - Betrachter
-
get ... eventlist
session: ServeillanceStation - Betrachter
-
get ... listLog
session: ServeillanceStation - Betrachter
-
get ... listPresets
session: ServeillanceStation - Betrachter
-
get ... scanVirgin
session: ServeillanceStation - Betrachter
-
get ... svsinfo
session: ServeillanceStation - Betrachter
-
get ... snapfileinfo
session: ServeillanceStation - Betrachter
-
get ... snapGallery
session: ServeillanceStation - Betrachter
-
get ... snapinfo
session: ServeillanceStation - Betrachter
-
get ... stmUrlPath
session: ServeillanceStation - Betrachter
-
-
-
-
-
-
-HTTP-Timeout setzen
-
-
- Alle Funktionen dieses Moduls verwenden HTTP-Aufrufe gegenüber der SVS Web API.
- Der Standardwert für den HTTP-Timeout beträgt 4 Sekunden. Durch Setzen des
- Attributes "httptimeout" > 0 kann dieser Wert bei Bedarf entsprechend den technischen
- Gegebenheiten angepasst werden.
-
-
-
-
-
-Set
-
-
- Die aufgeführten set-Befehle sind für CAM/SVS-Devices oder nur für CAM-Devices bzw. nur für SVS-Devices gültig. Sie stehen im
- Drop-Down-Menü des jeweiligen Devices zur Auswahl zur Verfügung.
-
-
-
-
set <name> createStreamDev [generic | mjpeg | switched] (gilt für CAM)
-
- Es wird ein separates Streaming-Device (Typ SSCamSTRM) erstellt. Dieses Device kann z.B. als separates Device
- in einem Dashboard genutzt werden.
- Dem Streaming-Device wird der aktuelle Raum des Kameradevice zugewiesen sofern dort gesetzt.
-
-
-
-
-
-
generic
- das Streaming-Device gibt einen durch das Attribut "genericStrmHtmlTag" bestimmten Content wieder
-
mjpeg
- das Streaming-Device gibt einen permanenten MJPEG Kamerastream wieder (Streamkey Methode)
-
switched
- Wiedergabe unterschiedlicher Streamtypen. Drucktasten zur Steuerung werden angeboten.
-
-
-
-
- Die Gestaltung kann durch HTML-Tags im Attribut "htmlattr" im Kameradevice oder mit den
- spezifischen Attributen im Streaming-Device beeinflusst werden.
- Soll ein HLS-Stream im Streaming-Device vom Typ "switched" gestartet werden, muss die Kamera in der Synology Surveillance Station
- auf das Videoformat H.264 eingestellt und HLS von der eingesetzten SVS-Version unterstützt sein.
- Diese Auswahltaste wird deshalb im nur im Streaming-Device angeboten wenn das Reading "CamStreamFormat = HLS" beinhaltet.
- HLS (HTTP Live Streaming) kann momentan nur auf Mac Safari oder mobilen iOS/Android-Geräten wiedergegeben werden.
- Im "switched"-Device werden Drucktasten zur Steuerung des zu startenden Medientyps angeboten.
- Ein Streaming-Device vom Typ "generic" benötigt die Angabe von HTML-Tags im Attribut "genericStrmHtmlTag". Diese Tags
- spezifizieren den wiederzugebenden Content.
- Die Variablen $HTMLATTR, $NAME sind Platzhalter und übernehmen ein gesetztes Attribut "htmlattr" bzw. den SSCam-Devicenamen.
-
-
-
-
-
-
set <name> createPTZcontrol (gilt für PTZ-CAM)
-
- Es wird ein separates PTZ-Steuerungspaneel (Type SSCamSTRM) erstellt. Es wird der aktuelle Raum des Kameradevice
- zugewiesen sofern dort gesetzt.
- Mit den "ptzPanel_.*"-Attributen bzw. den spezifischen Attributen des erzeugten
- SSCamSTRM-Devices können die Eigenschaften des PTZ-Paneels beeinflusst werden.
-
-
-
-
-
set <name> createSnapGallery (gilt für CAM)
-
- Es wird eine Schnappschußgallerie als separates Device (Type SSCamSTRM) erzeugt. Das Device wird im Raum
- "SnapGallery" erstellt.
- Mit den "snapGallery..."-Attributen bzw. den spezifischen Attributen des erzeugten SSCamSTRM-Devices
- können die Eigenschaften der Schnappschußgallerie beeinflusst werden.
-
-
-
-
-
set <name> credentials <username> <password> (gilt für CAM/SVS)
-
- Setzt Username / Passwort für den Zugriff auf die Synology Surveillance Station.
- Siehe Credentials
-
-
-
-
-
-
set <name> delPreset <PresetName> (gilt für PTZ-CAM)
-
- Löscht einen Preset "<PresetName>". Im FHEMWEB wird eine Drop-Down Liste der aktuell vorhandenen
- Presets angeboten.
-
-
-
-
-
-
set <name> [enable|disable] (gilt für CAM)
-
- Aktviviert / deaktiviert eine Kamera.
- Um eine Liste von Kameras oder alle Kameras (mit Regex) zum Beispiel um 21:46 zu deaktivieren / zu aktivieren zwei Beispiele mit at:
-
- define a13 at 21:46 set CamCP1,CamFL,CamHE1,CamTER disable (enable)
- define a14 at 21:46 set Cam.* disable (enable)
-
-
- Etwas komfortabler gelingt das Schalten aller Kameras über einen Dummy. Zunächst wird der Dummy angelegt:
-
-
- Durch Verknüpfung mit zwei angelegten notify, jeweils ein notify für "enable" und "disable", kann man durch Schalten des Dummys auf "enable" bzw. "disable" alle Kameras auf einmal aktivieren bzw. deaktivieren.
-
set <name> expmode [day|night|auto] (gilt für CAM)
-
- Mit diesem Befehl kann der Belichtungsmodus der Kameras gesetzt werden. Dadurch wird z.B. das Verhalten der Kamera-LED's entsprechend gesteuert.
- Die erfolgreiche Umschaltung wird durch das Reading CamExposureMode ("get ... caminfoall") reportet.
-
- Hinweis:
- Die erfolgreiche Ausführung dieser Funktion ist davon abhängig ob die SVS diese Funktionalität der Kamera unterstützt.
- Ist in SVS -> IP-Kamera -> Optimierung -> Belichtungsmodus das Feld für den Tag/Nachtmodus grau hinterlegt, ist nicht von einer lauffähigen Unterstützung dieser
- Funktion auszugehen.
-
-
-
-
-
set <name> extevent [ 1-10 ] (gilt für SVS)
-
- Dieses Kommando triggert ein externes Ereignis (1-10) in der SVS.
- Die Aktionen, die dieses Ereignis auslöst, sind zuvor in dem Aktionsregeleditor der SVS einzustellen. Es stehen die Ereignisse
- 1-10 zur Verfügung.
- In der Benachrichtigungs-App der SVS können auch Email, SMS oder Mobil (DS-Cam) Nachrichten ausgegeben werden wenn ein externes
- Ereignis ausgelöst wurde.
- Nähere Informationen dazu sind in der Hilfe zum Aktionsregeleditor zu finden.
- Der verwendete User benötigt Admin-Rechte in einer DSM-Session.
-
-
-
-
-
set <name> goAbsPTZ [ X Y | up | down | left | right ] (gilt für CAM)
-
- Mit diesem Kommando wird eine PTZ-Kamera in Richtung einer wählbaren absoluten X/Y-Koordinate bewegt, oder zur maximalen Absolutposition in Richtung up/down/left/right.
- Die Option ist nur für Kameras verfügbar die das Reading "CapPTZAbs=true" (die Fähigkeit für PTZAbs-Aktionen) besitzen. Die Eigenschaften der Kamera kann mit "get <name> caminfoall" abgefragt werden.
-
-
- Beispiel für Ansteuerung absoluter X/Y-Koordinaten:
-
-
- set <name> goAbsPTZ 120 450
-
-
- Dieses Beispiel bewegt die Kameralinse in die Position X=120 und Y=450.
- Der Wertebereich ist dabei:
-
-
- X = 0 - 640 (0 - 319 bewegt nach links, 321 - 640 bewegt nach rechts, 320 bewegt die Linse nicht)
- Y = 0 - 480 (0 - 239 bewegt nach unten, 241 - 480 bewegt nach oben, 240 bewegt die Linse nicht)
-
-
- Die Linse kann damit in kleinsten bis sehr großen Schritten in die gewünschte Richtung bewegt werden.
- Dieser Vorgang muß ggf. mehrfach wiederholt werden um die Kameralinse in die gewünschte Position zu bringen.
-
- Soll die Bewegung mit der maximalen Schrittweite erfolgen, kann zur Vereinfachung der Befehl:
-
-
- set <name> goAbsPTZ [up|down|left|right]
-
-
- verwendet werden. Die Optik wird in diesem Fall mit der größt möglichen Schrittweite zur Absolutposition in der angegebenen Richtung bewegt.
- Auch in diesem Fall muß der Vorgang ggf. mehrfach wiederholt werden um die Kameralinse in die gewünschte Position zu bringen.
-
-
-
-
-
set <name> goPreset <Preset> (gilt für CAM)
-
- Mit diesem Kommando können PTZ-Kameras in eine vordefininierte Position bewegt werden.
- Die Preset-Positionen müssen dazu zunächst in der Synology Surveillance Station angelegt worden sein. Das geschieht in der PTZ-Steuerung im IP-Kamera Setup.
- Die Presets werden über das Kommando "get <name> caminfoall" eingelesen (geschieht bei restart von FHEM automatisch). Der Einlesevorgang kann durch ein Kamerapolling
- regelmäßig wiederholt werden. Ein langes Pollingintervall ist in diesem Fall empfehlenswert, da sich die Presetpositionen nur im Fall der Neuanlage bzw. Änderung verändern werden.
-
-
- Hier ein Beispiel einer PTZ-Steuerung in Abhängigkeit eines IR-Melder Events:
-
-
- define CamFL.Preset.Wandschrank notify MelderTER:on.* set CamFL goPreset Wandschrank, ;; define CamFL.Preset.record at +00:00:10 set CamFL on 5 ;;;; define s3 at +*{3}00:00:05 set CamFL snap ;; define CamFL.Preset.back at +00:00:30 set CamFL goPreset Home
-
-
- Funktionsweise:
- Der IR-Melder "MelderTER" registriert eine Bewegung. Daraufhin wird die Kamera CamFL in die Preset-Position "Wandschrank" gebracht. Eine Aufnahme mit Dauer von 5 Sekunden startet 10 Sekunden
- später. Da die Voraufnahmezeit der Kamera 10s beträgt (vgl. Reading "CamPreRecTime"), startet die effektive Aufnahme wenn der Kameraschwenk beginnt.
- Mit dem Start der Aufnahme werden drei Schnappschüsse im Abstand von 5 Sekunden angefertigt.
- Nach einer Zeit von 30 Sekunden fährt die Kamera wieder zurück in die "Home"-Position.
-
- Ein Auszug aus dem Log verdeutlicht den Ablauf:
-
-
- 2016.02.04 15:02:14 2: CamFL - Camera Flur_Vorderhaus has moved to position "Wandschrank"
- 2016.02.04 15:02:24 2: CamFL - Camera Flur_Vorderhaus Recording with Recordtime 5s started
- 2016.02.04 15:02:29 2: CamFL - Snapshot of Camera Flur_Vorderhaus has been done successfully
- 2016.02.04 15:02:30 2: CamFL - Camera Flur_Vorderhaus Recording stopped
- 2016.02.04 15:02:34 2: CamFL - Snapshot of Camera Flur_Vorderhaus has been done successfully
- 2016.02.04 15:02:39 2: CamFL - Snapshot of Camera Flur_Vorderhaus has been done successfully
- 2016.02.04 15:02:44 2: CamFL - Camera Flur_Vorderhaus has moved to position "Home"
-
-
-
-
-
-
set <name> homeMode [on|off] (gilt für SVS)
-
- Schaltet den HomeMode der Surveillance Station ein bzw. aus.
- Informationen zum HomeMode sind in der Synology Onlinehilfe
- enthalten.
-
-
-
-
-
set <name> motdetsc [camera|SVS|disable] (gilt für CAM)
-
- Der Befehl "motdetsc" (steht für motion detection source) schaltet die Bewegungserkennung in den gewünschten Modus.
- Wird die Bewegungserkennung durch die Kamera / SVS ohne weitere Optionen eingestellt, werden die momentan gültigen Bewegungserkennungsparameter der
- Kamera / SVS beibehalten. Die erfolgreiche Ausführung der Operation lässt sich u.a. anhand des Status von SVS -> IP-Kamera -> Ereigniserkennung ->
- Bewegung nachvollziehen.
- Für die Bewegungserkennung durch SVS bzw. durch Kamera können weitere Optionen angegeben werden. Die verfügbaren Optionen bezüglich der Bewegungserkennung
- durch SVS sind "Empfindlichkeit" und "Schwellwert".
-
-
-
-
set <name> motdetsc SVS [Empfindlichkeit] [Schwellwert]
# Befehlsmuster
-
set <name> motdetsc SVS 91 30
# setzt die Empfindlichkeit auf 91 und den Schwellwert auf 30
-
set <name> motdetsc SVS 0 40
# behält gesetzten Wert für Empfindlichkeit bei, setzt Schwellwert auf 40
-
set <name> motdetsc SVS 15
# setzt die Empfindlichkeit auf 15, Schwellwert bleibt unverändert
-
-
-
-
- Wird die Bewegungserkennung durch die Kamera genutzt, stehen die Optionen "Empfindlichkeit", "Objektgröße" und "Prozentsatz für Auslösung" zur Verfügung.
-
-
-
-
set <name> motdetsc camera [Empfindlichkeit] [Schwellwert] [Prozentsatz]
# Befehlsmuster
-
set <name> motdetsc camera 89 0 20
# setzt die Empfindlichkeit auf 89, Prozentsatz auf 20
-
set <name> motdetsc camera 0 40 10
# behält gesetzten Wert für Empfindlichkeit bei, setzt Schwellwert auf 40, Prozentsatz auf 10
-
set <name> motdetsc camera 30
# setzt die Empfindlichkeit auf 30, andere Werte bleiben unverändert
-
-
-
-
- Es ist immer die Reihenfolge der Optionswerte zu beachten. Nicht gewünschte Optionen sind mit "0" zu besetzen sofern danach Optionen folgen
- deren Werte verändert werden sollen (siehe Beispiele oben). Der Zahlenwert der Optionen beträgt 1 - 99 (außer Sonderfall "0").
-
- Die jeweils verfügbaren Optionen unterliegen der Funktion der Kamera und der Unterstützung durch die SVS. Es können jeweils nur die Optionen genutzt werden die in
- SVS -> Kamera bearbeiten -> Ereigniserkennung zur Verfügung stehen. Weitere Infos sind der Online-Hilfe zur SVS zu entnehmen.
-
- Über den Befehl "get <name> caminfoall" wird auch das Reading "CamMotDetSc" aktualisiert welches die gegenwärtige Einstellung der Bewegungserkennung dokumentiert.
- Es werden nur die Parameter und Parameterwerte angezeigt, welche die SVS aktiv unterstützt. Die Kamera selbst kann weiterführende Einstellmöglichkeiten besitzen.
set <name> move [ right | up | down | left | dir_X ] [Sekunden] (gilt für CAM bis SVS Version 7.1)
- set <name> move [ right | upright | up | upleft | left | downleft | down | downright ] [Sekunden] (gilt für CAM ab SVS Version 7.2)
-
- Mit diesem Kommando wird eine kontinuierliche Bewegung der PTZ-Kamera gestartet. Neben den vier Grundrichtungen up/down/left/right stehen auch
- Zwischenwinkelmaße "dir_X" zur Verfügung. Die Feinheit dieser Graduierung ist von der Kamera abhängig und kann dem Reading "CapPTZDirections" entnommen werden.
-
- Das Bogenmaß von 360 Grad teilt sich durch den Wert von "CapPTZDirections" und beschreibt die Bewegungsrichtungen beginnend mit "0=rechts" entgegen dem
- Uhrzeigersinn. D.h. bei einer Kamera mit "CapPTZDirections = 8" bedeutet dir_0 = rechts, dir_2 = oben, dir_4 = links, dir_6 = unten bzw. dir_1, dir_3, dir_5 und dir_7
- die entsprechenden Zwischenrichtungen. Die möglichen Bewegungsrichtungen bei Kameras mit "CapPTZDirections = 32" sind dementsprechend kleinteiliger.
-
- Im Gegensatz zum "set <name> goAbsPTZ"-Befehl startet der Befehl "set <name> move" eine kontinuierliche Bewegung bis ein Stop-Kommando empfangen wird.
- Das Stop-Kommando wird nach Ablauf der optional anzugebenden Zeit [Sekunden] ausgelöst. Wird diese Laufzeit nicht angegeben, wird implizit Sekunde = 1 gesetzt.
-
- Beispiele:
-
-
- set <name> move up 0.5 : bewegt PTZ 0,5 Sek. (zzgl. Prozesszeit) nach oben
- set <name> move dir_1 1.5 : bewegt PTZ 1,5 Sek. (zzgl. Prozesszeit) nach rechts-oben
- set <name> move dir_20 0.7 : bewegt PTZ 1,5 Sek. (zzgl. Prozesszeit) nach links-unten ("CapPTZDirections = 32)"
-
-
-
-
-
-
set <name> [on [<rectime>] | off] (gilt für CAM)
-
- Der Befehl "set <name> on" startet eine Aufnahme. Die Standardaufnahmedauer beträgt 15 Sekunden. Sie kann mit dem
- Attribut "rectime" individuell festgelegt werden.
- Die im Attribut (bzw. im Standard) hinterlegte Aufnahmedauer kann einmalig mit "set <name> on <rectime>"
- überschrieben werden.
- Die Aufnahme stoppt automatisch nach Ablauf der Zeit "rectime".
-
- Ein Sonderfall ist der Start einer Daueraufnahme mit "set <name> on 0" bzw. dem Attributwert "rectime = 0".
- In diesem Fall wird eine Daueraufnahme gestartet, die explizit wieder mit dem Befehl "set <name> off" gestoppt
- werden muß.
-
- Das Aufnahmeverhalten kann weiterhin mit dem Attribut "recextend" beeinflusst werden.
-
- Attribut "recextend = 0" bzw. nicht gesetzt (Standard):
-
-
wird eine Aufnahme mit z.B. rectime=22 gestartet, wird kein weiterer Startbefehl für eine Aufnahme akzeptiert bis diese gestartete Aufnahme nach 22 Sekunden
- beendet ist. Ein Hinweis wird bei verbose=3 im Logfile protokolliert.
-
-
-
- Attribut "recextend = 1" gesetzt:
-
-
eine zuvor gestartete Aufnahme wird bei einem erneuten "set on" -Befehl um die Aufnahmezeit "rectime" verlängert. Das bedeutet, dass der Timer für
- den automatischen Stop auf den Wert "rectime" neu gesetzt wird. Dieser Vorgang wiederholt sich mit jedem Start-Befehl. Dadurch verlängert sich eine laufende
- Aufnahme bis kein Start-Inpuls mehr registriert wird.
-
-
eine zuvor gestartete Endlos-Aufnahme wird mit einem erneuten "set on"-Befehl nach der Aufnahmezeit "rectime" gestoppt (Timerneustart). Ist dies
- nicht gewünscht, ist darauf zu achten dass bei der Verwendung einer Endlos-Aufnahme das Attribut "recextend" nicht verwendet wird.
-
-
-
- Beispiele für einfachen Start/Stop einer Aufnahme:
-
-
-
-
set <name> on [rectime]
startet die Aufnahme der Kamera <name>, automatischer Stop der Aufnahme nach Ablauf der Zeit [rectime] (default 15s oder wie im Attribut "rectime" angegeben)
-
set <name> off
stoppt die Aufnahme der Kamera <name>
-
-
-
-
-
-
set <name> optimizeParams [mirror:<value>] [flip:<value>] [rotate:<value>] [ntp:<value>] (gilt für CAM)
-
- Setzt eine oder mehrere Eigenschaften für die Kamera. Das Video kann gespiegelt (mirror), auf den Kopf gestellt (flip) oder
- gedreht (rotate) werden. Die jeweiligen Eigenschaften müssen von der Kamera unterstützt werden. Mit "ntp" wird der Zeitserver
- eingestellt den die Kamera zur Zeitsynchronisation verwendet.
-
- <value> kann sein für:
-
-
mirror, flip, rotate: true | false
-
ntp: der Name oder die IP-Adresse des Zeitservers
-
-
-
- Beispiele:
- set <name> optimizeParams mirror:true flip:true ntp:time.windows.com
- # Das Bild wird gespiegelt, auf den Kopf gestellt und der Zeitserver auf "time.windows.com" eingestellt.
- set <name> optimizeParams ntp:Surveillance%20Station
- # Die Surveillance Station wird als Zeitserver eingestellt. (NTP-Dienst muss im DSM aktiviert sein)
- set <name> optimizeParams mirror:true flip:false rotate:true
- # Das Bild wird gespiegelt und um 90 Grad gedreht.
-
-
-
-
-
-
set <name> pirSensor [activate | deactivate] (gilt für CAM)
-
- Aktiviert / deaktiviert den Infrarot-Sensor der Kamera (sofern die Kamera einen PIR-Sensor enthält).
-
-
-
-
-
set <name> runPatrol <Patrolname> (gilt für CAM)
-
- Dieses Kommando startet die vordefinierterte Überwachungstour einer PTZ-Kamera.
- Die Überwachungstouren müssen dazu zunächst in der Synology Surveillance Station angelegt worden sein.
- Das geschieht in der PTZ-Steuerung im IP-Kamera Setup -> PTZ-Steuerung -> Überwachung.
- Die Überwachungstouren (Patrols) werden über das Kommando "get <name> caminfoall" eingelesen, welches beim Restart von FHEM automatisch abgearbeitet wird.
- Der Einlesevorgang kann durch ein Kamerapolling regelmäßig wiederholt werden. Ein langes Pollingintervall ist in diesem Fall empfehlenswert, da sich die
- Überwachungstouren nur im Fall der Neuanlage bzw. Änderung verändern werden.
- Nähere Informationen zur Anlage von Überwachungstouren sind in der Hilfe zur Surveillance Station enthalten.
-
- MJPEG-LiveStream. Audiowiedergabe wird mit angeboten wenn verfügbar.
-
live_fw_hls
- HLS-LiveStream (aktuell nur Mac Safari und mobile iOS/Android-Geräte)
-
live_link
- Link zu einem MJPEG-Livestream
-
live_open [<room>]
- öffnet MJPEG-Stream in separatem Browser-Fenster
-
lastrec_fw
- letzte Aufnahme als iFrame Objekt
-
lastrec_fw_MJPEG
- nutzbar wenn Aufnahme im Format MJPEG vorliegt
-
lastrec_fw_MPEG4/H.264
- nutzbar wenn Aufnahme im Format MPEG4/H.264 vorliegt
-
lastrec_open [<room>]
- letzte Aufnahme wird in separatem Browser-Fenster geöffnet
-
lastsnap_fw
- letzter Schnappschuss wird dargestellt
-
-
-
-
- Mit "live_fw, live_link, live_open" wird ein MJPEG-Livestream, entweder als eingebettetes Image
- oder als generierter Link, gestartet.
- Der Befehl "live_open" öffnet ein separates Browserfenster mit dem MJPEG-Livestream. Wird dabei optional der Raum mit
- angegeben, wird das Browserfenster nur dann gestartet, wenn dieser Raum aktuell im Browser geöffnet ist.
- Soll mit "live_fw_hls" ein HLS-Stream verwendet werden, muss die Kamera in der Synology Surveillance Station auf
- das Videoformat H.264 (nicht MJPEG) eingestellt und HLS durch die eingesetzte SVS-Version unterstützt sein.
- Diese Möglichkeit wird deshalb nur dann angeboten wenn das Reading "CamStreamFormat" den Wert "HLS" hat.
-
-
- Der Zugriff auf die letzte Aufnahme einer Kamera kann über die Optionen "lastrec_fw.*" bzw. "lastrec_open" erfolgen.
- Bei Verwendung von "lastrec_fw.*" wird die letzte Aufnahme als eingebettetes iFrame-Objekt abgespielt. Es werden entsprechende
- Steuerungselemente zur Wiedergabegeschwindigkeit usw. angeboten wenn verfügbar.
-
- Der Befehl "set <name> runView lastsnap_fw" zeigt den letzten Schnappschuss der Kamera eingebettet an.
- Durch Angabe des optionalen Raumes bei "lastrec_open" erfolgt die gleiche Einschränkung wie bei "live_open".
- Die Gestaltung der Fenster im FHEMWEB kann durch HTML-Tags im Attribut "htmlattr" beeinflusst werden.
-
-
- Wird der Stream als live_fw gestartet, ändert sich die Größe entsprechend der Angaben von Width und Hight.
- Das Kommando "set <name> runView live_open" startet den Livestreamlink sofort in einem neuen
- Browserfenster.
- Dabei wird für jede aktive FHEMWEB-Session eine Fensteröffnung initiiert. Soll dieses Verhalten geändert werden, kann
- "set <name> runView live_open <room>" verwendet werden um das Öffnen des Browserfensters in einem
- beliebigen, in einer FHEMWEB-Session aktiven Raum "<room>", zu initiieren.
- Das gesetzte Attribut "livestreamprefix" überschreibt im Reading "LiveStreamUrl"
- die Angaben für Protokoll, Servername und Port. Damit kann z.B. die LiveStreamUrl für den Versand und externen Zugriff
- auf die SVS modifiziert werden.
-
- Der Livestream wird über das Kommando "set <name> stopView" wieder beendet.
- Die "runView" Funktion schaltet ebenfalls Streaming-Devices vom Typ "switched" in den entsprechenden Modus.
-
- Abhängig vom wiedergegebenen Content werden unterschiedliche Steuertasten angeboten:
-
-
-
-
Start Recording
- startet eine Endlosaufnahme
-
Stop Recording
- stoppt eine Aufnahme
-
Take Snapshot
- löst einen Schnappschuß aus
-
Switch off
- stoppt eine laufende Wiedergabe
-
-
-
-
- Hinweis zu HLS (HTTP Live Streaming):
- Das Video startet mit einer technologisch bedingten Verzögerung. Jeder Stream wird in eine Reihe sehr kleiner Videodateien
- (mit etwa 10 Sekunden Länge) segmentiert und an den Client ausgeliefert.
- Die Kamera muss in der SVS auf das Videoformat H.264 eingestellt sein und nicht jeder Kameratyp ist gleichermassen für
- HLS-Streaming geeignet.
- Momentan kann HLS nur durch den Mac Safari Browser sowie auf mobilen iOS/Android-Geräten wiedergegeben werden.
-
-
-
-
-
-
-
set <name> setHome <PresetName> (gilt für PTZ-CAM)
-
- Setzt die Home-Position der Kamera auf einen vordefinierten Preset "<PresetName>" oder auf die aktuell angefahrene
- Position.
-
-
-
-
-
-
set <name> setPreset <PresetNummer> [<PresetName>] [<Speed>] (gilt für PTZ-CAM)
-
- Setzt einen Preset mit dem Namen "<PresetName>" auf die aktuell angefahrene Position der Kamera. Optional kann die
- Geschwindigkeit angegeben werden (<Speed>). Ist kein PresetName angegeben, wird die PresetNummer als Name verwendet.
- Aus diesem Grund ist <PresetName> optional definiert, sollte jedoch im Normalfall gesetzt werden.
-
-
-
-
-
-
set <name> snap (gilt für CAM)
-
- Ein Schnappschuß kann ausgelöst werden mit:
-
- set <name> snap
-
-
- Nachfolgend einige Beispiele für die Auslösung von Schnappschüssen.
-
- Soll eine Reihe von Schnappschüssen ausgelöst werden wenn eine Aufnahme startet, kann das z.B. durch folgendes notify geschehen.
- Sobald der Start der Kamera CamHE1 ausgelöst wird (Attribut event-on-change-reading -> "Record" setzen), werden abhängig davon 3 Snapshots im Abstand von 2 Sekunden getriggert.
-
-
- define he1_snap_3 notify CamHE1:Record.*Start define h3 at +*{3}00:00:02 set CamHE1 snap
-
-
- Triggern von 2 Schnappschüssen der Kamera "CamHE1" im Abstand von 6 Sekunden nachdem der Bewegungsmelder "MelderHE1" einen Event gesendet hat,
- kann z.B. mit folgendem notify geschehen:
-
-
- define he1_snap_2 notify MelderHE1:on.* define h2 at +*{2}00:00:06 set CamHE1 snap
-
-
- Es wird die ID und der Filename des letzten Snapshots als Wert der Variable "LastSnapId" bzw. "LastSnapFilename" in den Readings der Kamera ausgegeben.
-
-
-
-
-
set <name> snapGallery [1-10] (gilt für CAM)
-
- Der Befehl ist nur vorhanden wenn das Attribut "snapGalleryBoost=1" gesetzt wurde.
- Er erzeugt eine Ausgabe der letzten [x] Schnappschüsse ebenso wie "get <name> snapGallery". Abweichend von "get" wird mit Attribut
- Attribut "snapGalleryBoost=1" kein Popup erzeugt, sondern die Schnappschußgalerie als Browserseite
- dargestellt. Alle weiteren Funktionen und Attribute entsprechen dem "get <name> snapGallery" Kommando.
- Wenn die Ausgabe einer Schnappschußgalerie, z.B. über ein "at oder "notify", getriggert wird, sollte besser das
- "get <name> snapGallery" Kommando anstatt "set" verwendet werden.
-
-
-
-
-
set <name> startTracking (gilt für CAM mit Tracking Fähigkeit)
-
- Startet Objekt Tracking der Kamera.
- Der Befehl ist nur vorhanden wenn die Surveillance Station die Fähigkeit der Kamera zum Objekt Tracking erkannt hat
- (Reading "CapPTZObjTracking").
-
-
-
-
-
set <name> stopTracking (gilt für CAM mit Tracking Fähigkeit)
-
- Stoppt Objekt Tracking der Kamera.
- Der Befehl ist nur vorhanden wenn die Surveillance Station die Fähigkeit der Kamera zum Objekt Tracking erkannt hat
- (Reading "CapPTZObjTracking").
-
-
-
-
-
-
-
-Get
-
-
- Mit SSCam können die Eigenschaften der Surveillance Station und der Kameras abgefragt werden.
- Die aufgeführten get-Befehle sind für CAM/SVS-Devices oder nur für CAM-Devices bzw. nur für SVS-Devices gültig. Sie stehen im
- Drop-Down-Menü des jeweiligen Devices zur Auswahl zur Verfügung.
-
-
-
get <name> caminfoall (gilt für CAM/SVS)
- get <name> caminfo (gilt für CAM)
-
- Es werden SVS-Parameter und abhängig von der Art der Kamera (z.B. Fix- oder PTZ-Kamera) die verfügbaren Kamera-Eigenschaften
- ermittelt und als Readings zur Verfügung gestellt.
- So wird zum Beispiel das Reading "Availability" auf "disconnected" gesetzt falls die Kamera von der Surveillance Station
- getrennt ist.
- "getcaminfo" ruft eine Teilmenge von "getcaminfoall" ab.
-
-
-
-
-
get <name> eventlist (gilt für CAM)
-
- Es wird das Reading "CamEventNum" und "CamLastRec"
- aktualisiert, welches die Gesamtanzahl der registrierten Kameraevents und den Pfad / Namen der letzten Aufnahme enthält.
- Dieser Befehl wird implizit mit "get <name> caminfoall" ausgeführt.
- Mit dem Attribut "videofolderMap" kann der Inhalt des Readings "VideoFolder" überschrieben werden.
- Dies kann von Vortel sein wenn das Surveillance-Verzeichnis der SVS an dem lokalen PC unter anderem Pfadnamen gemountet ist
- und darüber der Zugriff auf die Aufnahmen erfolgen soll (z.B. Verwendung bei Email-Versand).
-
- Ein DOIF-Beispiel für den Email-Versand von Snapshot und Aufnahmelink per non-blocking sendmail:
-
- define CamHE1.snap.email DOIF ([CamHE1:"LastSnapFilename"])
- ({DebianMailnbl ('Recipient@Domain','Bewegungsalarm CamHE1','Eine Bewegung wurde an der Haustür registriert. Aufnahmelink: \
- \[CamHE1:VideoFolder]\[CamHE1:CamLastRec]','/media/sf_surveillance/@Snapshot/[CamHE1:LastSnapFilename]')})
-
-
-
-
-
get <name> homeModeState (gilt für SVS)
-
- HomeMode-Status der Surveillance Station wird abgerufen.
-
-
-
-
-
get <name> listLog [severity:<Loglevel>] [limit:<Zeilenzahl>] [match:<Suchstring>] (gilt für SVS)
-
- Ruft das Surveillance Station Log vom Synology Server ab. Ohne Angabe der optionalen Zusätze wird das gesamte Log abgerufen.
- Es können alle oder eine Auswahl der folgenden Optionen angegeben werden:
-
-
-
<Loglevel> - Information, Warning oder Error. Nur Sätze mit dem Schweregrad werden abgerufen (default: alle)
-
<Zeilenzahl> - die angegebene Anzahl der Logzeilen (neueste) wird abgerufen (default: alle)
-
<Suchstring> - nur Logeinträge mit dem angegeben String werden abgerufen (Achtung: kein Regex, der Suchstring wird im Call an die SVS mitgegeben)
-
-
-
- Beispiele
-
- get <name> listLog severity:Error limit:5
- Zeigt die letzten 5 Logeinträge mit dem Schweregrad "Error"
- get <name> listLog severity:Information match:Carport
- Zeigt alle Logeinträge mit dem Schweregrad "Information" die den String "Carport" enthalten
- get <name> listLog severity:Warning
- Zeigt alle Logeinträge mit dem Schweregrad "Warning"
-
-
-
- Wurde mit dem Attribut "pollcaminfoall" das Polling der SVS aktiviert, wird das Reading
- "LastLogEntry" erstellt.
- Im Protokoll-Setup der SVS kann man einstellen was protokolliert werden soll. Für weitere Informationen
- siehe Synology Online-Hlfe.
-
-
-
-
-
get <name> listPresets (gilt für PTZ-CAM)
-
- Die für die Kamera gespeicherten Presets werden in einem Popup ausgegeben.
-
-
-
-
-
get <name> scanVirgin (gilt für CAM/SVS)
-
- Wie mit get caminfoall werden alle Informationen der SVS und Kamera abgerufen. Allerdings wird in jedem Fall eine
- neue Session ID generiert (neues Login), die Kamera-ID neu ermittelt und es werden alle notwendigen API-Parameter neu
- eingelesen.
-
-
-
-
-
get <name> snapGallery [1-10] (gilt für CAM)
-
- Es wird ein Popup mit den letzten [x] Schnapschüssen erzeugt. Ist das Attribut "snapGalleryBoost" gesetzt,
- werden die letzten Schnappschüsse (default 3) über Polling abgefragt und im Speicher gehalten. Das Verfahren hilft die Ausgabe zu beschleunigen,
- kann aber möglicherweise nicht den letzten Schnappschuß anzeigen, falls dieser NICHT über das Modul ausgelöst wurde.
- Diese Funktion kann ebenfalls, z.B. mit "at" oder "notify", getriggert werden. Dabei wird die Schnappschußgalerie auf allen
- verbundenen FHEMWEB-Instanzen als Popup angezeigt.
-
- Zur weiteren Steuerung dieser Funktion stehen die Attribute:
-
-
-
snapGalleryBoost
-
snapGalleryColumns
-
snapGalleryHtmlAttr
-
snapGalleryNumber
-
snapGallerySize
-
- zur Verfügung.
-
-
-
- Hinweis:
- Abhängig von der Anzahl und Auflösung (Qualität) der Schnappschuß-Images werden entsprechend ausreichende CPU und/oder
- RAM-Ressourcen benötigt.
-
-
-
-
-
get <name> snapfileinfo (gilt für CAM)
-
- Es wird der Filename des letzten Schnapschusses ermittelt. Der Befehl wird implizit mit "get <name> snap"
- ausgeführt.
-
-
-
-
-
get <name> snapinfo (gilt für CAM)
-
- Es werden Schnappschussinformationen gelesen. Hilfreich wenn Schnappschüsse nicht durch SSCam, sondern durch die Bewegungserkennung der Kamera
- oder Surveillance Station erzeugt werden.
-
-
-
-
-
get <name> stmUrlPath (gilt für CAM)
-
- Mit diesem Kommando wird der aktuelle Streamkey der Kamera abgerufen und das Reading mit dem Key-Wert gefüllt.
- Dieser Streamkey kann verwendet werden um eigene Aufrufe eines Livestreams aufzubauen (siehe Beispiel).
- Wenn das Attribut "showStmInfoFull" gesetzt ist, werden zusaätzliche Stream-Informationen wie "StmKeyUnicst", "StmKeymjpegHttp" ausgegeben.
- Diese Readings enthalten die gültigen Stream-Pfade zu einem Livestream und können z.B. versendet und von einer entsprechenden Anwendung ohne session Id geöffnet werden.
- Wenn das Attribut "livestreamprefix" (Format: "http(s)://<hostname><port>) gesetzt ist, wird der Servername und Port überschrieben soweit es sinnvoll ist.
- Wird Polling der Kameraeigenschaften genutzt, wird die stmUrlPath-Funktion automatisch mit ausgeführt.
-
-
- Beispiel für den Aufbau eines Http-Calls zu einem Livestream mit StmKey:
-
-
-
- cameraId (Internal CAMID), StmKey müssen durch gültige Werte ersetzt werden.
-
- Hinweis:
-
- Falls der Stream-Aufruf versendet und von extern genutzt wird sowie hostname / port durch gültige Werte ersetzt und die
- Routerports entsprechend geöffnet werden, ist darauf zu achten, dass diese sensiblen Daten nicht durch unauthorisierte Personen
- für den Zugriff genutzt werden können !
-
-
-
-
-
-
get <name> storedCredentials (gilt für CAM/SVS)
-
- Die gespeicherten Anmeldeinformationen (Credentials) werden in einem Popup als Klartext angezeigt.
-
-
-
-
-
get <name> svsinfo (gilt für CAM/SVS)
-
- Ermittelt allgemeine Informationen zur installierten SVS-Version und andere Eigenschaften.
-
-
-
-
-
get <name> versionNotes [hints | rel | <key>] (gilt für CAM/SVS)
-
- Zeigt Release Informationen und/oder Hinweise zum Modul an. Es sind nur Release Informationen mit Bedeutung für den
- Modulnutzer enthalten.
- Sind keine Optionen angegben, werden sowohl Release Informationen als auch Hinweise angezeigt. "rel" zeigt nur Release
- Informationen und "hints" nur Hinweise an. Mit der <key>-Angabe wird der Hinweis mit der angegebenen Nummer
- angezeigt.
- Ist das Attribut "language = DE" im global Device gesetzt, erfolgt die Ausgabe der Hinweise in deutscher Sprache.
-
-
-
-
-
-
-
- Polling der Kamera/SVS-Eigenschaften:
-
- Die Abfrage der Kameraeigenschaften erfolgt automatisch, wenn das Attribut "pollcaminfoall" (siehe Attribute) mit einem Wert > 10 gesetzt wird.
- Per Default ist das Attribut "pollcaminfoall" nicht gesetzt und das automatische Polling nicht aktiv.
- Der Wert dieses Attributes legt das Intervall der Abfrage in Sekunden fest. Ist das Attribut nicht gesetzt oder < 10 wird kein automatisches Polling
- gestartet bzw. gestoppt wenn vorher der Wert > 10 gesetzt war.
-
- Das Attribut "pollcaminfoall" wird durch einen Watchdog-Timer überwacht. Änderungen des Attributwertes werden alle 90 Sekunden ausgewertet und entsprechend umgesetzt.
- Eine Änderung des Pollingstatus / Pollingintervalls wird im FHEM-Logfile protokolliert. Diese Protokollierung kann durch Setzen des Attributes "pollnologging=1" abgeschaltet werden.
- Dadurch kann ein unnötiges Anwachsen des Logs vermieden werden. Ab verbose=4 wird allerdings trotz gesetzten "pollnologging"-Attribut ein Log des Pollings
- zu Analysezwecken aktiviert.
-
- Wird FHEM neu gestartet, wird bei aktivierten Polling der ersten Datenabruf innerhalb 60s nach dem Start ausgeführt.
-
- Der Status des automatischen Pollings wird durch das Reading "PollState" signalisiert:
-
-
-
PollState = Active - automatisches Polling wird mit Intervall entsprechend "pollcaminfoall" ausgeführt
-
PollState = Inactive - automatisches Polling wird nicht ausgeführt
-
-
-
- Die Bedeutung der Readingwerte ist unter Readings beschrieben.
-
- Hinweise:
-
- Wird Polling eingesetzt, sollte das Intervall nur so kurz wie benötigt eingestellt werden da die ermittelten Werte überwiegend statisch sind.
- Das eingestellte Intervall sollte nicht kleiner sein als die Summe aller HTTP-Verarbeitungszeiten.
- Pro Pollingaufruf und Kamera werden ca. 10 - 20 Http-Calls gegen die Surveillance Station abgesetzt.
- Bei einem eingestellten HTTP-Timeout (siehe Attribut) "httptimeout") von 4 Sekunden kann die theoretische Verarbeitungszeit nicht höher als 80 Sekunden betragen.
- In dem Beispiel sollte man das Pollingintervall mit einem Sicherheitszuschlag auf nicht weniger 160 Sekunden setzen.
- Ein praktikabler Richtwert könnte zwischen 600 - 1800 (s) liegen.
-
- Sind mehrere Kameras in SSCam definiert, sollte "pollcaminfoall" nicht bei allen Kameras auf exakt den gleichen Wert gesetzt werden um Verarbeitungsengpässe
- und dadurch versursachte potentielle Fehlerquellen bei der Abfrage der Synology Surveillance Station zu vermeiden.
- Ein geringfügiger Unterschied zwischen den Pollingintervallen der definierten Kameras von z.B. 1s kann bereits als ausreichend angesehen werden.
-
-
-
-Internals
-
- Die Bedeutung der verwendeten Internals stellt die nachfolgende Liste dar:
-
-
CAMID - die ID der Kamera in der SVS, der Wert wird automatisch anhand des SVS-Kameranamens ermittelt.
-
CAMNAME - der Name der Kamera in der SVS
-
COMPATIBILITY - Information bis zu welcher SVS-Version das Modul kompatibel bzw. zur Zeit getestet ist (siehe Reading "compstate")
-
CREDENTIALS - der Wert ist "Set" wenn die Credentials gesetzt wurden
-
MODEL - Unterscheidung von Kamera-Device (Hersteller - Kameratyp) und Surveillance Station Device (SVS)
-
NAME - der Kameraname in FHEM
-
OPMODE - die zuletzt ausgeführte Operation des Moduls
-
SERVERADDR - IP-Adresse des SVS Hostes
-
SERVERPORT - der SVS-Port
-
-
-
-
-
-
-
-Attribute
-
-
-
-
-
-
debugactivetoken
- wenn gesetzt wird der Status des Active-Tokens gelogged - nur für Debugging, nicht im
- normalen Betrieb benutzen !
-
-
-
disable
- deaktiviert das Gerätemodul bzw. die Gerätedefinition
-
-
-
genericStrmHtmlTag
- Das Attribut enthält HTML-Tags zur Video-Spezifikation in einem Streaming-Device von Typ "generic".
- (siehe "set <name> createStreamDev generic")
livestreamprefix
- Überschreibt die Angaben zu Protokoll, Servernamen und Port in StmKey.*-Readings bzw. der Livestreamadresse zur
- Weiterverwendung z.B. als externer Link.
- Die Spezifikation kann auf zwei Arten erfolgen:
-
-
-
-
DEF
: es wird Protokoll, Servername und Port aus der Definition
- des SSCam-Devices verwendet
-
http(s)://<servername>:<port>
: eine eigene Adressenangabe wird verwendet
-
-
-
- Servername kann der Name oder die IP-Adresse der Synology Surveillance Station sein.
-
-
-
-
-
loginRetries
- setzt die Anzahl der Login-Wiederholungen im Fehlerfall (default = 3)
-
-
-
noQuotesForSID
- dieses Attribut kann in bestimmten Fällen die Fehlermeldung "402 - permission denied"
- vermeiden und ein login ermöglichen.
-
-
-
pollcaminfoall
- Intervall der automatischen Eigenschaftsabfrage (Polling) einer Kamera (kleiner/gleich 10: kein
- Polling, größer 10: Polling mit Intervall)
-
-
-
pollnologging
- "0" bzw. nicht gesetzt = Logging Gerätepolling aktiv (default), "1" = Logging
- Gerätepolling inaktiv
-
-
-
ptzPanel_Home
- Im PTZ-Steuerungspaneel wird dem Home-Icon (im Attribut "ptzPanel_row02") automatisch der Wert des Readings
- "PresetHome" zugewiesen.
- Mit "ptzPanel_Home" kann diese Zuweisung mit einem Preset aus der verfügbaren Preset-Liste geändert werden.
-
-
-
ptzPanel_iconPath
- Pfad für Icons im PTZ-Steuerungspaneel, default ist "www/images/sscam".
- Der Attribut-Wert wird für alle Icon-Dateien außer *.svg verwendet.
-
-
-
ptzPanel_iconPrefix
- Prefix für Icon-Dateien im PTZ-Steuerungspaneel, default ist "black_btn_".
- Der Attribut-Wert wird für alle Icon-Dateien außer *.svg verwendet.
- Beginnen die verwendeten Icon-Dateien z.B. mit "black_btn_" ("black_btn_CAMDOWN.png"), braucht das Icon in den
- Attributen "ptzPanel_row[00-09]" nur noch mit dem darauf folgenden Teilstring, z.B. "CAMDOWN.png" benannt zu werden.
-
-
-
-
ptzPanel_row[00-09] <command>:<icon>,<command>:<icon>,...
- Für PTZ-Kameras werden automatisch die Attribute "ptzPanel_row00" bis "ptzPanel_row04" zur Verwendung im
- PTZ-Steuerungspaneel angelegt.
- Die Attribute enthalten eine Komma-separarierte Liste von Befehl:Icon-Kombinationen (Tasten) je Paneelzeile.
- Eine Paneelzeile kann beliebig viele Tasten enthalten. Die Attribute "ptzPanel_row00" bis "ptzPanel_row04" können nicht
- gelöscht werden da sie in diesem Fall automatisch wieder angelegt werden. Der User kann die Attribute ändern und ergänzen.
- Diese Änderungen bleiben erhalten.
- Bei Bedarf kann die Belegung der Home-Taste in "ptzPanel_row02" geändert werden mit dem Attribut "ptzPanel_Home".
- Die Icons werden im Pfad "ptzPanel_iconPath" gesucht. Dem Icon-Namen wird "ptzPanel_iconPrefix" vorangestellt.
- Eigene Erweiterungen des PTZ-Steuerungspaneels können über die Attribute "ptzPanel_row05" bis "ptzPanel_row09"
- vorgenommen werden. Zur Erstellung eigener Icons gibt es eine Vorlage im SVN. Für weitere Informationen bitte
- "get <name> versionNotes 2" ausführen.
-
-
- Hinweis
- Für eine Leerfeld verwenden sie bitte ":CAMBLANK.png" bzw. ":CAMBLANK.png,:CAMBLANK.png,:CAMBLANK.png,..." für eine
- Leerzeile.
-
-
-
- Beispiel:
- attr <name> ptzPanel_row00 move upleft:CAMUPLEFTFAST.png,:CAMBLANK.png,move up:CAMUPFAST.png,:CAMBLANK.png,move upright:CAMUPRIGHTFAST.png
- # Der Befehl "move upleft" wird der Kamera beim Druck auf Tastenicon "CAMUPLEFTFAST.png" übermittelt.
-
-
-
-
-
-
ptzPanel_use
- Die Anzeige des PTZ-Steuerungspaneels in der Detailanzeige bzw. innerhalb eines generierten Streamdevice wird
- ein- bzw. ausgeschaltet (default ein).
-
-
-
rectime
- festgelegte Aufnahmezeit wenn eine Aufnahme gestartet wird. Mit rectime = 0 wird eine
- Endlosaufnahme gestartet. Ist "rectime" nicht gesetzt, wird der Defaultwert von 15s
- verwendet.
-
-
-
recextend
- "rectime" einer gestarteten Aufnahme wird neu gesetzt. Dadurch verlängert sich die
- Aufnahemzeit einer laufenden Aufnahme
-
-
-
session
- Auswahl der Login-Session. Nicht gesetzt oder "DSM" -> session wird mit DSM aufgebaut
- (Standard). "SurveillanceStation" -> Session-Aufbau erfolgt mit SVS.
- Um eine Session mit der Surveillance Station aufzubauen muss ein Nutzer mit passenden Privilegien Profil in der SVS
- angelegt werden. Für weitere Informationen bitte "get <name> versionNotes 5" ausführen.
-
-
-
simu_SVSversion
- Simuliert eine andere SVS-Version. (es ist nur eine niedrigere als die installierte SVS
- Version möglich !)
-
-
-
snapGalleryBoost
- Wenn gesetzt, werden die letzten Schnappschüsse (default 3) über Polling im Speicher gehalten und mit "set/get snapGallery"
- aufbereitet angezeigt. Dieser Modus bietet sich an wenn viele bzw. Fullsize Images angezeigt werden sollen.
- Ist das Attribut eingeschaltet, können bei "set/get snapGallery" keine Argumente mehr mitgegeben werden.
- (siehe Attribut "snapGalleryNumber")
-
-
-
snapGalleryColumns
- Die Anzahl der Snaps die in einer Reihe im Popup erscheinen sollen (default 3).
-
-
-
snapGalleryHtmlAttr
- hiermit kann die Bilddarstellung beeinflusst werden.
- Ist das Attribut nicht gesetzt, wird das Attribut "htmlattr" verwendet.
- Ist auch dieses nicht gesetzt, wird eine Standardvorgabe verwendet (width="500" height="325").
snapGalleryNumber
- Die Anzahl der abzurufenden Schnappschüsse (default 3).
-
-
-
snapGallerySize
- Mit diesem Attribut kann die Qualität der Images eingestellt werden (default "Icon").
- Im Modus "Full" wird die original vorhandene Auflösung der Images abgerufen. Dies erfordert mehr Ressourcen und kann die
- Anzeige verlangsamen. Mit "snapGalleryBoost=1" kann die Ausgabe beschleunigt werden, da in diesem Fall die Aufnahmen über
- Polling abgerufen und nur noch zur Anzeige gebracht werden.
-
-
-
showStmInfoFull
- zusaätzliche Streaminformationen wie LiveStreamUrl, StmKeyUnicst, StmKeymjpegHttp werden
- ausgegeben
-
-
-
showPassInLog
- Wenn gesetzt, wird das verwendete Passwort im Logfile mit verbose 4 angezeigt.
- (default = 0)
-
-
-
videofolderMap
- ersetzt den Inhalt des Readings "VideoFolder", Verwendung z.B. bei gemounteten
- Verzeichnissen
-
-
-
verbose
-
-
- Es werden verschiedene Verbose-Level unterstützt.
- Dies sind im Einzelnen:
-
-
-
-
0
- Start/Stop-Ereignisse werden geloggt
-
1
- Fehlermeldungen werden geloggt
-
2
- Meldungen über wichtige Ereignisse oder Alarme
-
3
- gesendete Kommandos werden geloggt
-
4
- gesendete und empfangene Daten werden geloggt
-
5
- alle Ausgaben zur Fehleranalyse werden geloggt. ACHTUNG: möglicherweise werden sehr viele Daten in das Logfile geschrieben!
-
- Über den Pollingmechanismus bzw. durch Abfrage mit "Get" werden Readings bereitgestellt, deren Bedeutung in der nachfolgenden Tabelle dargestellt sind.
- Die übermittelten Readings können in Abhängigkeit des Kameratyps variieren.
-
-
-
-
CamAudioType
- listet den eingestellten Audiocodec auf wenn verwendet
-
Availability
- Verfügbarkeit der Kamera (disabled, enabled, disconnected, other)
-
CamEventNum
- liefert die Gesamtanzahl der in SVS registrierten Events der Kamera
-
CamExposureControl
- zeigt den aktuell eingestellten Typ der Belichtungssteuerung
- sagt aus ob die Kamera verpflichet ist Multicast einzuschalten.
-
CamIP
- IP-Adresse der Kamera
-
CamLastRec
- Pfad / Name der letzten Aufnahme
-
CamLastRecTime
- Datum / Startzeit - Stopzeit der letzten Aufnahme
-
CamLiveFps
- Frames pro Sekunde des Live-Streams
-
CamLiveMode
- Quelle für Live-Ansicht (DS, Camera)
-
camLiveQuality
- in SVS eingestellte Live-Stream Qualität
-
camLiveResolution
- in SVS eingestellte Live-Stream Auflösung
-
camLiveStreamNo
- verwendete Stream-Nummer für Live-Stream
-
CamModel
- Kameramodell
-
CamMotDetSc
- Status der Bewegungserkennung (disabled, durch Kamera, durch SVS) und deren Parameter
-
CamNTPServer
- eingestellter Zeitserver
-
CamPort
- IP-Port der Kamera
-
CamPreRecTime
- Dauer der der Voraufzeichnung in Sekunden (Einstellung in SVS)
-
CamPtSpeed
- eingestellter Wert für Schwenken/Neige-Aktionen (Einstellung in SVS)
-
CamRecShare
- gemeinsamer Ordner auf der DS für Aufnahmen
-
CamRecVolume
- Volume auf der DS für Aufnahmen
-
CamStreamFormat
- aktuelles Format des Videostream
-
CamVideoType
- listet den eingestellten Videocodec auf
-
CamVendor
- Kamerahersteller Bezeichnung
-
CamVideoFlip
- Ist das Video gedreht
-
CamVideoMirror
- Ist das Video gespiegelt
-
CamVideoRotate
- Ist das Video gedreht
-
CapAudioOut
- Fähigkeit der Kamera zur Audioausgabe über Surveillance Station (false/true)
-
CapChangeSpeed
- Fähigkeit der Kamera verschiedene Bewegungsgeschwindigkeiten auszuführen
-
CapPIR
- besitzt die Kamera einen PIR-Sensor
-
CapPTZAbs
- Fähigkeit der Kamera für absolute PTZ-Aktionen
-
CapPTZAutoFocus
- Fähigkeit der Kamera für Autofokus Aktionen
-
CapPTZDirections
- die verfügbaren PTZ-Richtungen der Kamera
-
CapPTZFocus
- Art der Kameraunterstützung für Fokussierung
-
CapPTZHome
- Unterstützung der Kamera für Home-Position
-
CapPTZIris
- Unterstützung der Kamera für Iris-Aktion
-
CapPTZObjTracking
- Unterstützung der Kamera für Objekt-Tracking
-
CapPTZPan
- Unterstützung der Kamera für Pan-Aktion
-
CapPTZPresetNumber
- die maximale Anzahl unterstützter Presets. 0 steht für keine Preset-Unterstützung
-
CapPTZTilt
- Unterstützung der Kamera für Tilt-Aktion
-
CapPTZZoom
- Unterstützung der Kamera für Zoom-Aktion
-
DeviceType
- Kameratyp (Camera, Video_Server, PTZ, Fisheye)
-
Error
- Meldungstext des letzten Fehlers
-
Errorcode
- Fehlercode des letzten Fehlers
-
HomeModeState
- HomeMode-Status (ab SVS-Version 8.1.0)
-
LastLogEntry
- der neueste Eintrag des Surveillance Station Logs (nur SVS-Device und wenn Attribut pollcaminfoall gesetzt)
-
LastSnapFilename
- der Filename des letzten Schnapschusses
-
LastSnapId
- die ID des letzten Schnapschusses
-
LastSnapTime
- Zeitstempel des letzten Schnapschusses
-
LastUpdateTime
- Datum / Zeit der letzten Aktualisierung durch "caminfoall"
-
LiveStreamUrl
- die LiveStream-Url wenn der Stream gestartet ist. (Attribut "showStmInfoFull" muss gesetzt sein)
-
Patrols
- in Surveillance Station voreingestellte Überwachungstouren (bei PTZ-Kameras)
-
PollState
- zeigt den Status des automatischen Pollings an
-
PresetHome
- Name der Home-Position (bei PTZ-Kameras)
-
Presets
- in Surveillance Station voreingestellte Positionen (bei PTZ-Kameras)
-
Record
- Aufnahme läuft = Start, keine Aufnahme = Stop
-
StmKey
- aktueller StreamKey. Kann zum öffnen eines Livestreams ohne Session Id genutzt werden.
-
StmKeyUnicst
- Uni-cast Stream Pfad der Kamera. (Attribut "showStmInfoFull" muss gesetzt sein)
-
StmKeymjpegHttp
- Mjpeg Stream Pfad (über http) der Kamera. (Attribut "showStmInfoFull" muss gesetzt sein)
-
SVScustomPortHttp
- benutzerdefinierter Port der Surveillance Station (HTTP) im DSM-Anwendungsportal (get mit "svsinfo")
-
SVScustomPortHttps
- benutzerdefinierter Port der Surveillance Station (HTTPS) im DSM-Anwendungsportal (get mit "svsinfo")
-
SVSlicenseNumber
- die Anzahl der installierten Kameralizenzen (get mit "svsinfo")
-
SVSuserPriv
- die effektiven Rechte des verwendeten Users nach dem Login (get mit "svsinfo")
-
SVSversion
- die Paketversion der installierten Surveillance Station (get mit "svsinfo")
-
UsedSpaceMB
- durch Aufnahmen der Kamera belegter Plattenplatz auf dem Volume
-
VideoFolder
- Pfad zu den aufgenommenen Videos
-
compstate
- Kompatibilitätsstatus (Vergleich von eingesetzter/simulierter SVS-Version zum Internal COMPATIBILITY)
-
-
-
-
-
-
-
-
-
-=end html_DE
-=cut
diff --git a/fhem/contrib/DS_Starter/49_SSCamSTRM.pm b/fhem/contrib/DS_Starter/49_SSCamSTRM.pm
deleted file mode 100644
index 419365c9a..000000000
--- a/fhem/contrib/DS_Starter/49_SSCamSTRM.pm
+++ /dev/null
@@ -1,394 +0,0 @@
-########################################################################################################################
-# $Id: 49_SSCamSTRM.pm 16938 2018-07-03 17:31:13Z DS_Starter $
-#########################################################################################################################
-# 49_SSCamSTRM.pm
-#
-# (c) 2018 by Heiko Maaz
-# forked from 98_weblink.pm by Rudolf König
-# e-mail: Heiko dot Maaz at t-online dot de
-#
-# This Module is used by module 49_SSCam to create Streaming devices.
-# It can't be used without any SSCam-Device.
-#
-# This script is part of fhem.
-#
-# Fhem is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# Fhem is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with fhem. If not, see .
-#
-#########################################################################################################################
-
-package main;
-
-use strict;
-use warnings;
-
-# Versions History intern
-our %SSCamSTRM_vNotesIntern = (
- "1.4.1" => "31.10.2018 attribute \"autoLoop\" changed to \"autoRefresh\", new attribute \"autoRefreshFW\" ",
- "1.4.0" => "29.10.2018 readingFnAttributes added ",
- "1.3.0" => "28.10.2018 direct help for attributes, new attribute \"autoLoop\" ",
- "1.2.4" => "27.10.2018 fix undefined subroutine &main::SSCam_ptzpanel (https://forum.fhem.de/index.php/topic,45671.msg850505.html#msg850505) ",
- "1.2.3" => "03.07.2018 behavior changed if device is disabled ",
- "1.2.2" => "26.06.2018 make changes for generic stream dev ",
- "1.2.1" => "23.06.2018 no name add-on if MODEL is snapgallery ",
- "1.2.0" => "20.06.2018 running stream as human readable entry for SSCamSTRM-Device ",
- "1.1.0" => "16.06.2018 attr hideDisplayName regarding to Forum #88667 ",
- "1.0.1" => "14.06.2018 commandref revised ",
- "1.0.0" => "14.06.2018 switch to longpoll refresh ",
- "0.4.0" => "13.06.2018 new attribute \"noDetaillink\" (deleted in V1.0.0) ",
- "0.3.0" => "12.06.2018 new attribute \"forcePageRefresh\" ",
- "0.2.0" => "11.06.2018 check in with SSCam 5.0.0 ",
- "0.1.0" => "10.06.2018 initial Version "
-);
-
-# Standardvariablen und Forward-Declaration
-sub SSCam_ptzpanel($;$$);
-sub SSCam_StreamDev($$$);
-
-################################################################
-sub SSCamSTRM_Initialize($) {
- my ($hash) = @_;
-
- my $fwd = join(",",devspec2array("TYPE=FHEMWEB:FILTER=STATE=Initialized"));
-
- $hash->{DefFn} = "SSCamSTRM_Define";
- $hash->{AttrList} = "autoRefresh:selectnumbers,120,0.2,1800,0,log10 ".
- "autoRefreshFW:$fwd ".
- "disable:1,0 ".
- "forcePageRefresh:1,0 ".
- "htmlattr ".
- "hideDisplayName:1,0 ".
- $readingFnAttributes;
- $hash->{FW_summaryFn} = "SSCamSTRM_FwFn";
- $hash->{FW_detailFn} = "SSCamSTRM_FwFn";
- $hash->{AttrFn} = "SSCamSTRM_Attr";
- $hash->{FW_hideDisplayName} = 1; # Forum 88667
- # $hash->{FW_addDetailToSummary} = 1;
- # $hash->{FW_atPageEnd} = 1; # wenn 1 -> kein Longpoll ohne informid in HTML-Tag
-}
-
-
-################################################################
-sub SSCamSTRM_Define($$) {
- my ($hash, $def) = @_;
- my ($name, $type, $link) = split("[ \t]+", $def, 3);
-
- if(!$link) {
- return "Usage: define SSCamSTRM ";
- }
-
- my $arg = (split("[()]",$link))[1];
- $arg =~ s/'//g;
- ($hash->{PARENT},$hash->{MODEL}) = ((split(",",$arg))[0],(split(",",$arg))[2]);
-
- $hash->{VERSION} = $hash->{VERSION} = (reverse sort(keys %SSCamSTRM_vNotesIntern))[0];
- $hash->{LINK} = $link;
-
- readingsSingleUpdate($hash,"state", "initialized", 1); # Init für "state"
-
-return undef;
-}
-
-################################################################
-sub SSCamSTRM_Attr($$$$) {
- my ($cmd,$name,$aName,$aVal) = @_;
- my $hash = $defs{$name};
- my ($do,$val);
-
- # $cmd can be "del" or "set"
- # $name is device name
- # aName and aVal are Attribute name and value
-
- if ($aName eq "disable") {
- if($cmd eq "set") {
- $do = ($aVal) ? 1 : 0;
- }
- $do = 0 if($cmd eq "del");
- $val = ($do == 1 ? "disabled" : "initialized");
-
- readingsSingleUpdate($hash, "state", $val, 1);
- }
-
-return undef;
-}
-
-################################################################
-sub SSCamSTRM_FwFn($;$$$) {
- my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash is set for summaryFn.
- my $hash = $defs{$d};
- my $link = $hash->{LINK};
-
- RemoveInternalTimer($hash);
- $hash->{HELPER}{FW} = $FW_wname;
-
- $link = AnalyzePerlCommand(undef, $link) if($link =~ m/^{(.*)}$/s);
- my $show = $defs{$hash->{PARENT}}->{HELPER}{ACTSTRM} if($hash->{MODEL} =~ /switched/);
- $show = $show?"($show)":"";
-
- my $alias = AttrVal($d, "alias", $d); # Linktext als Aliasname oder Devicename setzen
- my $dlink = "$alias";
-
- my $ret = "";
- $ret .= "$dlink $show " if(!AttrVal($d,"hideDisplayName",0));
- if(IsDisabled($d)) {
- if(AttrVal($d,"hideDisplayName",0)) {
- $ret .= "Stream-device $d is disabled";
- } else {
- $ret .= "Stream-device is disabled";
- }
- } else {
- $ret .= $link;
- }
-
- # Autorefresh nur des aufrufenden FHEMWEB-Devices
- my $al = AttrVal($d, "autoRefresh", 0);
- if($al) {
- InternalTimer(gettimeofday()+$al, "SSCamSTRM_refresh", $hash, 0);
- Log3($d, 5, "$d - next start of autoRefresh: ".FmtDateTime(gettimeofday()+$al));
- }
-
-return $ret;
-}
-
-################################################################
-sub SSCamSTRM_refresh($) {
- my ($hash) = @_;
- my $d = $hash->{NAME};
-
- # Seitenrefresh festgelegt durch SSCamSTRM-Attribut "autoRefresh" und "autoRefreshFW"
- my $rd = AttrVal($d, "autoRefreshFW", $hash->{HELPER}{FW});
- { map { FW_directNotify("#FHEMWEB:$_", "location.reload('true')", "") } $rd }
-
- my $al = AttrVal($d, "autoRefresh", 0);
- if($al) {
- InternalTimer(gettimeofday()+$al, "SSCamSTRM_refresh", $hash, 0);
- Log3($d, 5, "$d - next start of autoRefresh: ".FmtDateTime(gettimeofday()+$al));
- } else {
- RemoveInternalTimer($hash);
- }
-
-return;
-}
-
-1;
-
-=pod
-=item summary define a Streaming device by SSCam module
-=item summary_DE Erstellung eines Streaming-Device durch das SSCam-Modul
-=begin html
-
-
-
SSCamSTRM
-
-The module SSCamSTRM is a special device module synchronized to the SSCam module. It is used for definition of
-Streaming-Devices.
-Dependend of the Streaming-Device state, different buttons are provided to start actions:
-
-
-
-
Switch off
- stops a running playback
-
Refresh
- refresh a view (no page reload)
-
Restart
- restart a running content (e.g. a HLS-Stream)
-
MJPEG
- starts a MJPEG Livestream
-
HLS
- starts HLS (HTTP Live Stream)
-
Last Record
- playback the last recording as iFrame
-
Last Rec H.264
- playback the last recording if available as H.264
-
Last Rec MJPEG
- playback the last recording if available as MJPEG
-
Last SNAP
- show the last snapshot
-
Start Recording
- starts an endless recording
-
Stop Recording
- stopps the recording
-
Take Snapshot
- take a snapshot
-
-
-
-
-
-
- Define
-
-
- A SSCam Streaming-device is defined by the SSCam "set <name> createStreamDev" command.
- Please refer to SSCam "createStreamDev" command.
-
-
-
-
- Set
N/A
-
-
- Get
N/A
-
-
- Attributes
-
-
-
-
-
-
-
autoRefresh
- If set, active browser pages of the FHEMWEB-Device which has called the SSCamSTRM-Device, are new reloaded after
- the specified time (seconds). Browser pages of a particular FHEMWEB-Device to be refreshed can be specified by
- attribute "autoRefreshFW" instead.
- This may stabilize the video playback in some cases.
-
-
-
-
-
autoRefreshFW
- If "autoRefresh" is activated, you can specify a particular FHEMWEB-Device whose active browser pages are refreshed
- periodically.
-
-
-
-
-
disable
- Deactivates the device.
-
-
-
-
-
forcePageRefresh
- The attribute is evaluated by SSCam.
- If set, a reload of all browser pages with active FHEMWEB connections will be enforced when particular camera operations
- were finished.
- This may stabilize the video playback in some cases.
-
-
-
-
-
hideDisplayName
- Hide the device/alias name (link to detail view).
-
-
-
-
-
htmlattr
- Additional HTML tags to manipulate the streaming device.
-
-
-
-Das Modul SSCamSTRM ist ein mit SSCam abgestimmtes Gerätemodul zur Definition von Streaming-Devices.
-Abhängig vom Zustand des Streaming-Devices werden zum Start von Aktionen unterschiedliche Drucktasten angeboten:
-
-
-
-
Switch off
- stoppt eine laufende Wiedergabe
-
Refresh
- auffrischen einer Ansicht (kein Browser Seiten-Reload)
-
Restart
- neu starten eines laufenden Contents (z.B. eines HLS-Streams)
-
MJPEG
- Startet MJPEG Livestream
-
HLS
- Startet HLS (HTTP Live Stream)
-
Last Record
- spielt die letzte Aufnahme als iFrame
-
Last Rec H.264
- spielt die letzte Aufnahme wenn als H.264 vorliegend
-
Last Rec MJPEG
- spielt die letzte Aufnahme wenn als MJPEG vorliegend
-
Last SNAP
- zeigt den letzten Snapshot
-
Start Recording
- startet eine Endlosaufnahme
-
Stop Recording
- stoppt eine Aufnahme
-
Take Snapshot
- löst einen Schnappschuß aus
-
-
-
-
-
-
- Define
-
-
- Ein SSCam Streaming-Device wird durch den SSCam Befehl "set <name> createStreamDev" erstellt.
- Siehe auch die Beschreibung zum SSCam "createStreamDev" Befehl.
-
-
-
-
- Set
N/A
-
-
- Get
N/A
-
-
- Attributes
-
-
-
-
-
-
-
autoRefresh
- Wenn gesetzt, werden aktive Browserseiten des FHEMWEB-Devices welches das SSCamSTRM-Device aufgerufen hat, nach der
- eingestellten Zeit (Sekunden) neu geladen. Sollen statt dessen Broserseiten eines bestimmten FHEMWEB-Devices neu
- geladen werden, kann dieses Device mit dem Attribut "autoRefreshFW" festgelegt werden.
- Dies kann in manchen Fällen die Wiedergabe innerhalb einer Anwendung stabilisieren.
-
-
-
-
-
autoRefreshFW
- Ist "autoRefresh" aktiviert, kann mit diesem Attribut das FHEMWEB-Device bestimmt werden dessen aktive Browserseiten
- regelmäßig neu geladen werden sollen.
-
-
-
-
-
disable
- Aktiviert/deaktiviert das Device.
-
-
-
-
-
forcePageRefresh
- Das Attribut wird durch SSCam ausgewertet.
- Wenn gesetzt, wird ein Reload aller Browserseiten mit aktiven FHEMWEB-Verbindungen nach dem Abschluß bestimmter
- SSCam-Befehle erzwungen.
- Dies kann in manchen Fällen die Wiedergabe innerhalb einer Anwendung stabilisieren.
-
-
-
-
-
hideDisplayName
- Verbirgt den Device/Alias-Namen (Link zur Detailansicht).
-
-
-
-
-
htmlattr
- Zusätzliche HTML Tags zur Darstellungsänderung im Streaming Device.
-