".
- "Snapshots can be sent by Email alltogether after creation. For this purpose the module contains ".
- "its own Email client. ".
- "Before you can use this function you have to install the Perl-module MIME::Lite. On debian systems it can be ".
- "installed with command:".
- "
".
- "There are some attributes must be set or can be used optionally. ".
- "At first the Credentials for access the Email outgoing server must be set by command \"set <name> smtpcredentials <user> <password>\" ".
- "The connection to the server is initially established unencrypted and switches to an encrypted connection if SSL ".
- "encryption is available. In that case the transmission of User/Password takes place encrypted too. ".
- "If attribute \"smtpSSLPort\" is defined, the established connection to the Email server will be encrypted immediately.
".
+ "Snapshots can be sent by Email alltogether after creation. For this purpose the module contains ".
+ "its own Email client. ".
+ "Before you can use this function you have to install the Perl-module MIME::Lite. On debian systems it can be ".
+ "installed with command:".
+ "
".
+ "There are some attributes must be set or can be used optionally. ".
+ "At first the Credentials for access the Email outgoing server must be set by command \"set <name> smtpcredentials <user> <password>\" ".
+ "The connection to the server is initially established unencrypted and switches to an encrypted connection if SSL ".
+ "encryption is available. In that case the transmission of User/Password takes place encrypted too. ".
+ "If attribute \"smtpSSLPort\" is defined, the established connection to the Email server will be encrypted immediately.
".
"Attributes which are optional are marked:
".
- "
".
- "
snapEmailTxt - Activates the Email shipping. This attribute has the format: ".
- "
subject => <subject text>, body => <message text>
".
- "The placeholder \$CAM, \$DATE and \$TIME can be used. ".
- "\$CAM is replaced by the device name, device alias or the name of camera in SVS if alias is not defined. ".
- "\$DATE and \$TIME are replaced with the current date and time.
".
- "
smtpHost - Hostname or IP-address of outgoing Email server (e.g. securesmtp.t-online.de)
smtpNoUseSSL - (optional) \"1\" if no SSL encryption should be used for Email shipping (default: 0)
".
- "
smtpSSLPort - (optional) Port for SSL encrypted connection (default: 465)
".
- "
smtpDebug - (optional) switch on the debugging of SMTP connection
".
- "
".
+ "
".
+ "
snapEmailTxt - Activates the Email shipping. This attribute has the format: ".
+ "
subject => <subject text>, body => <message text>
".
+ "The placeholder \$CAM, \$DATE and \$TIME can be used. ".
+ "\$CAM is replaced by the device name, device alias or the name of camera in SVS if alias is not defined. ".
+ "\$DATE and \$TIME are replaced with the current date and time.
".
+ "
smtpHost - Hostname or IP-address of outgoing Email server (e.g. securesmtp.t-online.de)
smtpNoUseSSL - (optional) \"1\" if no SSL encryption should be used for Email shipping (default: 0)
".
+ "
smtpSSLPort - (optional) Port for SSL encrypted connection (default: 465)
".
+ "
smtpDebug - (optional) switch on the debugging of SMTP connection
".
+ "
".
"For further information please see description of the attributes.".
"
",
"6" => "There are some Icons in directory www/images/sscam available for SSCam. Thereby the system can use the icons please do: ".
@@ -745,7 +751,7 @@ my %vHintsExt_en = (
"
",
- "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".
+ "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".
@@ -753,7 +759,7 @@ my %vHintsExt_en = (
);
#############################################################################################
-# Hint Hash DE
+# Hint Hash DE
#############################################################################################
my %vHintsExt_de = (
"9" => "Weitere Informationen zum Versand von Schnappschüssen und Aufnahmen mit dem Synology Chat Server findet man im ".
@@ -764,36 +770,36 @@ my %vHintsExt_de = (
"
".
- "Schnappschüsse können nach der Erstellung per Email gemeinsam versendet werden. Dazu enthält das Modul einen ".
- "eigenen Email-Client. ".
- "Zur Verwendung dieser Funktion muss das Perl-Modul MIME::Lite installiert sein. Auf Debian-Systemen kann ".
- "es mit".
- "
".
- "Für die Verwendung des Email-Versands müssen einige Attribute gesetzt oder können optional genutzt werden. ".
- "Die Credentials für den Zugang zum Email-Server müssen mit dem Befehl \"set <name> smtpcredentials <user> <password>\" ".
- "gesetzt werden. Der Verbindungsaufbau zum Postausgangsserver erfolgt initial unverschüsselt und wechselt zu einer verschlüsselten ".
- "Verbindung wenn SSL zur Verfügung steht. In diesem Fall erfolgt auch die Übermittlung von User/Password verschlüsselt. ".
- "Ist das Attribut \"smtpSSLPort\" definiert, erfolgt der Verbindungsaufbau zum Email-Server sofort verschlüsselt.
".
+ "Schnappschüsse können nach der Erstellung per Email gemeinsam versendet werden. Dazu enthält das Modul einen ".
+ "eigenen Email-Client. ".
+ "Zur Verwendung dieser Funktion muss das Perl-Modul MIME::Lite installiert sein. Auf Debian-Systemen kann ".
+ "es mit".
+ "
".
+ "Für die Verwendung des Email-Versands müssen einige Attribute gesetzt oder können optional genutzt werden. ".
+ "Die Credentials für den Zugang zum Email-Server müssen mit dem Befehl \"set <name> smtpcredentials <user> <password>\" ".
+ "gesetzt werden. Der Verbindungsaufbau zum Postausgangsserver erfolgt initial unverschüsselt und wechselt zu einer verschlüsselten ".
+ "Verbindung wenn SSL zur Verfügung steht. In diesem Fall erfolgt auch die Übermittlung von User/Password verschlüsselt. ".
+ "Ist das Attribut \"smtpSSLPort\" definiert, erfolgt der Verbindungsaufbau zum Email-Server sofort verschlüsselt.
".
"Optionale Attribute sind gekennzeichnet:
".
- "
".
- "
snapEmailTxt - Aktiviert den Email-Versand. Das Attribut hat das Format: ".
- "
subject => <Betreff-Text>, body => <Mitteilung-Text>
".
- "Es können die Platzhalter \$CAM, \$DATE und \$TIME verwendet werden. ".
- "\$CAM wird durch den Device-Namen, Device-Alias bzw. den Namen der Kamera in der SVS ersetzt falls der ".
- "Device-Alias nicht gesetzt ist. ".
- "\$DATE und \$TIME werden durch das aktuelle Datum und Zeit ersetzt.
".
- "
smtpHost - Hostname oder IP-Adresse des Postausgangsservers (z.B. securesmtp.t-online.de)
smtpNoUseSSL - (optional) \"1\" wenn kein SSL beim Email-Versand verwendet werden soll (default: 0)
".
- "
smtpSSLPort - (optional) SSL-Port des Postausgangsservers (default: 465)
".
- "
smtpDebug - (optional) zum Debugging der SMTP-Verbindung setzen
".
- "
".
+ "
".
+ "
snapEmailTxt - Aktiviert den Email-Versand. Das Attribut hat das Format: ".
+ "
subject => <Betreff-Text>, body => <Mitteilung-Text>
".
+ "Es können die Platzhalter \$CAM, \$DATE und \$TIME verwendet werden. ".
+ "\$CAM wird durch den Device-Namen, Device-Alias bzw. den Namen der Kamera in der SVS ersetzt falls der ".
+ "Device-Alias nicht gesetzt ist. ".
+ "\$DATE und \$TIME werden durch das aktuelle Datum und Zeit ersetzt.
".
+ "
smtpHost - Hostname oder IP-Adresse des Postausgangsservers (z.B. securesmtp.t-online.de)
smtpNoUseSSL - (optional) \"1\" wenn kein SSL beim Email-Versand verwendet werden soll (default: 0)
".
+ "
smtpSSLPort - (optional) SSL-Port des Postausgangsservers (default: 465)
".
+ "
smtpDebug - (optional) zum Debugging der SMTP-Verbindung setzen
".
+ "
".
"Zur näheren Erläuterung siehe Beschreibung der Attribute.".
"
",
"6" => "Für SSCam wird ein Satz Icons im Verzeichnis www/images/sscam zur Verfügung gestellt. Damit das System sie findet bitte setzen: ".
@@ -821,10 +827,10 @@ my %vHintsExt_de = (
################################################################
sub Initialize {
my $hash = shift;
-
+
$hash->{DefFn} = \&Define;
$hash->{UndefFn} = \&Undef;
- $hash->{DeleteFn} = \&Delete;
+ $hash->{DeleteFn} = \&Delete;
$hash->{SetFn} = \&Set;
$hash->{GetFn} = \&Get;
$hash->{AttrFn} = \&Attr;
@@ -833,9 +839,9 @@ sub Initialize {
$hash->{FW_summaryFn} = \&FWsummaryFn;
$hash->{FW_detailFn} = \&FWdetailFn;
$hash->{FW_deviceOverview} = 1;
-
- my $simver = join ",", @simus;
-
+
+ my $simver = join ",", @simus;
+
$hash->{AttrList} = "disable:1,0 ".
"debugactivetoken:1,0 ".
"debugCachetime:1,0 ".
@@ -880,62 +886,62 @@ sub Initialize {
"simu_SVSversion:$simver ".
"videofolderMap ".
"webCmd ".
- $readingFnAttributes;
-
+ $readingFnAttributes;
+
eval { FHEM::Meta::InitMod( __FILE__, $hash ) }; ## no critic 'eval' # für Meta.pm (https://forum.fhem.de/index.php/topic,97589.0.html)
-return;
+return;
}
################################################################
sub Define {
- # Die Define-Funktion eines Moduls wird von Fhem aufgerufen wenn der Define-Befehl für ein Gerät ausgeführt wird
+ # 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]
+ # 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 ".$MMJSON." is missing. Install it on Debian with: sudo apt-get install libjson-perl" if($MMJSON);
-
+
my @a = split m{\s+}x, $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->{MODEL} = ($camname =~ m/^SVS$/xi) ? "SVS" : "CAM"; # initial, CAM wird später ersetzt durch CamModel
$hash->{PROTOCOL} = $proto;
- $hash->{COMPATIBILITY} = $compstat; # getestete SVS-version Kompatibilität
+ $hash->{COMPATIBILITY} = $compstat; # getestete SVS-version Kompatibilität
$hash->{HELPER}{MODMETAABSENT} = 1 if($modMetaAbsent); # Modul Meta.pm nicht vorhanden
-
+
# Startwerte setzen
if(IsModelCam($hash)) { # initiale Webkommandos setzen
- $attr{$name}{webCmd} = "on:off:snap:enable:disable:runView:stopView";
- }
+ $attr{$name}{webCmd} = "on:off:snap:enable:disable:runView:stopView";
+ }
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}{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"} = ""; # initial -> es wird ptzpanel neu eingelesen
$hash->{HELPER}{HLSSTREAM} = "inactive"; # Aktivitätsstatus HLS-Streaming
$hash->{HELPER}{SNAPLIMIT} = 0; # abgerufene Anzahl Snaps
$hash->{HELPER}{TOTALCNT} = 0; # totale Anzahl Snaps
-
+
my $params = {
hash => $hash,
notes => \%vNotesIntern,
@@ -944,23 +950,23 @@ sub Define {
useErrCodes => 1
};
use version 0.77; our $VERSION = moduleVersion ($params); # Versionsinformationen setzen
-
+
readingsBeginUpdate ($hash );
- readingsBulkUpdate ($hash, "PollState", "Inactive"); # es ist keine Gerätepolling aktiv
-
+ readingsBulkUpdate ($hash, "PollState", "Inactive"); # es ist keine Gerätepolling aktiv
+
if(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);
-
- getCredentials ($hash,1, "credentials" ); # Credentials lesen und in RAM laden ($boot=1)
+ else {
+ readingsBulkUpdate ($hash, "state", "Initialized"); # Init für "state" wenn SVS
+ }
+
+ readingsEndUpdate ($hash,1);
+
+ getCredentials ($hash,1, "credentials" ); # Credentials lesen und in RAM laden ($boot=1)
getCredentials ($hash,1, "SMTPcredentials");
-
+
# initiale Routinen zufällig verzögert nach Restart ausführen
RemoveInternalTimer ($hash, "FHEM::SSCam::initOnBoot" );
InternalTimer (gettimeofday()+int(rand(30)), "FHEM::SSCam::initOnBoot", $hash, 0);
@@ -969,81 +975,81 @@ return;
}
################################################################
-# Die Undef-Funktion wird aufgerufen wenn ein Gerät mit delete
-# gelöscht wird oder bei der Abarbeitung des Befehls rereadcfg,
-# der ebenfalls alle Geräte löscht und danach das
-# Konfigurationsfile neu einliest.
-# Funktion: typische Aufräumarbeiten wie das
-# saubere Schließen von Verbindungen oder das Entfernen von
-# internen Timern, sofern diese im Modul zum Pollen verwendet
+# Die Undef-Funktion wird aufgerufen wenn ein Gerät mit delete
+# gelöscht wird oder bei der Abarbeitung des Befehls rereadcfg,
+# der ebenfalls alle Geräte löscht und danach das
+# Konfigurationsfile neu einliest.
+# Funktion: typische Aufräumarbeiten wie das
+# saubere Schließen von Verbindungen oder das Entfernen von
+# internen Timern, sofern diese im Modul zum Pollen verwendet
# wurden.
################################################################
sub Undef {
my $hash = shift;
my $arg = shift;
my $name = $hash->{NAME};
-
+
RemoveInternalTimer($hash);
-
+
return;
}
#######################################################################################################
-# Mit der X_DelayedShutdown Funktion kann eine Definition das Stoppen von FHEM verzögern um asynchron
-# hinter sich aufzuräumen.
+# Mit der X_DelayedShutdown Funktion kann eine Definition das Stoppen von FHEM verzögern um asynchron
+# hinter sich aufzuräumen.
# Je nach Rückgabewert $delay_needed wird der Stopp von FHEM verzögert (0|1).
-# Sobald alle nötigen Maßnahmen erledigt sind, muss der Abschluss mit CancelDelayedShutdown($name) an
-# FHEM zurückgemeldet werden.
+# Sobald alle nötigen Maßnahmen erledigt sind, muss der Abschluss mit CancelDelayedShutdown($name) an
+# FHEM zurückgemeldet werden.
#######################################################################################################
sub delayedShutdown {
my $hash = shift;
my $name = $hash->{NAME};
-
+
$shutdownInProcess = 1; # Statusbit shutdown setzen -> asynchrone Funktionen nicht mehr ausgeführen
-
+
Log3($name, 2, "$name - Quit session due to shutdown ...");
__sessionOff($hash);
-
+
if($hash->{HELPER}{CACHEKEY}) {
- cache($name, "c_destroy");
+ cache($name, "c_destroy");
}
return 1;
}
#################################################################
-# Wenn ein Gerät in FHEM gelöscht wird, wird zuerst die Funktion
-# X_Undef aufgerufen um offene Verbindungen zu schließen,
-# anschließend wird die Funktion X_Delete aufgerufen.
-# Funktion: Aufräumen von dauerhaften Daten, welche durch das
-# Modul evtl. für dieses Gerät spezifisch erstellt worden sind.
-# Es geht hier also eher darum, alle Spuren sowohl im laufenden
-# FHEM-Prozess, als auch dauerhafte Daten bspw. im physikalischen
-# Gerät zu löschen die mit dieser Gerätedefinition zu tun haben.
+# Wenn ein Gerät in FHEM gelöscht wird, wird zuerst die Funktion
+# X_Undef aufgerufen um offene Verbindungen zu schließen,
+# anschließend wird die Funktion X_Delete aufgerufen.
+# Funktion: Aufräumen von dauerhaften Daten, welche durch das
+# Modul evtl. für dieses Gerät spezifisch erstellt worden sind.
+# Es geht hier also eher darum, alle Spuren sowohl im laufenden
+# FHEM-Prozess, als auch dauerhafte Daten bspw. im physikalischen
+# Gerät zu löschen die mit dieser Gerätedefinition zu tun haben.
#################################################################
sub Delete {
my $hash = shift;
my $arg = shift;
my $index = $hash->{TYPE}."_".$hash->{NAME}."_credentials";
my $name = $hash->{NAME};
-
+
setKeyValue ($index, undef); # gespeicherte Credentials löschen
my $sgdev = "SSCam.$hash->{NAME}.snapgallery"; # löschen snapGallerie-Device falls vorhanden
CommandDelete($hash->{CL},"$sgdev");
-
+
CommandDelete($hash->{CL},"TYPE=SSCamSTRM:FILTER=PARENT=$name"); # alle zugeordneten Streaming-Devices löschen falls vorhanden
-
+
delete $data{SSCam}{$name}; # internen Cache löschen
-
+
return;
}
######################################################################################
# Kamera Liveview Anzeige in FHEMWEB
######################################################################################
-# wird von FW aufgerufen. $FW_wname = aufrufende Webinstanz, $d = aufrufendes
+# wird von FW aufgerufen. $FW_wname = aufrufende Webinstanz, $d = aufrufendes
# Device (z.B. CamCP1)
sub FWsummaryFn {
my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash is set for summaryFn in FHEMWEB
@@ -1053,37 +1059,37 @@ sub FWsummaryFn {
my $wltype = $hash->{HELPER}{WLTYPE};
my $ret = "";
my $alias;
-
+
return if(!$hash->{HELPER}{LINK} || ReadingsVal($d, "state", "") =~ /^dis/x || 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 $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 $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 $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 $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 $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 $cmdlsnaprun = "cmd=set $d runView lastsnap_fw STRM"; # Last SNAP
my $imglsnaprun = "";
- my $cmdrecendless = "cmd=set $d on 0"; # Endlosaufnahme Start
+ my $cmdrecendless = "cmd=set $d on 0"; # Endlosaufnahme Start
my $imgrecendless = "";
- my $cmdrecstop = "cmd=set $d off"; # Aufnahme Stop
+ my $cmdrecstop = "cmd=set $d off"; # Aufnahme Stop
my $imgrecstop = "";
my $cmddosnap = "cmd=set $d snap 1 2 STRM"; # Snapshot auslösen mit Kennzeichnung "by STRM-Device"
my $imgdosnap = "";
-
+
my $attr = AttrVal($d, "htmlattr", " ");
Log3($name, 4, "$name - FWsummaryFn called - FW_wname: $FW_wname, device: $d, room: $room, attributes: $attr");
-
+
my $calias = $hash->{CAMNAME}; # Alias der Kamera
my ($ttrefresh, $ttrecstart, $ttrecstop, $ttsnap, $ttcmdstop, $tthlsreact, $ttmjpegrun, $tthlsrun, $ttlrrun, $tth264run, $ttlmjpegrun, $ttlsnaprun);
@@ -1093,7 +1099,7 @@ sub FWsummaryFn {
$ttsnap = $ttips_en{"ttsnap"}; $ttsnap =~ s/§NAME§/$calias/gx;
$ttcmdstop = $ttips_en{"ttcmdstop"}; $ttcmdstop =~ s/§NAME§/$calias/gx;
$tthlsreact = $ttips_en{"tthlsreact"}; $tthlsreact =~ s/§NAME§/$calias/gx;
- }
+ }
else {
$ttrecstart = $ttips_de{"ttrecstart"}; $ttrecstart =~ s/§NAME§/$calias/gx;
$ttrecstop = $ttips_de{"ttrecstop"}; $ttrecstop =~ s/§NAME§/$calias/gx;
@@ -1101,38 +1107,38 @@ sub FWsummaryFn {
$ttcmdstop = $ttips_de{"ttcmdstop"}; $ttcmdstop =~ s/§NAME§/$calias/gx;
$tthlsreact = $ttips_de{"tthlsreact"}; $tthlsreact =~ s/§NAME§/$calias/gx;
}
-
+
if($wltype eq "image") {
- if(ReadingsVal($name, "SVSversion", "") eq "8.2.3-5828" && ReadingsVal($name, "CamVideoType", "") !~ /MJPEG/x) {
+ if(ReadingsVal($name, "SVSversion", "") eq "8.2.3-5828" && ReadingsVal($name, "CamVideoType", "") !~ /MJPEG/x) {
$ret .= "
Because SVS version 8.2.3-5828 is running you cannot see the MJPEG-Stream. Please upgrade to a higher SVS version !
";
+ $ptz_ret .= "";
}
-
+
if ($rowisset) {
return $ptz_ret;
- }
+ }
else {
return '';
}
@@ -9282,37 +9288,37 @@ sub ptzPanel {
sub addptzattr {
my $name = shift;
my $hash = $defs{$name};
-
+
my $actvs;
-
+
my @vl = split (/\.|-/x,ReadingsVal($name, "SVSversion", ""));
if(@vl) {
$actvs = $vl[0];
$actvs.= $vl[1];
}
return if(ReadingsVal($name,"DeviceType","Camera") ne "PTZ" || $actvs <= 71);
-
- for my $n (0..9) {
+
+ for my $n (0..9) {
$n = sprintf("%2.2d",$n);
addToDevAttrList($name, "ptzPanel_row$n");
}
-
+
my $p = ReadingsVal($name, "Presets", "");
if($p ne "") {
my @h;
my $arg = "ptzPanel_Home";
my @ua = split " ", AttrVal($name, "userattr", "");
- for my $part (@ua) {
+ for my $part (@ua) {
push(@h,$part) if($part !~ m/$arg.*/x);
}
-
+
$attr{$name}{userattr} = join(' ',@h);
addToDevAttrList($name, "ptzPanel_Home:".$p);
}
addToDevAttrList($name, "ptzPanel_iconPrefix");
addToDevAttrList($name, "ptzPanel_iconPath");
addToDevAttrList($name, "ptzPanel_use:0,1");
-
+
# PTZ Panel Widget initial generieren
my $upleftfast = "move upleft";
my $upfast = "move up";
@@ -9322,30 +9328,30 @@ sub addptzattr {
my $upright = "move upright 0.5";
my $leftfast = "move left";
my $leftslow = "move left 0.5";
- my $home = "goPreset ".AttrVal($name, "ptzPanel_Home", ReadingsVal($name,"PresetHome",""));
+ my $home = "goPreset ".AttrVal($name, "ptzPanel_Home", ReadingsVal($name,"PresetHome",""));
my $rightslow = "move right 0.5";
my $rightfast = "move right";
- my $downleft = "move downleft 0.5";
+ my $downleft = "move downleft 0.5";
my $down = "move down 0.5";
my $downright = "move downright 0.5";
my $downleftfast = "move downleft";
my $downfast = "move down";
my $downrightfast = "move downright";
-
- $attr{$name}{ptzPanel_row00} = "$upleftfast:CAMUPLEFTFAST.png,:CAMBLANK.png,$upfast:CAMUPFAST.png,:CAMBLANK.png,$uprightfast:CAMUPRIGHTFAST.png"
+
+ $attr{$name}{ptzPanel_row00} = "$upleftfast:CAMUPLEFTFAST.png,:CAMBLANK.png,$upfast:CAMUPFAST.png,:CAMBLANK.png,$uprightfast:CAMUPRIGHTFAST.png"
if(!AttrVal($name,"ptzPanel_row00",undef));
$attr{$name}{ptzPanel_row01} = ":CAMBLANK.png,$upleft:CAMUPLEFT.png,$up:CAMUP.png,$upright:CAMUPRIGHT.png"
- if(!AttrVal($name,"ptzPanel_row01",undef));
+ if(!AttrVal($name,"ptzPanel_row01",undef));
$attr{$name}{ptzPanel_row02} = "$leftfast:CAMLEFTFAST.png,$leftslow:CAMLEFT.png,$home:CAMHOME.png,$rightslow:CAMRIGHT.png,$rightfast:CAMRIGHTFAST.png"
- if(!AttrVal($name,"ptzPanel_row02",undef) || $home ne $hash->{HELPER}{OLDPTZHOME});
+ if(!AttrVal($name,"ptzPanel_row02",undef) || $home ne $hash->{HELPER}{OLDPTZHOME});
$attr{$name}{ptzPanel_row03} = ":CAMBLANK.png,$downleft:CAMDOWNLEFT.png,$down:CAMDOWN.png,$downright:CAMDOWNRIGHT.png"
- if(!AttrVal($name,"ptzPanel_row03",undef));
+ if(!AttrVal($name,"ptzPanel_row03",undef));
$attr{$name}{ptzPanel_row04} = "$downleftfast:CAMDOWNLEFTFAST.png,:CAMBLANK.png,$downfast:CAMDOWNFAST.png,:CAMBLANK.png,$downrightfast:CAMDOWNRIGHTFAST.png"
if(!AttrVal($name,"ptzPanel_row04",undef));
-
+
$hash->{HELPER}{OLDPTZHOME} = $home;
$hash->{".ptzhtml"} = ""; # ptzPanel wird neu eingelesen
-
+
return;
}
@@ -9358,32 +9364,32 @@ sub rotateReading {
my $name = $hash->{NAME};
readingsBeginUpdate($hash);
-
- my $o = ReadingsVal($name,$readingName,"n.a.");
+
+ my $o = ReadingsVal($name,$readingName,"n.a.");
if($val ne "n.a." && $rotnum >= 1) {
- if("$o" ne "$val") {
+ if("$o" ne "$val") {
for (my $i=$rotnum;$i>0;$i--) {
my $l = $i-1;
my $g = ReadingsVal($name,$readingName.$i,"n.a.");
-
+
if($l) {
$l = ReadingsVal($name,$readingName.$l,"n.a.");
- }
+ }
else {
$l = ReadingsVal($name,$readingName,"n.a.");
}
-
+
if("$l" ne "$g") {
readingsBulkUpdate($hash,$readingName.$i,$l);
Log3($name, 4, "$name - Rotate \"$readingName.$i\" to value: $l");
}
}
- }
-
+ }
+
}
readingsBulkUpdate($hash,$readingName,$val);
readingsEndUpdate($hash, $do_trigger);
-
+
return;
}
@@ -9392,141 +9398,141 @@ return;
# $OpMode = aktueller Operation Mode zur Unterscheidung was versendet werden soll
# $dat = zu versendende Daten, evtl. als Hash Referenz
#############################################################################################
-sub prepareSendData {
+sub prepareSendData {
my ($hash, $OpMode, $dat) = @_;
my $name = $hash->{NAME};
my $calias = AttrVal($name,"alias",$hash->{CAMNAME}); # Alias der Kamera wenn gesetzt oder Originalname aus SVS
my $type = AttrVal($name,"cacheType","internal");
my ($ret,$vdat,$fname,$snapid,$tac) = ('','','','','');
my @as;
-
+
# prüfen ob Schnappschnüsse aller Kameras durch ein SVS-Device angefordert wurde,
# Bilddaten jeder Kamera werden nach Erstellung dem zentralen Schnappshußhash hinzugefügt
# Bilddaten werden erst zum Versand weitergeleitet wenn Schnappshußhash komplett gefüllt ist
-
+
my $asref;
my @allsvs = devspec2array("TYPE=SSCam:FILTER=MODEL=SVS");
-
+
for my $svs (@allsvs) {
my $svshash;
$svshash = $defs{$svs} if($defs{$svs});
- next if(!$svshash ||
+ next if(!$svshash ||
!AttrVal($svs, "snapEmailTxt", "") ||
- !$svshash->{HELPER}{ALLSNAPREF} ||
+ !$svshash->{HELPER}{ALLSNAPREF} ||
!$svshash->{HELPER}{CANSENDSNAP}); # Sammel-Schnappschüsse nur senden wenn CANSENDSNAP und Attribut gesetzt ist
-
+
$asref = $svshash->{HELPER}{ALLSNAPREF}; # Hashreferenz zum summarischen Snaphash
-
+
for my $key (keys%{$asref}) {
if($key eq $name) { # Kamera Key im Bildhash matcht -> Bilddaten übernehmen
if($type eq "internal") {
-
+
for my $pkey (keys%{$dat}) {
my $nkey = time()+int(rand(1000));
-
+
$asref->{$nkey.$pkey}{createdTm} = $dat->{$pkey}{createdTm}; # Aufnahmezeit der Kamera werden im summarischen Snaphash eingefügt
$asref->{$nkey.$pkey}{imageData} = $dat->{$pkey}{imageData}; # Bilddaten der Kamera werden im summarischen Snaphash eingefügt
$asref->{$nkey.$pkey}{fileName} = $dat->{$pkey}{fileName}; # Filenamen der Kamera werden im summarischen Snaphash eingefügt
-
- Log3($svs, 4, "$svs - Central Snaphash filled up with snapdata of cam \"$name\" and key [".$nkey.$pkey."]");
+
+ Log3($svs, 4, "$svs - Central Snaphash filled up with snapdata of cam \"$name\" and key [".$nkey.$pkey."]");
}
- }
+ }
else {
# alle Serial Numbers "{$sn}" der Transaktion ermitteln
- # Muster: {SENDSNAPS}{2222}{0}{imageData}
- extractTIDfromCache ( { name => $name,
+ # Muster: {SENDSNAPS}{2222}{0}{imageData}
+ extractTIDfromCache ( { name => $name,
media => "SENDSNAPS",
mode => "serial",
aref => \@as
- }
- );
+ }
+ );
my %seen;
- my @unique = sort{$a<=>$b} grep { !$seen{$_}++ } @as; # distinct / unique the keys
+ my @unique = sort{$a<=>$b} grep { !$seen{$_}++ } @as; # distinct / unique the keys
for my $pkey (@unique) {
- next if(!cache($name, "c_isvalidkey", "$dat"."{$pkey}{imageData}"));
+ next if(!cache($name, "c_isvalidkey", "$dat"."{$pkey}{imageData}"));
my $nkey = time()+int(rand(1000));
-
+
$asref->{$nkey.$pkey}{createdTm} = cache($name, "c_read", "$dat"."{$pkey}{createdTm}"); # Aufnahmezeit der Kamera werden im summarischen Snaphash eingefügt
$asref->{$nkey.$pkey}{imageData} = cache($name, "c_read", "$dat"."{$pkey}{imageData}"); # Bilddaten der Kamera werden im summarischen Snaphash eingefügt
$asref->{$nkey.$pkey}{fileName} = cache($name, "c_read", "$dat"."{$pkey}{fileName}"); # Filenamen der Kamera werden im summarischen Snaphash eingefügt
-
- Log3($svs, 4, "$svs - Central Snaphash filled up with snapdata of cam \"$name\" and key [".$nkey.$pkey."]");
- }
- }
-
+
+ Log3($svs, 4, "$svs - Central Snaphash filled up with snapdata of cam \"$name\" and key [".$nkey.$pkey."]");
+ }
+ }
+
delete $hash->{HELPER}{CANSENDSNAP}; # Flag im Kamera-Device !! löschen
delete $asref->{$key}; # ursprünglichen Key (Kameranamen) löschen
}
}
$asref = $svshash->{HELPER}{ALLSNAPREF}; # Hashreferenz zum summarischen Snaphash
-
+
for my $key (keys%{$asref}) { # prüfen ob Bildhash komplett ?
if(!$asref->{$key}) {
- return; # Bildhash noch nicht komplett
+ return; # Bildhash noch nicht komplett
}
}
-
+
delete $svshash->{HELPER}{ALLSNAPREF}; # ALLSNAPREF löschen -> gemeinsamer Versand beendet
$hash = $svshash; # Hash durch SVS-Hash ersetzt
- $name = $svshash->{NAME}; # Name des auslösenden SVS-Devices wird eingesetzt
-
- Log3($name, 4, "$name - Central Snaphash fillup completed by all selected cams. Send it now ...");
-
+ $name = $svshash->{NAME}; # Name des auslösenden SVS-Devices wird eingesetzt
+
+ Log3($name, 4, "$name - Central Snaphash fillup completed by all selected cams. Send it now ...");
+
my $cache = cache($name, "c_init"); # Cache initialisieren (im SVS Device)
-
+
if(!$cache || $cache eq "internal" ) {
- delete $data{SSCam}{RS};
- for my $key (keys%{$asref}) { # Referenz zum summarischen Hash einsetzen
- $data{SSCam}{RS}{$key} = delete $asref->{$key};
- }
+ delete $data{SSCam}{RS};
+ for my $key (keys%{$asref}) { # Referenz zum summarischen Hash einsetzen
+ $data{SSCam}{RS}{$key} = delete $asref->{$key};
+ }
$dat = $data{SSCam}{RS}; # Referenz zum summarischen Hash einsetzen
- }
+ }
else {
- cache ($name, 'c_clear');
-
+ cache ($name, 'c_clear');
+
for my $key (keys%{$asref}) {
cache($name, "c_write", "{RS}{multiple_snapsend}{$key}{createdTm}", delete $asref->{$key}{createdTm});
cache($name, "c_write", "{RS}{multiple_snapsend}{$key}{imageData}", delete $asref->{$key}{imageData});
- cache($name, "c_write", "{RS}{multiple_snapsend}{$key}{fileName}", delete $asref->{$key}{fileName});
+ cache($name, "c_write", "{RS}{multiple_snapsend}{$key}{fileName}", delete $asref->{$key}{fileName});
}
-
- $dat = "{RS}{multiple_snapsend}"; # Referenz zum summarischen Hash einsetzen
+
+ $dat = "{RS}{multiple_snapsend}"; # Referenz zum summarischen Hash einsetzen
}
-
- $calias = AttrVal ($name, 'alias', $hash->{NAME}); # Alias des SVS-Devices
- $hash->{HELPER}{TRANSACTION} = 'multiple_snapsend'; # fake Transaction im SVS Device setzen
+
+ $calias = AttrVal ($name, 'alias', $hash->{NAME}); # Alias des SVS-Devices
+ $hash->{HELPER}{TRANSACTION} = 'multiple_snapsend'; # fake Transaction im SVS Device setzen
last; # Schleife verlassen und mit Senden weiter
}
-
- my $sp = AttrVal ($name, 'smtpPort', 25);
- my $nousessl = AttrVal ($name, 'smtpNoUseSSL', 0);
+
+ my $sp = AttrVal ($name, 'smtpPort', 25);
+ my $nousessl = AttrVal ($name, 'smtpNoUseSSL', 0);
my ($date, $time) = timestampToDateTime ();
my $sslfrominit = 0;
my $smtpsslport = 465;
-
+
if(AttrVal($name,"smtpSSLPort",0)) {
$sslfrominit = 1;
$smtpsslport = AttrVal($name,"smtpSSLPort",0);
}
-
+
$tac = $hash->{HELPER}{TRANSACTION}; # Code der laufenden Transaktion
-
+
$data{SSCam}{$name}{SENDCOUNT}{$tac} = 0; # Hilfszähler Senden, init -> +1 , done -> -1, keine Daten
# d. Transaktion werden gelöscht bis Zähler wieder 0 !! (siehe closeTrans)
-
+
Log3($name, 1, "$name - Send Counter transaction \"$tac\": ".$data{SSCam}{$name}{SENDCOUNT}{$tac}) if(AttrVal($name,"debugactivetoken",0));
-
+
### Schnappschüsse als Email versenden wenn $hash->{HELPER}{CANSENDSNAP} definiert ist
######################################################################################
- if($OpMode =~ /^getsnap/x && $hash->{HELPER}{CANSENDSNAP}) {
+ if($OpMode =~ /^getsnap/x && $hash->{HELPER}{CANSENDSNAP}) {
delete $hash->{HELPER}{CANSENDSNAP};
$data{SSCam}{$name}{SENDCOUNT}{$tac}++;
-
+
Log3($name, 1, "$name - Send Counter transaction \"$tac\": ".$data{SSCam}{$name}{SENDCOUNT}{$tac}) if(AttrVal($name,"debugactivetoken",0));
-
- my $mt = delete $hash->{HELPER}{SMTPMSG};
-
+
+ my $mt = delete $hash->{HELPER}{SMTPMSG};
+
my $param = {
hash => $hash,
calias => $calias,
@@ -9535,34 +9541,34 @@ sub prepareSendData {
time => $time,
};
my $smtpmsg = _prepSendMail ($param);
-
+
$ret = _sendEmail($hash, {
- 'subject' => $smtpmsg->{subject},
- 'part1txt' => $smtpmsg->{body},
+ 'subject' => $smtpmsg->{subject},
+ 'part1txt' => $smtpmsg->{body},
'part2type' => 'image/jpeg',
'smtpport' => $sp,
'sdat' => $dat,
'opmode' => $OpMode,
'smtpnousessl' => $nousessl,
'sslfrominit' => $sslfrominit,
- 'smtpsslport' => $smtpsslport,
- 'tac' => $tac,
+ 'smtpsslport' => $smtpsslport,
+ 'tac' => $tac,
}
);
-
+
readingsSingleUpdate($hash, "sendEmailState", $ret, 1) if ($ret);
}
-
+
### Aufnahmen als Email versenden wenn $hash->{HELPER}{CANSENDREC} definiert ist
################################################################################
- if($OpMode =~ /^GetRec/x && $hash->{HELPER}{CANSENDREC}) {
+ if($OpMode =~ /^GetRec/x && $hash->{HELPER}{CANSENDREC}) {
delete $hash->{HELPER}{CANSENDREC};
$data{SSCam}{$name}{SENDCOUNT}{$tac}++;
-
+
Log3($name, 1, "$name - Send Counter transaction \"$tac\": ".$data{SSCam}{$name}{SENDCOUNT}{$tac}) if(AttrVal($name,"debugactivetoken",0));
-
+
my $mt = delete $hash->{HELPER}{SMTPRECMSG};
-
+
my $param = {
hash => $hash,
calias => $calias,
@@ -9571,10 +9577,10 @@ sub prepareSendData {
time => $time,
};
my $smtpmsg = _prepSendMail ($param);
-
+
$ret = _sendEmail($hash, {
- 'subject' => $smtpmsg->{subject},
- 'part1txt' => $smtpmsg->{body},
+ 'subject' => $smtpmsg->{subject},
+ 'part1txt' => $smtpmsg->{body},
'part2type' => 'video/mpeg',
'smtpport' => $sp,
'vdat' => $dat,
@@ -9582,27 +9588,27 @@ sub prepareSendData {
'smtpnousessl' => $nousessl,
'sslfrominit' => $sslfrominit,
'smtpsslport' => $smtpsslport,
- 'tac' => $tac,
+ 'tac' => $tac,
}
);
-
+
readingsSingleUpdate($hash, "sendEmailState", $ret, 1) if ($ret);
}
### Schnappschüsse mit Telegram versenden
# snapTelegramTxt aus $hash->{HELPER}{TELEMSG}
#
- # Format in $hash->{HELPER}{TELEMSG} muss sein:
+ # Format in $hash->{HELPER}{TELEMSG} muss sein:
# tbot => , peers => , subject =>
################################################################################################
- if($OpMode =~ /^getsnap/x && $hash->{HELPER}{CANTELESNAP}) {
+ if($OpMode =~ /^getsnap/x && $hash->{HELPER}{CANTELESNAP}) {
delete $hash->{HELPER}{CANTELESNAP};
$data{SSCam}{$name}{SENDCOUNT}{$tac}++;
-
+
Log3 ($name, 1, "$name - Send Counter transaction \"$tac\": ".$data{SSCam}{$name}{SENDCOUNT}{$tac}) if(AttrVal($name,"debugactivetoken",0));
-
+
my $mt = delete $hash->{HELPER}{TELEMSG};
-
+
my $param = {
hash => $hash,
calias => $calias,
@@ -9611,37 +9617,37 @@ sub prepareSendData {
time => $time,
};
my $telemsg = _prepSendTelegram ($param);
-
+
$ret = _sendTelegram($hash, {
'subject' => $telemsg->{subject},
'part2type' => 'image/jpeg',
'sdat' => $dat,
'opmode' => $OpMode,
- 'tac' => $tac,
- 'telebot' => $telemsg->{tbot},
+ 'tac' => $tac,
+ 'telebot' => $telemsg->{tbot},
'peers' => $telemsg->{peers},
- 'option' => $telemsg->{option}, # Versandoptionen
+ 'option' => $telemsg->{option}, # Versandoptionen
'MediaStream' => '-1', # Code für MediaStream im TelegramBot (png/jpg = -1)
}
);
-
- readingsSingleUpdate($hash, "sendTeleState", $ret, 1) if ($ret);
+
+ readingsSingleUpdate($hash, "sendTeleState", $ret, 1) if ($ret);
}
### Aufnahmen mit Telegram versenden
# recTelegramTxt aus $hash->{HELPER}{TELERECMSG}
#
- # Format in $hash->{HELPER}{TELEMSG} muss sein:
+ # Format in $hash->{HELPER}{TELEMSG} muss sein:
# tbot => , peers => , subject =>
#################################################################################################
- if($OpMode =~ /^GetRec/x && $hash->{HELPER}{CANTELEREC}) {
+ if($OpMode =~ /^GetRec/x && $hash->{HELPER}{CANTELEREC}) {
delete $hash->{HELPER}{CANTELEREC};
$data{SSCam}{$name}{SENDCOUNT}{$tac}++;
-
+
Log3($name, 1, "$name - Send Counter transaction \"$tac\": ".$data{SSCam}{$name}{SENDCOUNT}{$tac}) if(AttrVal($name,"debugactivetoken",0));
-
+
my $mt = delete $hash->{HELPER}{TELERECMSG};
-
+
my $param = {
hash => $hash,
calias => $calias,
@@ -9650,36 +9656,36 @@ sub prepareSendData {
time => $time,
};
my $telemsg = _prepSendTelegram ($param);
-
- $vdat = $dat;
+
+ $vdat = $dat;
$ret = _sendTelegram($hash, {
'subject' => $telemsg->{subject},
'vdat' => $vdat,
- 'opmode' => $OpMode,
- 'telebot' => $telemsg->{tbot},
+ 'opmode' => $OpMode,
+ 'telebot' => $telemsg->{tbot},
'peers' => $telemsg->{peers},
'option' => $telemsg->{option}, # Versandoptionen
- 'tac' => $tac,
+ 'tac' => $tac,
'MediaStream' => '-30', # Code für MediaStream im TelegramBot (png/jpg = -1)
}
);
-
- readingsSingleUpdate($hash, "sendTeleState", $ret, 1) if ($ret);
+
+ readingsSingleUpdate($hash, "sendTeleState", $ret, 1) if ($ret);
}
-
+
### Schnappschüsse mit Synology Chat versenden
# snapChatTxt aus $hash->{HELPER}{CHATMSG}
- # Format in $hash->{HELPER}{CHATMSG} muss sein: snapChatTxt:"chatbot => ,
+ # Format in $hash->{HELPER}{CHATMSG} muss sein: snapChatTxt:"chatbot => ,
# peers => , subject => "
#############################################################################################
- if($OpMode =~ /^getsnap/x && $hash->{HELPER}{CANCHATSNAP}) {
+ if($OpMode =~ /^getsnap/x && $hash->{HELPER}{CANCHATSNAP}) {
delete $hash->{HELPER}{CANCHATSNAP};
$data{SSCam}{$name}{SENDCOUNT}{$tac}++;
-
+
Log3($name, 1, "$name - Send Counter transaction \"$tac\": ".$data{SSCam}{$name}{SENDCOUNT}{$tac}) if(AttrVal($name,"debugactivetoken",0));
-
+
my $mt = delete $hash->{HELPER}{CHATMSG};
-
+
my $param = {
hash => $hash,
calias => $calias,
@@ -9688,33 +9694,33 @@ sub prepareSendData {
time => $time,
};
my $chatmsg = _prepSendChat ($param);
-
+
$ret = _sendChat($hash, {
'subject' => $chatmsg->{subject},
'opmode' => $OpMode,
'tac' => $tac,
- 'sdat' => $dat,
- 'chatbot' => $chatmsg->{chatbot},
+ 'sdat' => $dat,
+ 'chatbot' => $chatmsg->{chatbot},
'peers' => $chatmsg->{peers},
}
);
-
- readingsSingleUpdate($hash, "sendChatState", $ret, 1) if ($ret);
+
+ readingsSingleUpdate($hash, "sendChatState", $ret, 1) if ($ret);
}
-
+
### Aufnahmen mit Synology Chat versenden
# recChatTxt aus $hash->{HELPER}{CHATRECMSG}
- # Format in $hash->{HELPER}{CHATRECMSG} muss sein: chatbot => ,
+ # Format in $hash->{HELPER}{CHATRECMSG} muss sein: chatbot => ,
# peers => , subject =>
###################################################################################
- if($OpMode =~ /^GetRec/x && $hash->{HELPER}{CANCHATREC}) {
+ if($OpMode =~ /^GetRec/x && $hash->{HELPER}{CANCHATREC}) {
delete $hash->{HELPER}{CANCHATREC};
$data{SSCam}{$name}{SENDCOUNT}{$tac}++;
-
+
Log3($name, 1, "$name - Send Counter transaction \"$tac\": ".$data{SSCam}{$name}{SENDCOUNT}{$tac}) if(AttrVal($name,"debugactivetoken",0));
-
+
my $mt = delete $hash->{HELPER}{CHATRECMSG};
-
+
my $param = {
hash => $hash,
calias => $calias,
@@ -9723,41 +9729,41 @@ sub prepareSendData {
time => $time,
};
my $chatmsg = _prepSendChat ($param);
-
+
$ret = _sendChat($hash, {
'subject' => $chatmsg->{subject},
- 'opmode' => $OpMode,
- 'tac' => $tac,
+ 'opmode' => $OpMode,
+ 'tac' => $tac,
'vdat' => $dat,
'chatbot' => $chatmsg->{chatbot},
- 'peers' => $chatmsg->{peers},
+ 'peers' => $chatmsg->{peers},
}
);
-
- readingsSingleUpdate($hash, "sendChatState", $ret, 1) if ($ret);
+
+ readingsSingleUpdate($hash, "sendChatState", $ret, 1) if ($ret);
}
-
- closeTrans($hash) if($hash->{HELPER}{TRANSACTION} eq "multiple_snapsend"); # Transaction Sammelversand (SVS) schließen, Daten bereinigen
-
+
+ closeTrans($hash) if($hash->{HELPER}{TRANSACTION} eq "multiple_snapsend"); # Transaction Sammelversand (SVS) schließen, Daten bereinigen
+
return;
}
###############################################################################
# Vorbereitung Versand Chatnachrichten
###############################################################################
-sub _prepSendChat {
+sub _prepSendChat {
my $paref = shift;
my $hash = $paref->{hash};
my $calias = $paref->{calias};
my $mt = $paref->{mt};
my $date = $paref->{date};
my $time = $paref->{time};
- my $name = $hash->{NAME};
+ my $name = $hash->{NAME};
my ($cbott,$peert,$subjt);
-
+
$mt =~ s/['"]//gx;
-
+
my ($chatbot,$peers,$subj) = split(",", $mt, 3 );
$cbott = (split("=>", $chatbot))[1] if($chatbot);
$peert = (split("=>", $peers ))[1] if($peers);
@@ -9765,36 +9771,36 @@ sub _prepSendChat {
$cbott = trim($cbott) if($cbott);
$peert = trim($peert) if($peert);
-
+
if($subjt) {
$subjt = trim($subjt);
$subjt =~ s/[\$#]CAM/$calias/gx;
$subjt =~ s/[\$#]DATE/$date/gx;
$subjt =~ s/[\$#]TIME/$time/gx;
- }
-
+ }
+
my %chatmsg = ();
$chatmsg{chatbot} = "$cbott" if($cbott);
$chatmsg{peers} = "$peert" if($peert);
$chatmsg{subject} = "$subjt" if($subjt);
-
+
return \%chatmsg;
}
#############################################################################################
# Synology Chat-Versand
#############################################################################################
-sub _sendChat {
+sub _sendChat {
my ($hash, $extparamref) = @_;
my $name = $hash->{NAME};
my $type = AttrVal($name,"cacheType","internal");
my $mtype = "";
my ($params,$ret,$cache);
-
- Log3($name, 4, "$name - ####################################################");
- Log3($name, 4, "$name - ### start send Snap or Video by SSChatBot ");
+
Log3($name, 4, "$name - ####################################################");
-
+ Log3($name, 4, "$name - ### start send Snap or Video by SSChatBot ");
+ Log3($name, 4, "$name - ####################################################");
+
my %chatparams = (
'subject' => { 'default'=>'', 'required'=>1, 'set'=>1},
'opmode' => { 'default'=>'', 'required'=>1, 'set'=>1}, # OpMode muss gesetzt sein
@@ -9804,45 +9810,45 @@ sub _sendChat {
'chatbot' => { 'default'=>'', 'required'=>1, 'set'=>1}, # SSChatBot-Device welches zum Senden verwendet werden soll
'peers' => { 'default'=>'', 'required'=>0, 'set'=>1}, # SSChatBot Peers
'videofolderMap' => {'attr'=>'videofolderMap', 'default'=>'', 'required'=>1, 'set'=>1}, # Wert des Attributs videofolderMap (muss gesetzt sein !)
- );
-
+ );
+
my $tac = $extparamref->{tac};
-
+
for my $key (keys %chatparams) {
- $data{SSCam}{$name}{PARAMS}{$tac}{$key} = AttrVal($name, $chatparams{$key}->{attr}, $chatparams{$key}->{default})
- if(exists $chatparams{$key}->{attr});
- if($chatparams{$key}->{set}) {
- $data{SSCam}{$name}{PARAMS}{$tac}{$key} = $chatparams{$key}->{default} if (!$extparamref->{$key} && !$chatparams{$key}->{attr});
+ $data{SSCam}{$name}{PARAMS}{$tac}{$key} = AttrVal($name, $chatparams{$key}->{attr}, $chatparams{$key}->{default})
+ if(exists $chatparams{$key}->{attr});
+ if($chatparams{$key}->{set}) {
+ $data{SSCam}{$name}{PARAMS}{$tac}{$key} = $chatparams{$key}->{default} if (!$extparamref->{$key} && !$chatparams{$key}->{attr});
$data{SSCam}{$name}{PARAMS}{$tac}{$key} = delete $extparamref->{$key} if(exists $extparamref->{$key});
}
- Log3($name, 4, "$name - param $key is set to \"".($data{SSCam}{$name}{PARAMS}{$tac}{$key} // "")."\" ") if($key !~ /[sv]dat/x);
+ Log3($name, 4, "$name - param $key is set to >".($data{SSCam}{$name}{PARAMS}{$tac}{$key} // "")."< ") if($key !~ /[sv]dat/x);
Log3($name, 4, "$name - param $key is set") if($key =~ /[sv]dat/x && $data{SSCam}{$name}{PARAMS}{$tac}{$key} ne '');
}
-
+
$data{SSCam}{$name}{PARAMS}{$tac}{name} = $name;
-
+
my @err = ();
for my $key (keys(%chatparams)) {
push(@err, $key) if ($chatparams{$key}->{required} && !$data{SSCam}{$name}{PARAMS}{$tac}{$key});
}
-
+
if ($#err >= 0) {
$ret = "Missing at least one required parameter or attribute: ".join(', ',@err);
Log3($name, 2, "$name - $ret");
-
+
readingsBeginUpdate ($hash);
readingsBulkUpdate ($hash,"sendChatState",$ret);
readingsEndUpdate ($hash, 1);
-
+
$data{SSCam}{$name}{SENDCOUNT}{$tac} -= 1;
return $ret;
}
-
+
my $chatbot = $data{SSCam}{$name}{PARAMS}{$tac}{chatbot};
- my $peers = $data{SSCam}{$name}{PARAMS}{$tac}{peers};
+ my $peers = $data{SSCam}{$name}{PARAMS}{$tac}{peers};
my $rootUrl = $data{SSCam}{$name}{PARAMS}{$tac}{videofolderMap};
-
+
if(!$defs{$chatbot}) {
$ret = "No SSChatBot device \"$chatbot\" available";
readingsSingleUpdate($hash, "sendChatState", $ret, 1);
@@ -9850,7 +9856,7 @@ sub _sendChat {
$data{SSCam}{$name}{SENDCOUNT}{$tac} -= 1;
return;
}
-
+
if(!$peers) {
$peers = AttrVal($chatbot,"defaultPeer", "");
if(!$peers) {
@@ -9858,11 +9864,11 @@ sub _sendChat {
readingsSingleUpdate($hash, "sendChatState", $ret, 1);
Log3($name, 2, "$name - $ret");
$data{SSCam}{$name}{SENDCOUNT}{$tac} -= 1;
- return;
+ return;
}
- }
+ }
else {
- $peers = join(",", split(" ", $peers));
+ $peers = join(",", split(" ", $peers));
}
if(!$data{SSCam}{$name}{PARAMS}{$tac}{sdat} && !$data{SSCam}{$name}{PARAMS}{$tac}{vdat}) {
@@ -9870,27 +9876,27 @@ sub _sendChat {
readingsSingleUpdate($hash, "sendChatState", $ret, 1);
Log3($name, 2, "$name - $ret");
$data{SSCam}{$name}{SENDCOUNT}{$tac} -= 1;
- return;
- }
-
+ return;
+ }
+
my ($subject,$fileUrl,$uid,$fname,@as,%seen,@unique);
-
- $cache = cache($name, "c_init"); # Cache initialisieren
+
+ $cache = cache($name, "c_init"); # Cache initialisieren
Log3($name, 1, "$name - Fall back to internal Cache due to preceding failure.") if(!$cache);
-
+
if(!$cache || $cache eq "internal" ) {
if($data{SSCam}{$name}{PARAMS}{$tac}{sdat}) { # Images liegen in einem Hash (Ref in $sdat) base64-codiert vor
@as = sort{$b<=>$a}keys%{$data{SSCam}{$name}{PARAMS}{$tac}{sdat}};
$mtype = "\@Snapshot";
- }
+ }
elsif($data{SSCam}{$name}{PARAMS}{$tac}{vdat}) { # Aufnahmen liegen in einem Hash-Ref in $vdat vor
@as = sort{$b<=>$a}keys%{$data{SSCam}{$name}{PARAMS}{$tac}{vdat}};
$mtype = $hash->{CAMNAME};
}
-
+
for my $key (@as) {
($subject,$fname) = __extractForChat($name,$key,$data{SSCam}{$name}{PARAMS}{$tac});
-
+
my @ua = split(",", $peers); # User aufsplitten und zu jedem die ID ermitteln
for (@ua) {
next if(!$_);
@@ -9900,86 +9906,15 @@ sub _sendChat {
readingsSingleUpdate($hash, "sendChatState", $ret, 1);
Log3($name, 2, "$name - $ret");
$data{SSCam}{$name}{SENDCOUNT}{$tac} -= 1;
- return;
+ return;
}
-
- # Eintrag zur SendQueue hinzufügen
- # Werte: (name,opmode,method,userid,text,fileUrl,channel,attachment)
- $fileUrl = $rootUrl."/".$mtype."/".$fname;
- $subject = FHEM::SSChatBot::formString ($subject, "text");
-
- $params = {
- name => $chatbot,
- opmode => "sendItem",
- method => "chatbot",
- userid => $uid,
- text => $subject,
- fileUrl => $fileUrl,
- channel => "",
- attachment => ""
- };
- $ret = FHEM::SSChatBot::addSendqueue ($params);
- if($ret) {
- readingsSingleUpdate($hash, "sendChatState", $ret, 1);
- Log3($name, 2, "$name - ERROR: $ret");
- }
- else {
- $ret = "Chat message [$key] of transaction \"$tac\" for \"$_\" added to \"$chatbot\" sendqueue";
- readingsSingleUpdate($hash, "sendChatState", $ret, 1);
- Log3($name, 3, "$name - $ret");
- }
- }
- }
- $data{SSCam}{$name}{SENDCOUNT}{$tac} -= 1;
- Log3($name, 1, "$name - Send Counter transaction \"$tac\": ".$data{SSCam}{$name}{SENDCOUNT}{$tac}) if(AttrVal($name,"debugactivetoken",0));
- }
- else {
- # alle Serial Numbers "{$sn}" der Transaktion ermitteln
- if($data{SSCam}{$name}{PARAMS}{$tac}{sdat}) { # Images liegen in einem Hash (Ref in $sdat) base64-codiert vor
- extractTIDfromCache ( { name => $name,
- tac => $tac,
- media => "SENDSNAPS",
- mode => "serial",
- aref => \@as
- }
- );
- $mtype = "\@Snapshot";
- }
- elsif($data{SSCam}{$name}{PARAMS}{$tac}{vdat}) { # Aufnahmen liegen in einem Hash-Ref in $vdat vor
- extractTIDfromCache ( { name => $name,
- tac => $tac,
- media => "SENDRECS",
- mode => "serial",
- aref => \@as
- }
- );
- $mtype = $hash->{CAMNAME};
- }
-
- @unique = sort{$b<=>$a} grep { !$seen{$_}++ } @as; # distinct / unique the keys
-
- for my $key (@unique) {
- ($subject,$fname) = __extractForChat($name,$key,$data{SSCam}{$name}{PARAMS}{$tac});
-
- my @ua = split(/,/x, $peers); # User aufsplitten und zu jedem die ID ermitteln
- for (@ua) {
- next if(!$_);
- $uid = $defs{$chatbot}{HELPER}{USERS}{$_}{id};
- if(!$uid) {
- $ret = "The receptor \"$_\" seems to be unknown because its ID coulnd't be found.";
- readingsSingleUpdate($hash, "sendChatState", $ret, 1);
- Log3($name, 2, "$name - $ret");
- $data{SSCam}{$name}{SENDCOUNT}{$tac} -= 1;
- return;
- }
-
# Eintrag zur SendQueue hinzufügen
# Werte: (name,opmode,method,userid,text,fileUrl,channel,attachment)
$fileUrl = $rootUrl."/".$mtype."/".$fname;
- $subject = FHEM::SSChatBot::formString ($subject, "text");
-
- $params = {
+ $subject = FHEM::SSChatBot::formString ($subject, "text");
+
+ $params = {
name => $chatbot,
opmode => "sendItem",
method => "chatbot",
@@ -9990,29 +9925,100 @@ sub _sendChat {
attachment => ""
};
$ret = FHEM::SSChatBot::addSendqueue ($params);
-
+
if($ret) {
readingsSingleUpdate($hash, "sendChatState", $ret, 1);
Log3($name, 2, "$name - ERROR: $ret");
- }
+ }
else {
$ret = "Chat message [$key] of transaction \"$tac\" for \"$_\" added to \"$chatbot\" sendqueue";
readingsSingleUpdate($hash, "sendChatState", $ret, 1);
Log3($name, 3, "$name - $ret");
}
- }
- }
-
+ }
+ }
$data{SSCam}{$name}{SENDCOUNT}{$tac} -= 1;
Log3($name, 1, "$name - Send Counter transaction \"$tac\": ".$data{SSCam}{$name}{SENDCOUNT}{$tac}) if(AttrVal($name,"debugactivetoken",0));
}
-
+ else {
+ # alle Serial Numbers "{$sn}" der Transaktion ermitteln
+ if($data{SSCam}{$name}{PARAMS}{$tac}{sdat}) { # Images liegen in einem Hash (Ref in $sdat) base64-codiert vor
+ extractTIDfromCache ( { name => $name,
+ tac => $tac,
+ media => "SENDSNAPS",
+ mode => "serial",
+ aref => \@as
+ }
+ );
+ $mtype = "\@Snapshot";
+ }
+ elsif($data{SSCam}{$name}{PARAMS}{$tac}{vdat}) { # Aufnahmen liegen in einem Hash-Ref in $vdat vor
+ extractTIDfromCache ( { name => $name,
+ tac => $tac,
+ media => "SENDRECS",
+ mode => "serial",
+ aref => \@as
+ }
+ );
+ $mtype = $hash->{CAMNAME};
+ }
+
+ @unique = sort{$b<=>$a} grep { !$seen{$_}++ } @as; # distinct / unique the keys
+
+ for my $key (@unique) {
+ ($subject,$fname) = __extractForChat($name,$key,$data{SSCam}{$name}{PARAMS}{$tac});
+
+ my @ua = split(/,/x, $peers); # User aufsplitten und zu jedem die ID ermitteln
+ for (@ua) {
+ next if(!$_);
+ $uid = $defs{$chatbot}{HELPER}{USERS}{$_}{id};
+ if(!$uid) {
+ $ret = "The receptor \"$_\" seems to be unknown because its ID coulnd't be found.";
+ readingsSingleUpdate($hash, "sendChatState", $ret, 1);
+ Log3($name, 2, "$name - $ret");
+ $data{SSCam}{$name}{SENDCOUNT}{$tac} -= 1;
+ return;
+ }
+
+ # Eintrag zur SendQueue hinzufügen
+ # Werte: (name,opmode,method,userid,text,fileUrl,channel,attachment)
+ $fileUrl = $rootUrl."/".$mtype."/".$fname;
+ $subject = FHEM::SSChatBot::formString ($subject, "text");
+
+ $params = {
+ name => $chatbot,
+ opmode => "sendItem",
+ method => "chatbot",
+ userid => $uid,
+ text => $subject,
+ fileUrl => $fileUrl,
+ channel => "",
+ attachment => ""
+ };
+ $ret = FHEM::SSChatBot::addSendqueue ($params);
+
+ if($ret) {
+ readingsSingleUpdate($hash, "sendChatState", $ret, 1);
+ Log3($name, 2, "$name - ERROR: $ret");
+ }
+ else {
+ $ret = "Chat message [$key] of transaction \"$tac\" for \"$_\" added to \"$chatbot\" sendqueue";
+ readingsSingleUpdate($hash, "sendChatState", $ret, 1);
+ Log3($name, 3, "$name - $ret");
+ }
+ }
+ }
+
+ $data{SSCam}{$name}{SENDCOUNT}{$tac} -= 1;
+ Log3($name, 1, "$name - Send Counter transaction \"$tac\": ".$data{SSCam}{$name}{SENDCOUNT}{$tac}) if(AttrVal($name,"debugactivetoken",0));
+ }
+
FHEM::SSChatBot::getApiSites ($chatbot); # Übertragung Sendqueue starten
-
+
# use strict "refs";
undef %chatparams;
undef %{$extparamref};
-
+
return;
}
@@ -10026,287 +10032,296 @@ sub __extractForChat {
my $hash = $defs{$name};
my $subject = $paref->{subject};
my $sdat = $paref->{sdat}; # Hash von Imagedaten base64 codiert
- my $vdat = $paref->{vdat}; # Hashref der Videodaten
-
+ my $vdat = $paref->{vdat}; # Hashref der Videodaten
+
my ($fname,$tdir,$ct,$cache);
-
+
if($sdat) {
- $cache = cache($name, "c_init"); # Cache initialisieren
+ $cache = cache($name, "c_init"); # Cache initialisieren
if(!$cache || $cache eq "internal" ) {
$ct = $paref->{sdat}{$key}{createdTm};
- $fname = trim ($paref->{sdat}{$key}{fileName});
- }
+ $fname = trim ($paref->{sdat}{$key}{fileName});
+ }
else {
$ct = cache($name, "c_read", "$sdat"."{$key}{createdTm}");
- $fname = trim( cache($name, "c_read", "$sdat"."{$key}{fileName}") );
+ $fname = trim( cache($name, "c_read", "$sdat"."{$key}{fileName}") );
}
- }
-
+ }
+
if($vdat) {
- $cache = cache($name, "c_init"); # Cache initialisieren
+ $cache = cache($name, "c_init"); # Cache initialisieren
if(!$cache || $cache eq "internal" ) {
$ct = $paref->{vdat}{$key}{createdTm};
$fname = trim ($paref->{vdat}{$key}{fileName});
$tdir = trim ($paref->{vdat}{$key}{tdir});
- }
+ }
else {
- $ct = cache($name, "c_read", "$vdat"."{$key}{createdTm}");
+ $ct = cache($name, "c_read", "$vdat"."{$key}{createdTm}");
$fname = trim( cache($name, "c_read", "$vdat"."{$key}{fileName}") );
$tdir = trim( cache($name, "c_read", "$vdat"."{$key}{tdir}") );
}
$fname = $tdir."/".$fname;
}
-
+
$subject =~ s/[\$#]FILE/$fname/gx;
$subject =~ s/[\$#]CTIME/$ct/gx;
-
+
return ($subject,$fname);
}
###############################################################################
# Vorbereitung Versand Telegramnachrichten
###############################################################################
-sub _prepSendTelegram {
+sub _prepSendTelegram {
my $paref = shift;
+
my $hash = $paref->{hash};
my $calias = $paref->{calias};
my $mt = $paref->{mt};
my $date = $paref->{date};
my $time = $paref->{time};
+
my $name = $hash->{NAME};
my ($tbott,$peert,$subjt,$optt);
-
+
$mt =~ s/['"]//gx;
-
+
my ($telebot, $peers, $subj, $opt) = split ",", $mt, 4;
-
+
$tbott = (split "=>", $telebot)[1] if($telebot);
$peert = (split "=>", $peers )[1] if($peers);
$subjt = (split "=>", $subj )[1] if($subj);
$optt = (split "=>", $opt )[1] if($opt);
- $tbott = trim($tbott) if($tbott);
- $peert = trim($peert) if($peert);
-
+ $tbott = trim ($tbott) if($tbott);
+ $peert = trim ($peert) if($peert);
+
if($subjt) {
$subjt = trim($subjt);
$subjt =~ s/[\$#]CAM/$calias/gx;
$subjt =~ s/[\$#]DATE/$date/gx;
$subjt =~ s/[\$#]TIME/$time/gx;
- }
-
+ }
+
my %telemsg = ();
$telemsg{tbot} = "$tbott" if($tbott);
$telemsg{peers} = "$peert" if($peert);
$telemsg{subject} = "$subjt" if($subjt);
$telemsg{option} = "$optt" if($optt);
-
+
return \%telemsg;
}
#############################################################################################
# Telegram-Versand
#############################################################################################
-sub _sendTelegram {
+sub _sendTelegram {
my ($hash, $extparamref) = @_;
my $name = $hash->{NAME};
my $type = AttrVal($name,"cacheType","internal");
my ($ret,$cache);
-
- Log3($name, 4, "$name - ####################################################");
- Log3($name, 4, "$name - ### start send Snap or Video by TelegramBot ");
+
Log3($name, 4, "$name - ####################################################");
-
+ Log3($name, 4, "$name - ### start send Snap or Video by TelegramBot ");
+ Log3($name, 4, "$name - ####################################################");
+
my %teleparams = (
- 'subject' => { 'default'=>'', 'required'=>0, 'set'=>1},
- 'part1type' => { 'default'=>'text/html; charset=UTF-8', 'required'=>1, 'set'=>1},
- 'part1txt' => { 'default'=>'', 'required'=>0, 'set'=>1},
- 'part2type' => { 'default'=>'', 'required'=>0, 'set'=>1},
- 'sdat' => { 'default'=>'', 'required'=>0, 'set'=>1}, # Hashref der Bilddaten (Bilddaten base64 codiert), wenn gesetzt muss 'part2type' auf 'image/jpeg' gesetzt sein
- 'image' => { 'default'=>'', 'required'=>0, 'set'=>1}, # Daten als File, wenn gesetzt muss 'part2type' auf 'image/jpeg' gesetzt sein
- 'fname' => { 'default'=>'', 'required'=>0, 'set'=>1}, # Filename für "image"
- 'lsnaptime' => { 'default'=>'', 'required'=>0, 'set'=>1}, # Zeitstempel der Bilddaten
- 'opmode' => { 'default'=>'', 'required'=>1, 'set'=>1}, # OpMode muss gesetzt sein
- 'tac' => { 'default'=>'', 'required'=>0, 'set'=>1}, # übermittelter Transaktionscode der ausgewerteten Transaktion
- 'vdat' => { 'default'=>'', 'required'=>0, 'set'=>1}, # Hashref der Videodaten
- 'telebot' => { 'default'=>'', 'required'=>1, 'set'=>1}, # TelegramBot-Device welches zum Senden verwendet werden soll
- 'peers' => { 'default'=>'', 'required'=>0, 'set'=>1}, # TelegramBot Peers
- 'option' => { 'default'=>'', 'required'=>0, 'set'=>1}, # TelegramBot Sendeoptionen
- 'MediaStream' => { 'default'=>'', 'required'=>0, 'set'=>1}, # Code für MediaStream im TelegramBot (png/jpg = -1)
- );
-
+ 'subject' => {'attr'=>'', 'default'=>'', 'required'=>0, 'set'=>1},
+ 'part1type' => {'attr'=>'', 'default'=>'text/html; charset=UTF-8', 'required'=>1, 'set'=>1},
+ 'part1txt' => {'attr'=>'', 'default'=>'', 'required'=>0, 'set'=>1},
+ 'part2type' => {'attr'=>'', 'default'=>'', 'required'=>0, 'set'=>1},
+ 'sdat' => {'attr'=>'', 'default'=>'', 'required'=>0, 'set'=>1}, # Hashref der Bilddaten (Bilddaten base64 codiert), wenn gesetzt muss 'part2type' auf 'image/jpeg' gesetzt sein
+ 'image' => {'attr'=>'', 'default'=>'', 'required'=>0, 'set'=>1}, # Daten als File, wenn gesetzt muss 'part2type' auf 'image/jpeg' gesetzt sein
+ 'fname' => {'attr'=>'', 'default'=>'', 'required'=>0, 'set'=>1}, # Filename für "image"
+ 'lsnaptime' => {'attr'=>'', 'default'=>'', 'required'=>0, 'set'=>1}, # Zeitstempel der Bilddaten
+ 'opmode' => {'attr'=>'', 'default'=>'', 'required'=>1, 'set'=>1}, # OpMode muss gesetzt sein
+ 'tac' => {'attr'=>'', 'default'=>'', 'required'=>0, 'set'=>1}, # übermittelter Transaktionscode der ausgewerteten Transaktion
+ 'vdat' => {'attr'=>'', 'default'=>'', 'required'=>0, 'set'=>1}, # Hashref der Videodaten
+ 'telebot' => {'attr'=>'', 'default'=>'', 'required'=>1, 'set'=>1}, # TelegramBot-Device welches zum Senden verwendet werden soll
+ 'peers' => {'attr'=>'', 'default'=>'', 'required'=>0, 'set'=>1}, # TelegramBot Peers
+ 'option' => {'attr'=>'', 'default'=>'', 'required'=>0, 'set'=>1}, # TelegramBot Sendeoptionen
+ 'MediaStream' => {'attr'=>'', 'default'=>'', 'required'=>0, 'set'=>1}, # Code für MediaStream im TelegramBot (png/jpg = -1)
+ );
+
my $tac = $extparamref->{tac};
-
+
for my $key (keys %teleparams) {
- $data{SSCam}{$name}{PARAMS}{$tac}{$key} = AttrVal($name, $teleparams{$key}->{attr}, $teleparams{$key}->{default})
- if(exists $teleparams{$key}->{attr});
- if($teleparams{$key}->{set}) {
- $data{SSCam}{$name}{PARAMS}{$tac}{$key} = $teleparams{$key}->{default} if (!$extparamref->{$key} && !$teleparams{$key}->{attr});
- $data{SSCam}{$name}{PARAMS}{$tac}{$key} = delete $extparamref->{$key} if(exists $extparamref->{$key});
+ $data{SSCam}{$name}{PARAMS}{$tac}{$key} = AttrVal ($name, $teleparams{$key}->{attr}, $teleparams{$key}->{default})
+ if($teleparams{$key}->{attr});
+ if($teleparams{$key}->{set}) {
+ $data{SSCam}{$name}{PARAMS}{$tac}{$key} = $teleparams{$key}->{default} if(!$extparamref->{$key} && !$teleparams{$key}->{attr});
+ $data{SSCam}{$name}{PARAMS}{$tac}{$key} = delete $extparamref->{$key} if($extparamref->{$key});
}
-
- Log3 ($name, 4, "$name - param $key is set to \"".($data{SSCam}{$name}{PARAMS}{$tac}{$key} // "")."\" ") if($key !~ /[sv]dat/x);
- Log3 ($name, 4, "$name - param $key is set") if($key =~ /[sv]dat/x && $data{SSCam}{$name}{PARAMS}{$tac}{$key} ne '');
+
+ Log3 ($name, 4, "$name - param $key is set to >".($data{SSCam}{$name}{PARAMS}{$tac}{$key} // '')."< ") if($key !~ /[sv]dat/x);
+ Log3 ($name, 4, "$name - param $key is set") if($key =~ /[sv]dat/x && $data{SSCam}{$name}{PARAMS}{$tac}{$key} ne '');
}
-
+
$data{SSCam}{$name}{PARAMS}{$tac}{name} = $name;
-
+
my @err = ();
for my $key (keys(%teleparams)) {
push(@err, $key) if ($teleparams{$key}->{required} && !$data{SSCam}{$name}{PARAMS}{$tac}{$key});
}
-
+
if ($#err >= 0) {
$ret = "Missing at least one required parameter or attribute: ".join(', ',@err);
-
+
Log3 ($name, 2, "$name - $ret");
-
+
readingsBeginUpdate ($hash);
readingsBulkUpdate ($hash, 'sendTeleState', $ret);
readingsEndUpdate ($hash, 1);
-
+
$data{SSCam}{$name}{SENDCOUNT}{$tac} -= 1;
return $ret;
}
-
+
my $telebot = $data{SSCam}{$name}{PARAMS}{$tac}{telebot};
- my $peers = $data{SSCam}{$name}{PARAMS}{$tac}{peers};
-
+
if(!$defs{$telebot}) {
$ret = "No TelegramBot device \"$telebot\" available";
-
+
readingsSingleUpdate($hash, "sendTeleState", $ret, 1);
-
+
Log3 ($name, 2, "$name - $ret");
-
+
$data{SSCam}{$name}{SENDCOUNT}{$tac} -= 1;
return;
}
-
+
+ my $peers = $data{SSCam}{$name}{PARAMS}{$tac}{peers};
+
+ if ($peers =~ /^r:/xs) { # Reading mit Empfängern ist hinterlegt
+ my $pr = (split ':', $peers)[1];
+ $peers = ReadingsVal ($name, $pr, '');
+
+ Log3 ($name, 4, "$name - peers was fetched from reading >$pr<: $peers");
+ }
+
if(!$peers) {
- $peers = AttrVal($telebot,"defaultPeer", "");
-
+ $peers = AttrVal ($telebot, 'defaultPeer', '');
+
if(!$peers) {
$ret = "No peers of TelegramBot device \"$telebot\" found";
-
+
readingsSingleUpdate($hash, "sendTeleState", $ret, 1);
-
- Log3($name, 2, "$name - $ret");
-
+
+ Log3 ($name, 2, "$name - $ret");
+
$data{SSCam}{$name}{SENDCOUNT}{$tac} -= 1;
- return;
+ return;
}
}
if(!$data{SSCam}{$name}{PARAMS}{$tac}{sdat} && !$data{SSCam}{$name}{PARAMS}{$tac}{vdat}) {
$ret = "no video or image data existing for send process by TelegramBot \"$telebot\" ";
-
+
readingsSingleUpdate($hash, "sendTeleState", $ret, 1);
-
+
Log3 ($name, 2, "$name - $ret");
-
+
$data{SSCam}{$name}{SENDCOUNT}{$tac} -= 1;
- return;
- }
-
+ return;
+ }
+
my $options = '';
my @opta = split ' ', $data{SSCam}{$name}{PARAMS}{$tac}{option};
-
+
if (@opta) {
-
for my $o (@opta) {
$options .= " -$o-"
}
-
+
$options .= ' ';
- }
-
+ }
+
my ($msg,$subject,$MediaStream,$fname,@as,%seen,@unique);
-
- $cache = cache($name, "c_init"); # Cache initialisieren
-
+
+ $cache = cache($name, "c_init"); # Cache initialisieren
+
Log3 ($name, 1, "$name - Fall back to internal Cache due to preceding failure.") if(!$cache);
-
+
if(!$cache || $cache eq "internal" ) {
if($data{SSCam}{$name}{PARAMS}{$tac}{sdat}) { # Images liegen in einem Hash (Ref in $sdat) base64-codiert vor
@as = sort{$b<=>$a}keys%{$data{SSCam}{$name}{PARAMS}{$tac}{sdat}};
- }
+ }
elsif($data{SSCam}{$name}{PARAMS}{$tac}{vdat}) { # Aufnahmen liegen in einem Hash-Ref in $vdat vor
@as = sort{$b<=>$a}keys%{$data{SSCam}{$name}{PARAMS}{$tac}{vdat}};
}
-
+
for my $key (@as) {
($msg,$subject,$MediaStream,$fname) = __extractForTelegram($name,$key,$data{SSCam}{$name}{PARAMS}{$tac});
$ret = __TBotSendIt($defs{$telebot}, $name, $fname, $peers, $msg, $subject, $MediaStream, undef, $options);
-
+
if($ret) {
readingsSingleUpdate($hash, "sendTeleState", $ret, 1);
-
+
Log3 ($name, 2, "$name - ERROR: $ret");
- }
+ }
else {
$ret = "Telegram message [$key] of transaction \"$tac\" sent to \"$peers\" by \"$telebot\" ";
readingsSingleUpdate($hash, "sendTeleState", $ret, 1);
-
+
Log3 ($name, 3, "$name - $ret");
}
}
-
+
$data{SSCam}{$name}{SENDCOUNT}{$tac} -= 1;
-
+
Log3 ($name, 1, "$name - Send Counter transaction \"$tac\": ".$data{SSCam}{$name}{SENDCOUNT}{$tac}) if(AttrVal($name,"debugactivetoken",0));
- }
+ }
else {
- # alle Serial Numbers "{$sn}" der Transaktion ermitteln
+ # alle Serial Numbers "{$sn}" der Transaktion ermitteln
if($data{SSCam}{$name}{PARAMS}{$tac}{sdat}) { # Images liegen in einem Hash (Ref in $sdat) base64-codiert vor
- extractTIDfromCache ( { name => $name,
- tac => $tac,
+ extractTIDfromCache ( { name => $name,
+ tac => $tac,
media => "SENDSNAPS",
mode => "serial",
aref => \@as
- }
+ }
);
- }
+ }
elsif($data{SSCam}{$name}{PARAMS}{$tac}{vdat}) { # Aufnahmen liegen in einem Hash-Ref in $vdat vor
- extractTIDfromCache ( { name => $name,
- tac => $tac,
+ extractTIDfromCache ( { name => $name,
+ tac => $tac,
media => "SENDRECS",
mode => "serial",
aref => \@as
- }
- );
+ }
+ );
}
-
+
@unique = sort{$b<=>$a} grep { !$seen{$_}++ } @as; # distinct / unique the keys
-
+
for my $key (@unique) {
($msg,$subject,$MediaStream,$fname) = __extractForTelegram($name,$key,$data{SSCam}{$name}{PARAMS}{$tac});
$ret = __TBotSendIt($defs{$telebot}, $name, $fname, $peers, $msg, $subject, $MediaStream, undef, $options);
-
+
if($ret) {
readingsSingleUpdate($hash, "sendTeleState", $ret, 1);
-
+
Log3 ($name, 2, "$name - ERROR: $ret");
- }
+ }
else {
$ret = "Telegram message [$key] of transaction \"$tac\" sent to \"$peers\" by \"$telebot\" ";
-
+
readingsSingleUpdate($hash, "sendTeleState", $ret, 1);
-
+
Log3 ($name, 3, "$name - $ret");
}
- }
-
+ }
+
$data{SSCam}{$name}{SENDCOUNT}{$tac} -= 1;
-
+
Log3 ($name, 1, "$name - Send Counter transaction \"$tac\": ".$data{SSCam}{$name}{SENDCOUNT}{$tac}) if(AttrVal($name,"debugactivetoken",0));
}
-
+
undef %teleparams;
undef %{$extparamref};
undef $msg;
-
+
return;
}
@@ -10319,48 +10334,48 @@ sub __extractForTelegram {
my $subject = $paref->{subject};
my $MediaStream = $paref->{MediaStream};
my $sdat = $paref->{sdat}; # Hash von Imagedaten base64 codiert
- my $vdat = $paref->{vdat}; # Hashref der Videodaten
+ my $vdat = $paref->{vdat}; # Hashref der Videodaten
my ($data,$fname,$ct,$img,$cache);
-
+
if($sdat) {
- $cache = cache($name, "c_init"); # Cache initialisieren
+ $cache = cache($name, "c_init"); # Cache initialisieren
if(!$cache || $cache eq "internal" ) {
$ct = $paref->{sdat}{$key}{createdTm};
$img = $paref->{sdat}{$key}{imageData};
$fname = trim ($paref->{sdat}{$key}{fileName});
- $data = MIME::Base64::decode_base64($img);
+ $data = MIME::Base64::decode_base64($img);
Log3($name, 4, "$name - Image data sequence [$key] decoded from internal Cache for TelegramBot prepare");
undef $img;
-
- }
+
+ }
else {
$ct = cache($name, "c_read", "$sdat"."{$key}{createdTm}");
$img = cache($name, "c_read", "$sdat"."{$key}{imageData}");
$fname = trim( cache($name, "c_read", "$sdat"."{$key}{fileName}") );
- $data = MIME::Base64::decode_base64($img);
- Log3($name, 4, "$name - Image data sequence [$key] decoded from CHI-Cache for TelegramBot prepare");
+ $data = MIME::Base64::decode_base64($img);
+ Log3($name, 4, "$name - Image data sequence [$key] decoded from CHI-Cache for TelegramBot prepare");
}
- }
-
+ }
+
if($vdat) {
- $cache = cache($name, "c_init"); # Cache initialisieren
+ $cache = cache($name, "c_init"); # Cache initialisieren
if(!$cache || $cache eq "internal" ) {
$ct = $paref->{vdat}{$key}{createdTm};
$data = $paref->{vdat}{$key}{imageData};
$fname = trim ($paref->{vdat}{$key}{fileName});
Log3($name, 4, "$name - Video data sequence [$key] got from internal Cache for TelegramBot prepare");
- }
+ }
else {
- $ct = cache($name, "c_read", "$vdat"."{$key}{createdTm}");
+ $ct = cache($name, "c_read", "$vdat"."{$key}{createdTm}");
$data = cache($name, "c_read", "$vdat"."{$key}{imageData}");
- $fname = trim( cache($name, "c_read", "$vdat"."{$key}{fileName}") );
- Log3($name, 4, "$name - Video data sequence [$key] got from CHI-Cache for TelegramBot prepare");
+ $fname = trim( cache($name, "c_read", "$vdat"."{$key}{fileName}") );
+ Log3($name, 4, "$name - Video data sequence [$key] got from CHI-Cache for TelegramBot prepare");
}
}
-
+
$subject =~ s/[\$#]FILE/$fname/gx;
$subject =~ s/[\$#]CTIME/$ct/gx;
-
+
return ($data,$subject,$MediaStream,$fname);
}
@@ -10376,13 +10391,13 @@ sub __TBotSendIt {
my $name = $hash->{NAME};
my $TBotHeader = "agent: TelegramBot/1.0\r\nUser-Agent: TelegramBot/1.0\r\nAccept: application/json\r\nAccept-Charset: utf-8";
my $TBotArgRetrycnt = 6;
-
+
$retryCount = 0 if (!defined($retryCount));
$options = "" if (!defined($options));
-
+
# increase retrycount for next try
$args[$TBotArgRetrycnt] = $retryCount+1;
-
+
Log3($camname, 5, "$camname - __TBotSendIt: called ");
# ignore all sends if disabled
@@ -10397,30 +10412,30 @@ sub __TBotSendIt {
TelegramBot_MsgForLog($msg, ($isMedia<0)).": - :".(defined($addPar)?$addPar:"").":");
push(@{$hash->{sentQueue}}, \@args);
return;
- }
-
+ }
+
my $ret;
$hash->{sentMsgResult} = "WAITING";
$hash->{sentMsgResult} .= " retry $retryCount" if ($retryCount>0);
$hash->{sentMsgId} = "";
my $peer;
- ($peer,$peers) = split(" ", $peers, 2);
-
- # handle addtl peers specified (will be queued since WAITING is set already)
+ ($peer,$peers) = split(" ", $peers, 2);
+
+ # handle addtl peers specified (will be queued since WAITING is set already)
if (defined( $peers )) {
# remove msgid from options and also replyid reset
my $sepoptions = $options;
$sepoptions =~ s/-msgid-//x;
__TBotSendIt($hash,$camname,$fname,$peers,$msg,$addPar,$isMedia,undef,$sepoptions);
}
-
+
Log3($camname, 5, "$camname - __TBotSendIt: try to send message to :$peer: -:".
TelegramBot_MsgForLog($msg, ($isMedia<0) ).": - add :".(defined($addPar)?$addPar:"").
": - replyid :".(defined($replyid)?$replyid:"").
":".": options :".$options.":");
- # trim and convert spaces in peer to underline
+ # trim and convert spaces in peer to underline
$peer = 0 if ( ! $peer );
my $peer2 = (!$peer)?$peer:TelegramBot_GetIdForPeer($hash, $peer);
@@ -10428,11 +10443,11 @@ sub __TBotSendIt {
$ret = "FAILED peer not found :$peer:";
$peer2 = "";
}
-
+
$hash->{sentMsgPeer} = TelegramBot_GetFullnameForContact($hash,$peer2);
$hash->{sentMsgPeerId} = $peer2;
$hash->{sentMsgOptions} = $options;
-
+
# init param hash
$hash->{HU_DO_PARAMS}->{hash} = $hash;
$hash->{HU_DO_PARAMS}->{header} = $TBotHeader;
@@ -10443,14 +10458,14 @@ sub __TBotSendIt {
my $timeout = AttrVal($name,'cmdTimeout',30);
$hash->{HU_DO_PARAMS}->{timeout} = $timeout;
$hash->{HU_DO_PARAMS}->{loglevel} = 4;
-
+
# Start Versand
if (!defined($ret)) {
# add chat / user id (no file) --> this will also do init
$ret = __TBotAddMultipart($hash, $fname, $hash->{HU_DO_PARAMS}, "chat_id", undef, $peer2, 0 ) if ( $peer );
-
+
if (abs($isMedia) == 1) {
- # Foto send
+ # Foto send
$hash->{sentMsgText} = "Image: ".TelegramBot_MsgForLog($msg,($isMedia<0)).((defined($addPar))?" - ".$addPar:"");
$hash->{HU_DO_PARAMS}->{url} = TelegramBot_getBaseURL($hash)."sendPhoto";
@@ -10462,15 +10477,15 @@ sub __TBotSendIt {
$ret = __TBotAddMultipart($hash, $fname, $hash->{HU_DO_PARAMS}, "caption", undef, $addPar, 0 ) if (!defined($ret));
$addPar = undef;
}
-
+
# add msg or file or stream
Log3($camname, 4, "$camname - __TBotSendIt: Filename for image file :".
TelegramBot_MsgForLog($msg, ($isMedia<0) ).":");
$ret = __TBotAddMultipart($hash, $fname, $hash->{HU_DO_PARAMS}, "photo", undef, $msg, $isMedia) if(!defined($ret));
-
- }
+
+ }
elsif ( abs($isMedia) == 30 ) {
- # Video send
+ # Video send
$hash->{sentMsgText} = "Image: ".TelegramBot_MsgForLog($msg,($isMedia<0)).((defined($addPar))?" - ".$addPar:"");
$hash->{HU_DO_PARAMS}->{url} = TelegramBot_getBaseURL($hash)."sendVideo";
@@ -10482,25 +10497,25 @@ sub __TBotSendIt {
$ret = __TBotAddMultipart($hash, $fname, $hash->{HU_DO_PARAMS}, "caption", undef, $addPar, 0) if(!defined($ret));
$addPar = undef;
}
-
+
# add msg or file or stream
Log3($camname, 4, "$camname - __TBotSendIt: Filename for image file :".$fname.":");
$ret = __TBotAddMultipart($hash, $fname, $hash->{HU_DO_PARAMS}, "video", undef, $msg, $isMedia) if(!defined($ret));
-
- }
+
+ }
else {
# nur Message senden
$msg = "No media File was created by SSCam. Can't send it.";
$hash->{HU_DO_PARAMS}->{url} = TelegramBot_getBaseURL($hash)."sendMessage";
-
+
my $parseMode = TelegramBot_AttrNum($name,"parseModeSend","0" );
-
+
if ($parseMode == 1) {
$parseMode = "Markdown";
- }
+ }
elsif ($parseMode == 2) {
$parseMode = "HTML";
- }
+ }
elsif ($parseMode == 3) {
$parseMode = 0;
if ($msg =~ /^markdown(.*)$/ix) {
@@ -10510,20 +10525,20 @@ sub __TBotSendIt {
$msg = $1;
$parseMode = "HTML";
}
- }
+ }
else {
$parseMode = 0;
}
-
+
Log3($camname, 4, "$camname - __TBotSendIt: parseMode $parseMode");
-
+
if (length($msg) > 1000) {
$hash->{sentMsgText} = substr($msg, 0, 1000)."...";
- }
+ }
else {
$hash->{sentMsgText} = $msg;
}
-
+
$msg =~ s/(?{HU_DO_PARAMS}, "parse_mode", undef, $parseMode, 0) if((!defined($ret)) && ($parseMode));
- # add disable_web_page_preview
- $ret = __TBotAddMultipart($hash, $fname, $hash->{HU_DO_PARAMS}, "disable_web_page_preview", undef, \1, 0)
- if ((!defined($ret))&&(!AttrVal($name,'webPagePreview',1)));
+ # add disable_web_page_preview
+ $ret = __TBotAddMultipart($hash, $fname, $hash->{HU_DO_PARAMS}, "disable_web_page_preview", undef, \1, 0)
+ if ((!defined($ret))&&(!AttrVal($name,'webPagePreview',1)));
}
if (defined($replyid)) {
@@ -10552,45 +10567,45 @@ sub __TBotSendIt {
$ret = __TBotAddMultipart($hash, $fname, $hash->{HU_DO_PARAMS}, "disable_notification", undef, "true", 0) if(!defined($ret));
}
- # finalize multipart
+ # finalize multipart
$ret = __TBotAddMultipart($hash, $fname, $hash->{HU_DO_PARAMS}, undef, undef, undef, 0) if(!defined($ret));
}
-
+
if (defined($ret)) {
Log3($camname, 3, "$camname - __TBotSendIt: Failed with :$ret:");
TelegramBot_Callback($hash->{HU_DO_PARAMS}, $ret, "");
- }
+ }
else {
$hash->{HU_DO_PARAMS}->{args} = \@args;
-
+
# if utf8 is set on string this will lead to length wrongly calculated in HTTPUtils (char instead of bytes) for some installations
if ((AttrVal($name,'utf8Special',0)) && (utf8::is_utf8($hash->{HU_DO_PARAMS}->{data}))) {
Log3 $camname, 4, "$camname - __TBotSendIt: utf8 encoding for data in message ";
- utf8::downgrade($hash->{HU_DO_PARAMS}->{data});
+ utf8::downgrade($hash->{HU_DO_PARAMS}->{data});
}
-
+
Log3($camname, 4, "$camname - __TBotSendIt: timeout for sent :".$hash->{HU_DO_PARAMS}->{timeout}.": ");
HttpUtils_NonblockingGet($hash->{HU_DO_PARAMS});
}
-
+
undef $msg;
-
+
return $ret;
}
####################################################################################################
# Telegram Media zusammenstellen
# Adaption der Sub "AddMultipart" aus TelegramBot
-#
+#
# Parameter:
# $hash = Hash des verwendeten TelegramBot-Devices !
# params = (hash for building up the data)
# paramname --> if not sepecifed / undef - multipart will be finished
# header for multipart
-# content
+# content
# isFile to specify if content is providing a file to be read as content
-#
+#
# returns string in case of error or undef
####################################################################################################
sub __TBotAddMultipart {
@@ -10598,7 +10613,7 @@ sub __TBotAddMultipart {
my $name = $hash->{NAME};
my $ret;
-
+
# Check if boundary is defined
if ( ! defined( $params->{boundary} ) ) {
$params->{boundary} = "TelegramBot_boundary-x0123";
@@ -10606,12 +10621,12 @@ sub __TBotAddMultipart {
$params->{method} = "POST";
$params->{data} = "";
}
-
+
# ensure parheader is defined and add final header new lines
$parheader = "" if (!defined($parheader));
$parheader .= "\r\n" if ((length($parheader) > 0) && ($parheader !~ /\r\n$/x));
- # add content
+ # add content
my $finalcontent;
if (defined($parname)) {
$params->{data} .= "--".$params->{boundary}."\r\n";
@@ -10623,32 +10638,32 @@ sub __TBotAddMultipart {
$parheader = "Content-Disposition: form-data; name=\"".$parname."\"; filename=\"".$baseFilename."\"\r\n".$parheader."\r\n";
return("FAILED file :$parcontent: not found or empty" ) if(! -e $parcontent) ;
-
+
my $size = -s $parcontent;
my $limit = AttrVal($name,'maxFileSize',10485760);
return("FAILED file :$parcontent: is too large for transfer (current limit: ".$limit."B)") if($size > $limit) ;
-
+
$finalcontent = TelegramBot_BinaryFileRead($hash, $parcontent);
if ($finalcontent eq "") {
return("FAILED file :$parcontent: not found or empty");
}
-
+
} elsif ($isMedia < 0) {
my ($im, $ext) = __TBotIdentifyStream($hash, $parcontent);
$fname =~ s/.mp4$/.$ext/x;
$parheader = "Content-Disposition: form-data; name=\"".$parname."\"; filename=\"".$fname."\"\r\n".$parheader."\r\n";
$finalcontent = $parcontent;
- }
+ }
else {
$parheader = "Content-Disposition: form-data; name=\"".$parname."\"\r\n".$parheader."\r\n";
$finalcontent = $parcontent;
}
-
+
$params->{data} .= $parheader.$finalcontent."\r\n";
- }
+ }
else {
return( "No content defined for multipart" ) if ( length( $params->{data} ) == 0 );
- $params->{data} .= "--".$params->{boundary}."--";
+ $params->{data} .= "--".$params->{boundary}."--";
}
return;
@@ -10667,7 +10682,7 @@ sub __TBotIdentifyStream {
# Video Signatur aus: https://www.garykessler.net/library/file_sigs.html
return (-1,"png") if ( $msg =~ /^\x89PNG\r\n\x1a\n/x ); # PNG
return (-1,"jpg") if ( $msg =~ /^\xFF\xD8\xFF/x ); # JPG not necessarily complete, but should be fine here
- return (-30,"mpg") if ( $msg =~ /^....\x66\x74\x79\x70\x69\x73\x6f\x6d/x ); # mp4
+ return (-30,"mpg") if ( $msg =~ /^....\x66\x74\x79\x70\x69\x73\x6f\x6d/x ); # mp4
return (0,undef);
}
@@ -10675,64 +10690,64 @@ return (0,undef);
###############################################################################
# Vorbereitung Versand Mail Nachrichten
###############################################################################
-sub _prepSendMail {
+sub _prepSendMail {
my $paref = shift;
-
+
my $hash = $paref->{hash};
my $calias = $paref->{calias};
my $mt = $paref->{mt};
my $date = $paref->{date};
my $time = $paref->{time};
-
- my $name = $hash->{NAME};
-
- $mt =~ s/['"]//gx;
-
+
+ my $name = $hash->{NAME};
+
+ $mt =~ s/['"]//gx;
+
my ($subj,$body) = split ",", $mt, 2;
my $subjt = (split "=>", $subj)[1];
my $bodyt = (split "=>", $body)[1];
-
+
$subjt = trim($subjt);
$subjt =~ s/[\$#]CAM/$calias/gx;
$subjt =~ s/[\$#]DATE/$date/gx;
$subjt =~ s/[\$#]TIME/$time/gx;
-
+
$bodyt = trim($bodyt);
$bodyt =~ s/[\$#]CAM/$calias/gx;
$bodyt =~ s/[\$#]DATE/$date/gx;
$bodyt =~ s/[\$#]TIME/$time/gx;
-
+
my %smtpmsg = ();
$smtpmsg{subject} = "$subjt";
$smtpmsg{body} = "$bodyt";
-
+
return \%smtpmsg;
}
#############################################################################################
# SMTP EMail-Versand
#############################################################################################
-sub _sendEmail {
+sub _sendEmail {
my ($hash, $extparamref) = @_;
my $name = $hash->{NAME};
my $timeout = 60;
my $ret;
-
- Log3($name, 4, "$name - ####################################################");
- Log3($name, 4, "$name - ### start send snapshot or recording by email ");
+
Log3($name, 4, "$name - ####################################################");
-
- my $m1 = "Net::SMTP";
- my $m2 = "MIME::Lite";
+ Log3($name, 4, "$name - ### start send snapshot or recording by email ");
+ Log3($name, 4, "$name - ####################################################");
+
+ my $m1 = "Net::SMTP";
+ my $m2 = "MIME::Lite";
my $m3 = "Net::SMTP::SSL";
my $sslfb = 0; # Flag für Verwendung altes Net::SMTP::SSL
-
+
my ($vm1,$vm2,$vm3);
- eval { require Net::SMTP; ## no critic 'eval not tested'
- Net::SMTP->import;
+ eval { require Net::SMTP; ## no critic 'eval not tested'
+ Net::SMTP->import;
$vm1 = $Net::SMTP::VERSION;
-
- # Version von Net::SMTP prüfen, wenn < 3.00 dann Net::SMTP::SSL verwenden
+
+ # Version von Net::SMTP prüfen, wenn < 3.00 dann Net::SMTP::SSL verwenden
# (libnet-3.06 hat SSL inkludiert)
my $sv = $vm1;
$sv =~ s/[^0-9.].*$//x;
@@ -10742,30 +10757,30 @@ sub _sendEmail {
$vm3 = $Net::SMTP::SSL::VERSION;
$sslfb = 1;
}
-
- require MIME::Lite;
- MIME::Lite->import;
+
+ require MIME::Lite;
+ MIME::Lite->import;
$vm2 = $MIME::Lite::VERSION;
};
-
+
if(!$vm1 || !$vm2 || ($sslfb && !$vm3)) {
my $nl = !$vm2?$m2." ":"";
$nl .= !$vm1?$m1." ":"";
$nl .= ($sslfb && !$vm3)?$m3:"";
$ret = "required module for sending Email couldn't be loaded. You have to install: $nl";
Log3($name, 1, "$name - $ret");
-
+
readingsBeginUpdate($hash);
readingsBulkUpdate ($hash,"sendEmailState",$ret);
readingsEndUpdate ($hash, 1);
-
+
return $ret;
}
-
+
Log3 ($name, 4, "$name - version of loaded module \"$m1\" is \"$vm1\"");
Log3 ($name, 4, "$name - version of \"$m1\" is too old. Use SSL-fallback module \"$m3\" with version \"$vm3\"") if($sslfb && $vm3);
Log3 ($name, 4, "$name - version of loaded module \"$m2\" is \"$vm2\"");
-
+
my %mailparams = (
'smtpFrom' => {'attr'=>'smtpFrom', 'default'=>'', 'required'=>1, 'set'=>1},
'smtpTo' => {'attr'=>'smtpTo', 'default'=>'', 'required'=>1, 'set'=>1},
@@ -10784,57 +10799,57 @@ sub _sendEmail {
'fname' => { 'default'=>'image.jpg', 'required'=>0, 'set'=>1}, # Filename für "image"
'lsnaptime' => { 'default'=>'', 'required'=>0, 'set'=>1}, # Zeitstempel der Bilddaten
'opmode' => { 'default'=>'', 'required'=>1, 'set'=>1}, # OpMode muss gesetzt sein
- 'sslfb' => { 'default'=>$sslfb, 'required'=>0, 'set'=>1}, # Flag für Verwendung altes Net::SMTP::SSL
- 'sslfrominit' => { 'default'=>'', 'required'=>0, 'set'=>1}, # SSL soll sofort ! aufgebaut werden
+ 'sslfb' => { 'default'=>$sslfb, 'required'=>0, 'set'=>1}, # Flag für Verwendung altes Net::SMTP::SSL
+ 'sslfrominit' => { 'default'=>'', 'required'=>0, 'set'=>1}, # SSL soll sofort ! aufgebaut werden
'tac' => { 'default'=>'', 'required'=>0, 'set'=>1}, # übermittelter Transaktionscode der ausgewerteten Transaktion
'vdat' => { 'default'=>'', 'required'=>0, 'set'=>1}, # Videodaten, wenn gesetzt muss 'part2type' auf 'video/mpeg' gesetzt sein
- );
-
+ );
+
my $tac = $extparamref->{tac};
-
+
for my $key (keys %mailparams) {
- $data{SSCam}{$name}{PARAMS}{$tac}{$key} = AttrVal($name, $mailparams{$key}->{attr}, $mailparams{$key}->{default})
- if(exists $mailparams{$key}->{attr});
- if($mailparams{$key}->{set}) {
- $data{SSCam}{$name}{PARAMS}{$tac}{$key} = $mailparams{$key}->{default} if (!$extparamref->{$key} && !$mailparams{$key}->{attr});
+ $data{SSCam}{$name}{PARAMS}{$tac}{$key} = AttrVal($name, $mailparams{$key}->{attr}, $mailparams{$key}->{default})
+ if(exists $mailparams{$key}->{attr});
+ if($mailparams{$key}->{set}) {
+ $data{SSCam}{$name}{PARAMS}{$tac}{$key} = $mailparams{$key}->{default} if (!$extparamref->{$key} && !$mailparams{$key}->{attr});
$data{SSCam}{$name}{PARAMS}{$tac}{$key} = delete $extparamref->{$key} if (exists $extparamref->{$key});
}
-
- Log3 ($name, 4, "$name - param $key is now \"".$data{SSCam}{$name}{PARAMS}{$tac}{$key}."\" ") if($key !~ /sdat/x);
- Log3 ($name, 4, "$name - param $key is set") if($key =~ /sdat/x && $data{SSCam}{$name}{PARAMS}{$tac}{$key} ne '');
+
+ Log3 ($name, 4, "$name - param $key is now >".$data{SSCam}{$name}{PARAMS}{$tac}{$key}."< ") if($key !~ /sdat/x);
+ Log3 ($name, 4, "$name - param $key is set") if($key =~ /sdat/x && $data{SSCam}{$name}{PARAMS}{$tac}{$key} ne '');
}
-
+
$data{SSCam}{$name}{PARAMS}{$tac}{name} = $name;
-
+
my @err = ();
for my $key (keys(%mailparams)) {
push(@err, $key) if ($mailparams{$key}->{required} && !$data{SSCam}{$name}{PARAMS}{$tac}{$key});
}
-
+
if ($#err >= 0) {
$ret = "Missing at least one required parameter or attribute: ".join(', ',@err);
Log3($name, 2, "$name - $ret");
-
+
readingsBeginUpdate($hash);
readingsBulkUpdate ($hash,"sendEmailState",$ret);
readingsEndUpdate ($hash, 1);
-
+
return $ret;
}
-
+
$hash->{HELPER}{RUNNING_PID} = BlockingCall("FHEM::SSCam::__sendEmailblocking", $data{SSCam}{$name}{PARAMS}{$tac}, "FHEM::SSCam::__sendEmaildone", $timeout, "FHEM::SSCam::__sendEmailto", $hash);
$hash->{HELPER}{RUNNING_PID}{loglevel} = 5 if($hash->{HELPER}{RUNNING_PID}); # Forum #77057
-
+
undef %mailparams;
undef %$extparamref;
-
+
return;
}
####################################################################################################
# nichtblockierendes Send EMail
####################################################################################################
-sub __sendEmailblocking { ## no critic 'not used'
+sub __sendEmailblocking { ## no critic 'not used'
my ($paref) = @_; # der Referent wird in cleanData gelöscht
my $name = delete $paref->{name};
my $cc = delete $paref->{smtpCc};
@@ -10848,8 +10863,8 @@ sub __sendEmailblocking { ##
my $smtpnousessl = delete $paref->{smtpnousessl}; # SSL Verschlüsselung soll NICHT genutzt werden
my $subject = delete $paref->{subject};
my $to = delete $paref->{smtpTo};
- my $msgtext = delete $paref->{msgtext};
- my $smtpdebug = delete $paref->{smtpdebug};
+ my $msgtext = delete $paref->{msgtext};
+ my $smtpdebug = delete $paref->{smtpdebug};
my $sdat = delete $paref->{sdat}; # Hash von Imagedaten base64 codiert
my $image = delete $paref->{image}; # Image, wenn gesetzt muss 'part2type' auf 'image/jpeg' gesetzt sein
my $fname = delete $paref->{fname}; # Filename -> verwendet wenn $image ist gesetzt
@@ -10859,32 +10874,32 @@ sub __sendEmailblocking { ##
my $sslfrominit = delete $paref->{sslfrominit}; # SSL soll sofort ! aufgebaut werden
my $tac = delete $paref->{tac}; # übermittelter Transaktionscode der ausgewerteten Transaktion
my $vdat = delete $paref->{vdat}; # Videodaten, wenn gesetzt muss 'part2type' auf 'video/mpeg' gesetzt sein
-
+
my $hash = $defs{$name};
my $sslver = "";
my ($err,$smtp,@as,$cache);
-
+
# Credentials abrufen
my ($success, $username, $password) = getCredentials($hash,0,"SMTPcredentials");
-
+
unless ($success) {
$err = "SMTP credentials couldn't be retrieved successfully - make sure you've set it with \"set $name smtpcredentials \"";
Log3($name, 2, "$name - $err");
$err = encode_base64($err,"");
return "$name|$err|''";
- }
-
+ }
+
$subject = decode_utf8($subject);
-
+
my $mailmsg = MIME::Lite->new(
From => $from,
To => $to,
Subject => $subject,
Type => 'multipart/mixed', #'multipart/mixed', # was 'text/plain'
);
-
+
$part1txt = decode_utf8($part1txt);
-
+
### Add image, Das Image liegt bereits als File vor
####################################################
if($image) {
@@ -10895,25 +10910,25 @@ sub __sendEmailblocking { ##
Disposition => 'attachment',
);
}
-
+
if($sdat) {
### Images liegen in einem Hash (Ref in $sdat) base64-codiert vor
my ($ct,$img,$decoded);
- $cache = cache($name, "c_init"); # Cache initialisieren
+ $cache = cache($name, "c_init"); # Cache initialisieren
if(!$cache || $cache eq "internal" ) {
@as = sort{$a<=>$b}keys%{$sdat};
for my $key (@as) {
$ct = delete $sdat->{$key}{createdTm};
$img = delete $sdat->{$key}{imageData};
$fname = delete $sdat->{$key}{fileName};
- $decoded = MIME::Base64::decode_base64($img);
+ $decoded = MIME::Base64::decode_base64($img);
$mailmsg->attach(
Type => $part2type,
Data => $decoded,
Filename => $fname,
Disposition => 'attachment',
);
-
+
my $params = {
hash => $hash,
name => $name,
@@ -10921,41 +10936,41 @@ sub __sendEmailblocking { ##
fname => $fname,
ct => $ct
};
-
+
$part1txt = __extractForEmail ($params);
-
- Log3($name, 4, "$name - Image data sequence [$key] decoded from internal Cache for Email attachment") if($decoded);
+
+ Log3($name, 4, "$name - Image data sequence [$key] decoded from internal Cache for Email attachment") if($decoded);
}
-
- BlockingInformParent("FHEM::SSCam::subaddFromBlocking", [$name, "-", $tac], 0);
- }
+
+ BlockingInformParent("FHEM::SSCam::subaddFromBlocking", [$name, "-", $tac], 0);
+ }
else {
- # alle Serial Numbers "{$sn}" der Transaktion ermitteln
- extractTIDfromCache ( { name => $name,
- tac => $tac,
+ # alle Serial Numbers "{$sn}" der Transaktion ermitteln
+ extractTIDfromCache ( { name => $name,
+ tac => $tac,
media => "SENDSNAPS|RS",
mode => "serial",
aref => \@as
- }
- );
+ }
+ );
my %seen;
my @unique = sort{$a<=>$b} grep { !$seen{$_}++ } @as; # distinct / unique the keys
for my $key (@unique) { # attach mail
- next if(!cache($name, "c_isvalidkey", "$sdat"."{$key}{imageData}"));
-
+ next if(!cache($name, "c_isvalidkey", "$sdat"."{$key}{imageData}"));
+
$ct = cache($name, "c_read", "$sdat"."{$key}{createdTm}");
$img = cache($name, "c_read", "$sdat"."{$key}{imageData}");
$fname = cache($name, "c_read", "$sdat"."{$key}{fileName}");
- $decoded = MIME::Base64::decode_base64($img);
-
+ $decoded = MIME::Base64::decode_base64($img);
+
$mailmsg->attach(
Type => $part2type,
Data => $decoded,
Filename => $fname,
Disposition => 'attachment',
);
-
+
my $params = {
hash => $hash,
name => $name,
@@ -10963,33 +10978,33 @@ sub __sendEmailblocking { ##
fname => $fname,
ct => $ct
};
-
+
$part1txt = __extractForEmail ($params);
-
- Log3($name, 4, "$name - Image data sequence [$key] decoded from CHI-Cache for Email attachment");
+
+ Log3($name, 4, "$name - Image data sequence [$key] decoded from CHI-Cache for Email attachment");
}
-
+
BlockingInformParent("FHEM::SSCam::subaddFromBlocking", [$name, "-", $tac], 0);
}
}
-
+
if($vdat) { # Videodaten (mp4) wurden geliefert
my ($ct,$video);
- $cache = cache($name, "c_init"); # Cache initialisieren
+ $cache = cache($name, "c_init"); # Cache initialisieren
if(!$cache || $cache eq "internal" ) {
@as = sort{$a<=>$b}keys%{$vdat};
for my $key (@as) {
$ct = delete $vdat->{$key}{createdTm};
$video = delete $vdat->{$key}{imageData};
$fname = delete $vdat->{$key}{fileName};
-
+
$mailmsg->attach(
Type => $part2type,
Data => $video,
Filename => $fname,
Disposition => 'attachment',
);
-
+
my $params = {
hash => $hash,
name => $name,
@@ -10997,41 +11012,41 @@ sub __sendEmailblocking { ##
fname => $fname,
ct => $ct
};
-
+
$part1txt = __extractForEmail ($params);
-
- Log3($name, 4, "$name - Video data sequence [$key] decoded from internal Cache for Email attachment");
- }
-
- BlockingInformParent("FHEM::SSCam::subaddFromBlocking", [$name, "-", $tac], 0);
- }
+
+ Log3($name, 4, "$name - Video data sequence [$key] decoded from internal Cache for Email attachment");
+ }
+
+ BlockingInformParent("FHEM::SSCam::subaddFromBlocking", [$name, "-", $tac], 0);
+ }
else {
# alle Serial Numbers "{$sn}" der Transaktion ermitteln
- extractTIDfromCache ( { name => $name,
- tac => $tac,
+ extractTIDfromCache ( { name => $name,
+ tac => $tac,
media => "SENDRECS",
mode => "serial",
aref => \@as
- }
- );
- my %seen;
+ }
+ );
+ my %seen;
my @unique = sort{$a<=>$b} grep { !$seen{$_}++ } @as; # distinct / unique the keys
-
+
# attach mail
for my $key (@unique) {
- next if(!cache($name, "c_isvalidkey", "$vdat"."{$key}{imageData}"));
-
+ next if(!cache($name, "c_isvalidkey", "$vdat"."{$key}{imageData}"));
+
$ct = cache($name, "c_read", "$vdat"."{$key}{createdTm}");
- $video = cache($name, "c_read", "$vdat"."{$key}{imageData}");
- $fname = cache($name, "c_read", "$vdat"."{$key}{fileName}");
-
+ $video = cache($name, "c_read", "$vdat"."{$key}{imageData}");
+ $fname = cache($name, "c_read", "$vdat"."{$key}{fileName}");
+
$mailmsg->attach(
Type => $part2type,
Data => $video,
Filename => $fname,
Disposition => 'attachment',
);
-
+
my $params = {
hash => $hash,
name => $name,
@@ -11039,23 +11054,23 @@ sub __sendEmailblocking { ##
fname => $fname,
ct => $ct
};
-
+
$part1txt = __extractForEmail ($params);
-
- Log3($name, 4, "$name - Video data sequence [$key] decoded from CHI-Cache for Email attachment");
+
+ Log3($name, 4, "$name - Video data sequence [$key] decoded from CHI-Cache for Email attachment");
}
-
- BlockingInformParent("FHEM::SSCam::subaddFromBlocking", [$name, "-", $tac], 0);
+
+ BlockingInformParent("FHEM::SSCam::subaddFromBlocking", [$name, "-", $tac], 0);
}
}
-
+
### Add the text message part (Note that "attach" has same arguments as "new")
###############################################################################
$mailmsg->attach(
Type => $part1type,
Data => $part1txt,
);
-
+
$mailmsg->attr('content-type.charset' => 'UTF-8');
##### SMTP-Connection #####
@@ -11064,114 +11079,114 @@ sub __sendEmailblocking { ##
# Verwendung altes Net::SMTP::SSL <= 3.00 -> immer direkter SSL-Aufbau, Attribut "smtpNoUseSSL" wird ignoriert
Log3($name, 3, "$name - Attribute \"smtpNoUseSSL\" will be ignored due to usage of Net::SMTP::SSL") if(AttrVal($name,"smtpNoUseSSL",0));
$smtp = Net::SMTP::SSL->new(Host => $smtphost, Port => $smtpsslport, Debug => $smtpdebug);
- }
+ }
else {
# Verwendung neues Net::SMTP::SSL > 3.00
if($sslfrominit) { # sofortiger SSL connect
$smtp = Net::SMTP->new(Host => $smtphost, Port => $smtpsslport, SSL => 1, Debug => $smtpdebug);
- }
+ }
else { # erst unverschlüsselt, danach switch zu encrypted
$smtp = Net::SMTP->new(Host => $smtphost, Port => $smtpport, SSL => 0, Debug => $smtpdebug);
}
}
-
+
if(!$smtp) {
$err = "SMTP Error: Can't connect to host $smtphost";
Log3($name, 2, "$name - $err");
$err = encode_base64($err,"");
- return "$name|$err|''";
+ return "$name|$err|''";
}
-
- if(!$sslfb && !$sslfrominit) { # Aufbau unverschlüsselt -> switch zu verschlüsselt wenn nicht untersagt
- if($smtp->can_ssl() && !$smtpnousessl) {
- unless( $smtp->starttls ( SSL_verify_mode => 0,
- SSL_version => "TLSv1_2:!TLSv1_1:!SSLv3:!SSLv23:!SSLv2",
+
+ if(!$sslfb && !$sslfrominit) { # Aufbau unverschlüsselt -> switch zu verschlüsselt wenn nicht untersagt
+ if($smtp->can_ssl() && !$smtpnousessl) {
+ unless( $smtp->starttls ( SSL_verify_mode => 0,
+ SSL_version => "TLSv1_2:!TLSv1_1:!SSLv3:!SSLv23:!SSLv2",
) ) {
$err = "SMTP Error while switch to SSL: ".$smtp->message();
Log3($name, 2, "$name - $err");
$err = encode_base64($err,"");
- return "$name|$err|''";
- }
-
+ return "$name|$err|''";
+ }
+
$sslver = $smtp->get_sslversion();
Log3($name, 3, "$name - SMTP-Host $smtphost switched to encrypted connection with SSL version: $sslver");
- }
+ }
else {
Log3($name, 3, "$name - SMTP-Host $smtphost use unencrypted connection !");
}
- }
+ }
else {
eval { $sslver = $smtp->get_sslversion(); }; ## no critic 'eval not tested' # Forum: https://forum.fhem.de/index.php/topic,45671.msg880602.html#msg880602
$sslver = $sslver ? $sslver : "n.a.";
- Log3($name, 3, "$name - SMTP-Host $smtphost use immediately encrypted connection with SSL version: $sslver");
+ Log3($name, 3, "$name - SMTP-Host $smtphost use immediately encrypted connection with SSL version: $sslver");
}
unless( $smtp->auth($username, $password) ) {
$err = "SMTP Error authentication: ".$smtp->message();
Log3($name, 2, "$name - $err");
$err = encode_base64($err,"");
- return "$name|$err|''";
+ return "$name|$err|''";
}
-
+
unless( $smtp->mail($from) ) {
$err = "SMTP Error setting sender: ".$smtp->message();
Log3($name, 2, "$name - $err");
$err = encode_base64($err,"");
- return "$name|$err|''";
+ return "$name|$err|''";
}
-
+
my @r = split(",", $to);
unless( $smtp->to(@r) ) {
$err = "SMTP Error setting receiver: ".$smtp->message();
Log3($name, 2, "$name - $err");
$err = encode_base64($err,"");
- return "$name|$err|''";
+ return "$name|$err|''";
}
-
+
if ($cc) {
my @c = split(",", $cc);
unless( $smtp->cc(@c) ) {
$err = "SMTP Error setting carbon-copy $cc: ".$smtp->message();
Log3($name, 2, "$name - $err");
$err = encode_base64($err,"");
- return "$name|$err|''";
+ return "$name|$err|''";
}
}
-
+
unless( $smtp->data() ) {
$err = "SMTP Error setting data: ".$smtp->message();
Log3($name, 2, "$name - $err");
$err = encode_base64($err,"");
- return "$name|$err|''";
+ return "$name|$err|''";
}
-
+
unless( $smtp->datasend(encode('utf8',$mailmsg->as_string)) ) {
$err = "SMTP Error sending email: ".$smtp->message();
Log3($name, 2, "$name - $err");
$err = encode_base64($err,"");
- return "$name|$err|''";
+ return "$name|$err|''";
}
-
+
unless( $smtp->dataend() ) {
$err = "SMTP Error ending transaction: ".$smtp->message();
Log3($name, 2, "$name - $err");
$err = encode_base64($err,"");
- return "$name|$err|''";
- }
-
+ return "$name|$err|''";
+ }
+
unless( $smtp->quit() ) {
$err = "SMTP Error saying good-bye: ".$smtp->message();
Log3($name, 2, "$name - $err");
$err = encode_base64($err,"");
- return "$name|$err|''";
- }
-
- my $ret = "Email transaction \"$tac\" successfully sent ".( $sslver?"encoded by $sslver":"" );
+ return "$name|$err|''";
+ }
+
+ my $ret = "Email transaction \"$tac\" successfully sent ".( $sslver?"encoded by $sslver":"" );
Log3($name, 3, "$name - $ret To: $to".(($cc)?", CC: $cc":"") );
-
+
# Daten müssen als Einzeiler zurückgegeben werden
$ret = encode_base64($ret,"");
-
+
return "$name|''|$ret";
}
@@ -11183,10 +11198,10 @@ sub __extractForEmail {
my $txt = $paref->{txt} // qq{};
my $fname = $paref->{fname} // qq{};
my $ct = $paref->{ct} // qq{};
-
+
$txt =~ s/[\$#]FILE/$fname/gx;
$txt =~ s/[\$#]CTIME/$ct/gx;
-
+
return $txt;
}
@@ -11200,39 +11215,39 @@ sub __sendEmaildone { ##
my $hash = $defs{$a[0]};
my $err = $a[1] ? trim(decode_base64($a[1])) : undef;
my $ret = $a[2] ? trim(decode_base64($a[2])) : undef;
-
+
if ($err) {
readingsBeginUpdate($hash);
readingsBulkUpdate ($hash,"sendEmailState",$err);
readingsEndUpdate ($hash, 1);
-
+
delete($hash->{HELPER}{RUNNING_PID});
return;
- }
-
+ }
+
readingsBeginUpdate($hash);
readingsBulkUpdate ($hash,"sendEmailState",$ret);
readingsEndUpdate ($hash, 1);
-
+
delete($hash->{HELPER}{RUNNING_PID});
-
+
return;
}
####################################################################################################
# Abbruchroutine Send EMail
####################################################################################################
-sub __sendEmailto { ## no critic 'not used'
+sub __sendEmailto { ## no critic 'not used'
my ($hash,$cause) = @_;
- my $name = $hash->{NAME};
-
+ my $name = $hash->{NAME};
+
$cause = $cause // "Timeout: process terminated";
- Log3 ($name, 1, "$name -> BlockingCall $hash->{HELPER}{RUNNING_PID}{fn} pid:$hash->{HELPER}{RUNNING_PID}{pid} $cause");
-
+ Log3 ($name, 1, "$name -> BlockingCall $hash->{HELPER}{RUNNING_PID}{fn} pid:$hash->{HELPER}{RUNNING_PID}{pid} $cause");
+
readingsBeginUpdate ($hash);
readingsBulkUpdateIfChanged ($hash,"sendEmailState",$cause);
readingsEndUpdate ($hash, 1);
-
+
delete($hash->{HELPER}{RUNNING_PID});
return;
@@ -11240,81 +11255,81 @@ return;
#################################################################################################
# Modi:
-# 1. serial - extrahiere Serial Nummer (der Medien) aus Cache für Versand
+# 1. serial - extrahiere Serial Nummer (der Medien) aus Cache für Versand
# Schnappschüsse / Ausfnahmen + optionalen Vergleich mit laufender Transaktion
# 2. readkeys - liest alle Schlüssel aus gegebenen Cache aus
#
# Muster Schnappschüsse: {SENDSNAPS}{2222}{0}{imageData}
# Muster Aufnahmen: {SENDRECS}{305}{0}{imageData}
-# Muster multiple: {SENDSNAPS|RS}{2222|multiple_snapsend}{0|1572995404.125580}{imageData}
+# Muster multiple: {SENDSNAPS|RS}{2222|multiple_snapsend}{0|1572995404.125580}{imageData}
#################################################################################################
-sub extractTIDfromCache {
+sub extractTIDfromCache {
my $params = shift;
my $name = $params->{name};
my $tac = $params->{tac};
my $media = $params->{media};
my $mode = $params->{mode};
my $aref = $params->{aref};
-
+
if($mode eq "serial") { # Serial Nummern auslesen
- for my $ck (cache($name, "c_getkeys")) {
+ for my $ck (cache($name, "c_getkeys")) {
next if $ck !~ /\{$media\}\{.*?\}\{.*?\}\{.*?\}/x;
my ($k1,$k2,$k3) = $ck =~ /\{($media)\}\{(.*?)\}\{(.*?)\}\{.*?\}/x;
if($tac) {
next if "$k2" ne "$tac";
}
- push @$aref,$k3 if($k3 =~ /^(\d+|\d+.\d+)$/x); # Serial Nummer in übergebenes Array eintragen
+ push @$aref,$k3 if($k3 =~ /^(\d+|\d+.\d+)$/x); # Serial Nummer in übergebenes Array eintragen
}
}
-
- if($mode eq "readkeys") { # liest alle Schlüssel aus gegebenen Cache aus
- for my $ck (cache($name, "c_getkeys")) {
+
+ if($mode eq "readkeys") { # liest alle Schlüssel aus gegebenen Cache aus
+ for my $ck (cache($name, "c_getkeys")) {
next if $ck !~ /\{$media\}\{\d+?\}\{.*?\}/x;
my ($k1) = $ck =~ /\{$media\}\{(\d+?)\}\{.*?\}/x;
push @$aref,$k1 if($k1 =~ /^\d+$/x);
}
}
-
+
return;
}
#############################################################################################
# Transaktion starten oder vorhandenen TA Code zurück liefern
#############################################################################################
-sub openOrgetTrans {
+sub openOrgetTrans {
my $hash = shift;
my $name = $hash->{NAME};
- my $tac = "";
-
- if(!$hash->{HELPER}{TRANSACTION}) {
+ my $tac = "";
+
+ if(!$hash->{HELPER}{TRANSACTION}) {
$tac = int(rand(4500)); # Transaktionscode erzeugen und speichern
$hash->{HELPER}{TRANSACTION} = $tac;
if (AttrVal($name,"debugactivetoken",0)) {
Log3($name, 1, "$name - Transaction opened, TA-code: $tac");
- }
- }
+ }
+ }
else {
$tac = $hash->{HELPER}{TRANSACTION}; # vorhandenen Transaktionscode zurück liefern
}
-
+
return $tac;
}
#############################################################################################
# Transaktion freigeben
#############################################################################################
-sub closeTrans {
+sub closeTrans {
my $hash = shift;
my $name = $hash->{NAME};
-
+
my $tac = delete $hash->{HELPER}{TRANSACTION}; # diese Transaktion beenden
$tac = $tac // q{};
-
- return if(!$tac);
+
+ return if(!$tac);
cleanData("$name:$tac"); # %data Hash & Cache bereinigen
-
+
Log3($name, 1, "$name - Transaction \"$tac\" closed") if(AttrVal($name,"debugactivetoken",0));
-
+
return;
}
@@ -11326,14 +11341,14 @@ sub cleanData {
my ($name,$tac) = split(":",$str);
my $hash = $defs{$name};
my $del = 0;
-
- RemoveInternalTimer($hash, "FHEM::SSCam::cleanData");
-
+
+ RemoveInternalTimer($hash, "FHEM::SSCam::cleanData");
+
if($data{SSCam}{$name}{SENDCOUNT}{$tac} && $data{SSCam}{$name}{SENDCOUNT}{$tac} > 0) { # Cacheinhalt erst löschen wenn Sendezähler 0
InternalTimer(gettimeofday()+1, "FHEM::SSCam::cleanData", "$name:$tac", 0);
return;
- }
-
+ }
+
if(AttrVal($name, "cacheType", "internal") eq "internal") { # internes Caching
if($tac) {
if($data{SSCam}{RS}{$tac}) {
@@ -11355,7 +11370,7 @@ sub cleanData {
if ($del && AttrVal($name,"debugactivetoken",0)) {
Log3($name, 1, "$name - Data of Transaction \"$tac\" deleted");
}
- }
+ }
else {
delete $data{SSCam}{RS};
delete $data{SSCam}{$name}{SENDRECS};
@@ -11363,9 +11378,9 @@ sub cleanData {
delete $data{SSCam}{$name}{PARAMS};
if (AttrVal($name,"debugactivetoken",0)) {
Log3($name, 1, "$name - Data of internal Cache removed");
- }
+ }
}
- }
+ }
else { # Caching mit CHI
my @as = cache($name, "c_getkeys");
if($tac) {
@@ -11378,13 +11393,13 @@ sub cleanData {
if ($del && AttrVal($name,"debugactivetoken",0)) {
Log3($name, 1, "$name - Data of Transaction \"$tac\" removed");
}
-
- }
+
+ }
else {
cache($name, "c_clear");
if (AttrVal($name,"debugactivetoken",0)) {
Log3($name, 1, "$name - Data of CHI-Cache removed");
- }
+ }
}
}
@@ -11398,15 +11413,15 @@ return;
sub subaddFromBlocking {
my ($name,$op,$tac) = @_;
my $hash = $defs{$name};
-
+
if($op eq "-") {
$data{SSCam}{$name}{SENDCOUNT}{$tac}--;
}
-
+
if($op eq "+") {
$data{SSCam}{$name}{SENDCOUNT}{$tac}++;
}
-
+
Log3($name, 1, "$name - Send Counter transaction \"$tac\": ".$data{SSCam}{$name}{SENDCOUNT}{$tac}) if(AttrVal($name,"debugactivetoken",0));
return;
@@ -11418,17 +11433,17 @@ return;
sub checkIconpath {
my $name = shift;
my $FW_wname = shift // return;
-
+
my $icpa = AttrVal($FW_wname, "iconPath", "");
if ($icpa !~ /sscam/x) {
Log3 ($name, 2, qq{$name - WARNING - add "sscam" to attribute "iconpath" of FHEMWEB device "$FW_wname" to get the SSCam control icons} );
}
-
+
return;
}
#############################################################################################
-# Cache Handling
+# Cache Handling
# cache ($name, [, , ])
# return 1 = ok , return 0 = nok
#############################################################################################
@@ -11440,17 +11455,17 @@ sub cache {
my $path = $attr{global}{modpath}."/FHEM/FhemUtils/cacheSSCam"; # Dir für FileCache
my $fuuid = $hash->{FUUID};
my ($cache,$r,$bst,$brt);
-
+
$bst = [gettimeofday];
### Cache Initialisierung ###
- #############################
+ #############################
if($op eq "c_init") {
if ($type eq "internal") {
Log3($name, 4, "$name - internal Cache mechanism is used ");
return $type;
- }
-
+ }
+
if($SScamMMCHI) {
Log3($name, 1, "$name - Perl cache module ".$SScamMMCHI." is missing. You need to install it with the FHEM Installer for example.");
return 0;
@@ -11463,42 +11478,42 @@ sub cache {
Log3($name, 1, "$name - Perl cache module ".$SScamMMCacheCache." is missing. You need to install it with the FHEM Installer for example.");
return 0;
}
-
+
if ($hash->{HELPER}{CACHEKEY}) {
Log3($name, 4, "$name - Cache \"$type\" is already initialized ");
return $type;
}
-
+
if($type eq "mem") {
- # This cache driver stores data on a per-process basis. This is the fastest of the cache implementations,
- # but data can not be shared between processes. Data will remain in the cache until cleared, expired,
+ # This cache driver stores data on a per-process basis. This is the fastest of the cache implementations,
+ # but data can not be shared between processes. Data will remain in the cache until cleared, expired,
# or the process dies.
- # https://metacpan.org/pod/CHI::Driver::Memory
- $cache = CHI->new( driver => 'Memory',
+ # https://metacpan.org/pod/CHI::Driver::Memory
+ $cache = CHI->new( driver => 'Memory',
on_set_error => 'warn',
on_get_error => 'warn',
- namespace => $fuuid,
- global => 0
+ namespace => $fuuid,
+ global => 0
);
}
-
+
if($type eq "rawmem") {
- # This is a subclass of CHI::Driver::Memory that stores references to data structures directly instead
- # of serializing / deserializing. This makes the cache faster at getting and setting complex data structures,
- # but unlike most drivers, modifications to the original data structure will affect the data structure stored
- # in the cache.
+ # This is a subclass of CHI::Driver::Memory that stores references to data structures directly instead
+ # of serializing / deserializing. This makes the cache faster at getting and setting complex data structures,
+ # but unlike most drivers, modifications to the original data structure will affect the data structure stored
+ # in the cache.
# https://metacpan.org/pod/CHI::Driver::RawMemory
$cache = CHI->new( driver => 'RawMemory',
on_set_error => 'warn',
- on_get_error => 'warn',
- namespace => $fuuid,
- global => 0
+ on_get_error => 'warn',
+ namespace => $fuuid,
+ global => 0
);
}
-
+
if($type eq "redis") {
- # A CHI driver that uses Redis to store the data. Care has been taken to not have this module fail in fiery
- # ways if the cache is unavailable. It is my hope that if it is failing and the cache is not required for your work,
+ # A CHI driver that uses Redis to store the data. Care has been taken to not have this module fail in fiery
+ # ways if the cache is unavailable. It is my hope that if it is failing and the cache is not required for your work,
# you can ignore its warnings.
# https://metacpan.org/pod/CHI::Driver::Redis
if(!$server || !$port) {
@@ -11512,25 +11527,25 @@ sub cache {
read_timeout => $rto,
write_timeout => $wto
);
-
- # Redis Construktor for Test Redis server connection (CHI doesn't do it)
- delete $hash->{HELPER}{REDISKEY};
- $r = eval { Redis->new( server => "$server:$port",
+
+ # Redis Construktor for Test Redis server connection (CHI doesn't do it)
+ delete $hash->{HELPER}{REDISKEY};
+ $r = eval { Redis->new( server => "$server:$port",
cnx_timeout => $cto,
debug => 0
- );
+ );
};
if ( my $error = $@ ) {
# Muster: Could not connect to Redis server at 192.168.2.10:6379: Connection refused at ./FHEM/49_SSCam.pm line 9546.
$error = (split("at ./FHEM",$error))[0];
Log3($name, 1, "$name - ERROR - $error");
return 0;
- }
+ }
else {
$hash->{HELPER}{REDISKEY} = $r;
}
-
- # create CHI Redis constructor
+
+ # create CHI Redis constructor
$cache = CHI->new( driver => 'Redis',
namespace => $fuuid,
server => "$server:$port",
@@ -11541,26 +11556,26 @@ sub cache {
debug => 0
);
}
-
+
if($type eq "file") {
- # This is a filecache using Cache::Cache.
- # https://metacpan.org/pod/Cache::Cache
+ # This is a filecache using Cache::Cache.
+ # https://metacpan.org/pod/Cache::Cache
my $pr = (split('/',reverse($path),2))[1];
- $pr = reverse($pr);
+ $pr = reverse($pr);
if(!(-R $pr) || !(-W $pr)) { # root-erzeichnis testen
Log3($name, 1, "$name - ERROR - cannot create \"$type\" Cache in dir \"$pr\": ".$!);
- delete $hash->{HELPER}{CACHEKEY};
+ delete $hash->{HELPER}{CACHEKEY};
return 0;
}
if(!(-d $path)) { # Zielverzeichnis anlegen wenn nicht vorhanden
my $success = mkdir($path,0775);
if(!$success) {
Log3($name, 1, "$name - ERROR - cannot create \"$type\" Cache path \"$path\": ".$!);
- delete $hash->{HELPER}{CACHEKEY};
- return 0;
+ delete $hash->{HELPER}{CACHEKEY};
+ return 0;
}
}
-
+
$cache = CHI->new( driver => 'CacheCache',
on_set_error => 'warn',
on_get_error => 'warn',
@@ -11577,115 +11592,115 @@ sub cache {
$brt = tv_interval($bst);
Log3($name, 1, "$name - Cache time to create \"$type\": ".$brt) if(AttrVal($name,"debugCachetime",0));
return $type;
- }
+ }
else {
Log3($name, 3, "$name - no cache \"$type\" available.");
}
return 0;
}
-
+
### Test Operationen ###
- ########################
-
+ ########################
+
if($hash->{HELPER}{CACHEKEY}) {
$cache = $hash->{HELPER}{CACHEKEY};
- }
+ }
else {
return 0;
}
-
+
if($type eq "redis") {
# Test ob Redis Serververbindung möglich
my $rc = $hash->{HELPER}{REDISKEY};
if ($rc) {
eval { $r = $rc->ping }; ## no critic 'eval not tested'
- if (!$r || $r ne "PONG") { # Verbindungskeys löschen -> Neugenerierung mit "c_init"
+ if (!$r || $r ne "PONG") { # Verbindungskeys löschen -> Neugenerierung mit "c_init"
Log3($name, 1, "$name - ERROR - connection to Redis server not possible. May be no route to host or port is wrong.");
delete $hash->{HELPER}{REDISKEY};
- delete $hash->{HELPER}{CACHEKEY};
- return 0;
+ delete $hash->{HELPER}{CACHEKEY};
+ return 0;
}
- }
+ }
else {
Log3($name, 1, "$name - ERROR - no constructor for Redis server is created");
return 0;
}
}
-
+
if($type eq "file" && (!(-R $path) || !(-W $path))) {
Log3($name, 1, "$name - ERROR - cannot handle \"$type\" Cache: ".$!);
- delete $hash->{HELPER}{CACHEKEY};
+ delete $hash->{HELPER}{CACHEKEY};
return 0;
- }
-
+ }
+
### Cache Operationen ###
#########################
-
+
# in Cache schreiben
if($op eq "c_write") {
if (!defined $dat) {
Log3($name, 1, "$name - ERROR - No data for Cache with key: $key ");
}
-
+
if($key) {
$cache->set($key,$dat);
$brt = tv_interval($bst);
Log3($name, 1, "$name - Cache time write key \"$key\": ".$brt) if(AttrVal($name,"debugCachetime",0));
return 1;
- }
+ }
else {
Log3($name, 1, "$name - ERROR - no key for \"$type\" cache !");
}
}
-
+
# aus Cache lesen
if($op eq "c_read") {
my $g = $cache->get($key);
$brt = tv_interval($bst);
Log3($name, 1, "$name - Cache time read key \"$key\": ".$brt) if(AttrVal($name,"debugCachetime",0));
-
+
if(!$g) {
- return "";
- }
- else {
+ return "";
+ }
+ else {
return $g;
}
}
-
+
# einen Key entfernen
if($op eq "c_remove") {
$cache->remove($key);
$brt = tv_interval($bst);
- Log3($name, 1, "$name - Cache time remove key \"$key\": ".$brt) if(AttrVal($name,"debugCachetime",0));
+ Log3($name, 1, "$name - Cache time remove key \"$key\": ".$brt) if(AttrVal($name,"debugCachetime",0));
Log3($name, 4, "$name - Cache key \"$key\" removed ");
- return 1;
+ return 1;
}
-
+
# alle Einträge aus Cache (Namespace) entfernen
if($op eq "c_clear") {
$cache->clear();
- Log3($name, 4, "$name - All entries removed from \"$type\" cache ");
- return 1;
+ Log3($name, 4, "$name - All entries removed from \"$type\" cache ");
+ return 1;
}
-
+
# alle Keys aus Cache zurück liefern
if($op eq "c_getkeys") {
return $cache->get_keys;
}
-
- # einen Key im Cache prüfen
+
+ # einen Key im Cache prüfen
if($op eq "c_isvalidkey") {
return $cache->is_valid($key);
}
-
+
# Cache entfernen
if($op eq "c_destroy") {
$cache->clear();
delete $hash->{HELPER}{CACHEKEY};
- Log3($name, 3, "$name - Cache \"$type\" destroyed ");
- return 1;
+ Log3($name, 3, "$name - Cache \"$type\" destroyed ");
+ return 1;
}
-
+
return 0;
}
@@ -11695,37 +11710,37 @@ return 0;
sub initOnBoot {
my $hash = shift;
my $name = $hash->{NAME};
-
+
RemoveInternalTimer($hash, "FHEM::SSCam::initOnBoot");
-
+
if($init_done == 1) {
RemoveInternalTimer($hash); # alle Timer löschen
-
+
delete($defs{$name}{READINGS}{LiveStreamUrl}) if($defs{$name}{READINGS}{LiveStreamUrl}); # LiveStream URL zurücksetzen
-
+
if (ReadingsVal($hash->{NAME}, "Record", "Stop") eq "Start") { # check ob alle Recordings = "Stop" nach Reboot -> sonst stoppen
Log3($name, 2, "$name - Recording of $hash->{CAMNAME} seems to be still active after FHEM restart - try to stop it now");
__camStopRec($hash);
}
-
+
if (!$hash->{CREDENTIALS}) { # Konfiguration der Synology Surveillance Station abrufen
Log3($name, 2, qq{$name - Credentials of $name are not set - make sure you've set it with "set $name credentials "});
- }
+ }
else {
readingsSingleUpdate($hash, "compstate", "true", 0); # Anfangswert f. versionCheck setzen
__getCaminfoAll($hash,1); # "1" ist Statusbit für manuelle Abfrage, kein Einstieg in Pollingroutine
versionCheck($hash); # Einstieg in regelmäßigen Check Kompatibilität
}
-
- # Subroutine Watchdog-Timer starten (sollen Cam-Infos regelmäßig abgerufen werden ?), verzögerter zufälliger Start 0-30s
+
+ # Subroutine Watchdog-Timer starten (sollen Cam-Infos regelmäßig abgerufen werden ?), verzögerter zufälliger Start 0-30s
RemoveInternalTimer($hash, "FHEM::SSCam::wdpollcaminfo");
InternalTimer (gettimeofday()+int(rand(30)), "FHEM::SSCam::wdpollcaminfo", $hash, 0);
-
- }
+
+ }
else {
InternalTimer(gettimeofday()+3, "FHEM::SSCam::initOnBoot", $hash, 0);
}
-
+
return;
}
@@ -11736,7 +11751,7 @@ sub versionCheck {
my $hash = shift;
my $name = $hash->{NAME};
my $rc = 21600;
-
+
RemoveInternalTimer($hash, "FHEM::SSCam::versionCheck");
return if(IsDisabled($name));
@@ -11746,49 +11761,49 @@ sub versionCheck {
" may be incompatible with SSCam version $hash->{HELPER}{VERSION}. ".
"For further information execute \"get $name versionNotes 4\".");
}
-
+
InternalTimer(gettimeofday()+$rc, "FHEM::SSCam::versionCheck", $hash, 0);
-return;
+return;
}
################################################################
-# return 0 - Startmeldung OpMode im Log
+# return 0 - Startmeldung OpMode im Log
# return 1 - wenn Shutdown läuft
################################################################
-sub startOrShut {
+sub startOrShut {
my $name = shift;
my $hash = $defs{$name};
-
+
if ($shutdownInProcess) { # shutdown in Proces -> keine weiteren Aktionen
Log3($name, 3, "$name - Shutdown in process. No more activities allowed.");
- return 1;
+ return 1;
}
-
- Log3($name, 4, "$name - ####################################################");
- Log3($name, 4, "$name - ### start cam operation $hash->{OPMODE} ");
- Log3($name, 4, "$name - ####################################################");
-
+
+ Log3($name, 4, "$name - ####################################################");
+ Log3($name, 4, "$name - ### start cam operation $hash->{OPMODE} ");
+ Log3($name, 4, "$name - ####################################################");
+
return 0;
}
###############################################################################
-# Err-Status / Log setzen wenn Device Verfügbarkeit disabled oder disconnected
+# Err-Status / Log setzen wenn Device Verfügbarkeit disabled oder disconnected
###############################################################################
-sub exitOnDis {
+sub exitOnDis {
my $name = shift;
my $log = shift;
my $hash = $defs{$name};
-
+
my $exit = 0;
-
+
my $errorcode = "000";
my $avail = ReadingsVal($name, "Availability", "");
-
+
if ($avail eq "disabled") {
$errorcode = "402";
$exit = 1;
- }
+ }
elsif ($avail eq "disconnected") {
$errorcode = "502";
$exit = 1;
@@ -11801,10 +11816,10 @@ sub exitOnDis {
readingsBulkUpdate ($hash, "Errorcode", $errorcode);
readingsBulkUpdate ($hash, "Error", $error );
readingsEndUpdate ($hash, 1);
-
+
Log3($name, 2, "$name - ERROR - $log - $error");
}
-
+
return $exit;
}
@@ -11816,7 +11831,7 @@ return $exit;
sub schedule {
my $name = shift;
my $arg = shift;
-
+
my $pack = __PACKAGE__;
my $caller = (caller(1))[3];
my $sub = (split /${pack}::/x, $caller)[1];
@@ -11826,14 +11841,14 @@ sub schedule {
$dt = 1;
Debug (qq{$pack - no delta time found for function "$sub", use default of $dt seconds instead})
}
-
+
InternalTimer(gettimeofday()+$dt, $caller, $arg, 0);
-
+
if (AttrVal($name,"debugactivetoken",0)) {
- Log3($name, 1, "$name - Function $caller scheduled again with delta time $dt seconds");
+ Log3($name, 1, "$name - Function $caller scheduled again with delta time $dt seconds");
}
-
-return;
+
+return;
}
###############################################################################
@@ -11842,15 +11857,15 @@ return;
sub myVersion {
my $hash = shift;
my $name = $hash->{NAME};
- my $actvs = 0;
+ my $actvs = 0;
my @vl = split (/-/x,ReadingsVal($name, "SVSversion", ""),2);
if(@vl) {
$actvs = $vl[0];
$actvs =~ s/\.//gx;
}
-
-return $actvs;
+
+return $actvs;
}
######################################################################################
@@ -11862,50 +11877,50 @@ sub wdpollcaminfo {
my ($hash) = @_;
my $name = $hash->{NAME};
my $camname = $hash->{CAMNAME};
- my $pcia = AttrVal($name,"pollcaminfoall",0);
- my $pnl = AttrVal($name,"pollnologging",0);
+ my $pcia = AttrVal($name,"pollcaminfoall",0);
+ my $pnl = AttrVal($name,"pollnologging",0);
my $watchdogtimer = 60+rand(30);
my $lang = AttrVal("global","language","EN");
-
+
RemoveInternalTimer($hash, "FHEM::SSCam::wdpollcaminfo");
if ($hash->{HELPER}{OLDVALPOLLNOLOGGING} != $pnl) { # Poll-Logging prüfen
$hash->{HELPER}{OLDVALPOLLNOLOGGING} = $pnl; # aktuellen pollnologging-Wert in $hash eintragen für späteren Vergleich
if ($pnl) {
- Log3($name, 3, "$name - Polling-Log of $camname is deactivated");
- }
+ Log3($name, 3, "$name - Polling-Log of $camname is deactivated");
+ }
else {
Log3($name, 3, "$name - Polling-Log of $camname is activated");
}
- }
-
+ }
+
if ($pcia && !IsDisabled($name)) { # Polling prüfen
if(ReadingsVal($name, "PollState", "Active") eq "Inactive") {
readingsSingleUpdate($hash,"PollState","Active",1); # Polling ist jetzt aktiv
readingsSingleUpdate($hash,"state","polling",1) if(!IsModelCam($hash)); # Polling-state bei einem SVS-Device setzten
Log3($name, 3, "$name - Polling of $camname is activated - Pollinginterval: $pcia s");
$hash->{HELPER}{OLDVALPOLL} = $pcia; # in $hash eintragen für späteren Vergleich (Changes von pollcaminfoall)
- __getCaminfoAll($hash,0);
+ __getCaminfoAll($hash,0);
}
-
+
my $lupd = ReadingsVal($name, "LastUpdateTime", "1970-01-01 / 01:00:00");
my ($year,$month,$mday,$hour,$min,$sec);
-
+
if ($lupd =~ /(\d+)\.(\d+)\.(\d+)/x) {
($mday, $month, $year, $hour, $min, $sec) = ($lupd =~ /(\d+)\.(\d+)\.(\d+)\s\/\s(\d+):(\d+):(\d+)/x);
- }
+ }
else {
- ($year, $month, $mday, $hour, $min, $sec) = ($lupd =~ /(\d+)-(\d+)-(\d+)\s\/\s(\d+):(\d+):(\d+)/x);
+ ($year, $month, $mday, $hour, $min, $sec) = ($lupd =~ /(\d+)-(\d+)-(\d+)\s\/\s(\d+):(\d+):(\d+)/x);
}
-
+
$lupd = fhemTimeLocal($sec, $min, $hour, $mday, $month-=1, $year-=1900);
-
+
if( gettimeofday() > ($lupd + $pcia + 20) ) {
- __getCaminfoAll($hash,0);
+ __getCaminfoAll($hash,0);
}
-
+
}
-
+
if (defined($hash->{HELPER}{OLDVALPOLL}) && $pcia) {
if ($hash->{HELPER}{OLDVALPOLL} != $pcia) {
Log3($name, 3, "$name - Pollinginterval of $camname has been changed to: $pcia s");
@@ -11914,7 +11929,7 @@ sub wdpollcaminfo {
}
InternalTimer(gettimeofday()+$watchdogtimer, "FHEM::SSCam::wdpollcaminfo", $hash, 0);
-
+
return;
}
@@ -11928,9 +11943,9 @@ return;
SSCam
- Using this Module you are able to operate cameras which are defined in Synology Surveillance Station (SVS) and execute
+ Using this Module you are able to operate cameras which are defined in Synology Surveillance Station (SVS) and execute
functions of the SVS. It is based on the SVS API and supports the SVS version 7 and above.
-
+
At present the following functions are available:
@@ -11972,31 +11987,31 @@ return;
The recordings and snapshots will be stored in Synology Surveillance Station (SVS) and are managed like the other (normal) recordings / snapshots defined by Surveillance Station rules.
For example the recordings are stored for a defined time in Surveillance Station and will be deleted after that period.
There is a widget provided for integration of SSCam-Streaming devices (Type SSCamSTRM) into FTUI. For further information please be informed by the
(german) FHEM Wiki article: FTUI Widget für SSCam Streaming Devices (SSCamSTRM).
-
+
Prerequisites
This module uses the Perl-modules JSON and MIME::Lite which are usually have to be installed in addition.
On Debian-Linux based systems these modules can be installed by:
-
- SSCam is completely using the nonblocking functions of HttpUtils respectively HttpUtils_NonblockingGet.
- In DSM respectively in Synology Surveillance Station an User has to be created. The login credentials are needed later when using a set-command to assign the login-data to a device.
+
+ SSCam is completely using the nonblocking functions of HttpUtils respectively HttpUtils_NonblockingGet.
+ In DSM respectively in Synology Surveillance Station an User has to be created. The login credentials are needed later when using a set-command to assign the login-data to a device.
Further informations could be find among Credentials.
-
+
Overview which Perl-modules SSCam is using:
-
+
JSON
@@ -12013,63 +12028,63 @@ return;
CHI
(if Cache is used)
CHI::Driver::Redis
(if Cache is used)
Cache::Cache
(if Cache is used)
-
-
+
+
-
- SSCam uses its own icons.
+
+ SSCam uses its own icons.
In order for the system to find the icons, the attribute iconPath must be supplemented with sscam in the FHEMWEB device.
-
+
- Example
- attr WEB iconPath default:fhemSVG:openautomation:sscam
+ Example
+ attr WEB iconPath default:fhemSVG:openautomation:sscam
-
+
Define
- There is a distinction between the definition of a camera-device and the definition of a Surveillance Station (SVS)
- device, that means the application on the discstation itself.
- Dependend on the type of defined device the internal MODEL will be set to "<vendor> - <camera type>"
+ There is a distinction between the definition of a camera-device and the definition of a Surveillance Station (SVS)
+ device, that means the application on the discstation itself.
+ Dependend on the type of defined device the internal MODEL will be set to "<vendor> - <camera type>"
or "SVS" and a proper subset of the described set/get-commands are assigned to the device.
The scope of application of set/get-commands is denoted to every particular command (valid for CAM, SVS, CAM/SVS).
- The cameras can be defined manually discrete, but alternatively with an automatical procedure by set "autocreateCams"
+ The cameras can be defined manually discrete, but alternatively with an automatical procedure by set "autocreateCams"
command in a previously defined SVS device.
-
+
A camera device is defined by:
define <Name> SSCAM <camera name in SVS> <ServerAddr> [Port] [Protocol]
-
+
At first the devices have to be set up and has to be operable in Synology Surveillance Station 7.0 and above.
-
+
A SVS-device to control functions of the Surveillance Station (SVS) is defined by:
-
+
In that case the term <camera name in SVS> become replaced by SVS only.
- Is the SVS defined and after setting the appropriate creadentials ready for use, all cameras available in SVS can be created
- automatically in FHEM with the set command "autocreateCams".
+ Is the SVS defined and after setting the appropriate creadentials ready for use, all cameras available in SVS can be created
+ automatically in FHEM with the set command "autocreateCams".
-
+
The Modul SSCam ist based on functions of Synology Surveillance Station API.
The parameters are in detail:
-
-
+
+
Name
the name of the new device to use in FHEM
Cameraname
camera name as defined in Synology Surveillance Station if camera-device, "SVS" if SVS-Device. Spaces are not allowed in camera name.
ServerAddr
IP-address of Synology Surveillance Station Host. Note: avoid using hostnames because of DNS-Calls are not unblocking in FHEM
Port
optional - the port of synology disc station. If not set, the default "5000" is used
-
Protocol
optional - the protocol (http or https) to access the synology disc station. If not set, the default "http" is used
+
Protocol
optional - the protocol (http or https) to access the synology disc station. If not set, the default "http" is used
@@ -12082,71 +12097,71 @@ return;
define DS1 SSCAM SVS 192.168.2.20 [5000] [http]define DS1 SSCAM SVS 192.168.2.20 [5001] [https]
- # creares a new SVS device DS1
+ # creares a new SVS device DS1
-
+
When a new Camera is defined, as a start the recordingtime of 15 seconds will be assigned to the device.
Using the attribute "rectime" you can adapt the recordingtime for every camera individually.
The value of "0" for rectime will lead to an endless recording which has to be stopped by a "set <name> off" command.
Due to a Log-Entry with a hint to that circumstance will be written.
-
+
If the attribute "rectime" would be deleted again, the default-value for recording-time (15s) become active.
With command"set <name> on [rectime]" a temporary recordingtime is determinded which would overwrite the dafault-value of recordingtime
and the attribute "rectime" (if it is set) uniquely.
In that case the command "set <name> on 0" leads also to an endless recording as well.
-
+
If you have specified a pre-recording time in SVS it will be considered too.
-
- If the module recognizes the defined camera as a PTZ-device (Reading "DeviceType = PTZ"), then a control panel is
- created automatically in the detal view. This panel requires SVS >= 7.1. The properties and the behave of the
+
+ If the module recognizes the defined camera as a PTZ-device (Reading "DeviceType = PTZ"), then a control panel is
+ created automatically in the detal view. This panel requires SVS >= 7.1. The properties and the behave of the
panel can be affected by attributes "ptzPanel_.*".
Please see also command"set <name> createPTZcontrol" in this context.
-
+
-
+
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
+
+ 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
+ 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.
- Is 2-step verification
+ Is 2-step verification
activated in DSM, the setup to a session with Surveillance Station is necessary (attribute "session = SurveillanceStation").
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
+
+ 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
+ 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
+
+ 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
+ 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.
@@ -12168,7 +12183,7 @@ return;
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 ... snap
session: ServeillanceStation - observer
set ... snapGallery
session: ServeillanceStation - observer
set ... stopView
-
set ... credentials
-
@@ -12180,52 +12195,52 @@ return;
get ... svsinfo
session: ServeillanceStation - observer
get ... snapfileinfo
session: ServeillanceStation - observer
get ... snapinfo
session: ServeillanceStation - observer
-
get ... stmUrlPath
session: ServeillanceStation - observer
+
get ... stmUrlPath
session: ServeillanceStation - observer
-
+
HTTP-Timeout Settings
-
-
+
+
All functions of SSCam use HTTP-calls to SVS Web API.
- You can set the attribute httptimeout > 0 to adjust
+ 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.
+ 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.
-
+
autocreateCams (valid for SVS)
-
- If a SVS device is defined, all in SVS integrated cameras are able to be created automatically in FHEM by this command. If the camera is already defined,
- it is overleaped.
- The new created camera devices are created in the same room as the used SVS device (default SSCam). Further helpful attributes are preset as well.
+
+ If a SVS device is defined, all in SVS integrated cameras are able to be created automatically in FHEM by this command. If the camera is already defined,
+ it is overleaped.
+ The new created camera devices are created in the same room as the used SVS device (default SSCam). Further helpful attributes are preset as well.
-
+
createStreamDev [generic | hls | lastsnap | mjpeg | switched] (valid for CAM)
respectively createStreamDev [master] (valid for SVS)
-
- A separate Streaming-Device (type SSCamSTRM) will be created. This device can be used as a discrete device in a dashboard
+
+ 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.
-
+
@@ -12237,35 +12252,35 @@ return;
master
- with the master device another defined streaming device can be adopted and its content displayed
-
-
- You can control the design with HTML tags in attribute htmlattr of the camera device or by
+
+
+ You can control the design with HTML tags in attribute htmlattr of the camera device or by
specific attributes of the SSCamSTRM-device itself.
-
+
Streaming device "hls"
-
+
The Streaming-device of type "hls" uses the library hls.js to playback the video stream and is executable on most current
- browsers with MediaSource extensions (MSE). With attribuet "hlsNetScript" can be specified, whether
- the local installed version of hls.js (./www/pgm2/sscam_hls.js) or the newest online library version from the hls.js
+ browsers with MediaSource extensions (MSE). With attribuet "hlsNetScript" can be specified, whether
+ the local installed version of hls.js (./www/pgm2/sscam_hls.js) or the newest online library version from the hls.js
project site should be used. This attribute has to be set centrally in a device of type "SVS" !
- If this kind of streaming device is used, the attribute "hlsStrmObject" must be set in the parent
+ If this kind of streaming device is used, the attribute "hlsStrmObject" must be set in the parent
camera device (see Internal PARENT).
-
+
Streaming device "switched hls"
-
+
This type of streaming device uses the HLS video stream native delivered by Synology Surveillance Station.
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
+ 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.
+ HTTP Live Streaming is currently only available on Mac Safari or modern mobile iOS/Android devices.
Streaming device "generic"
-
- A streaming device of type "generic" needs the complete definition of HTML-Tags by the attribute "genericStrmHtmlTag".
+
+ A streaming device of type "generic" needs the complete definition of HTML-Tags by the attribute "genericStrmHtmlTag".
These tags specify the content to playback.
@@ -12275,85 +12290,85 @@ attr <name> genericStrmHtmlTag <video $HTMLATTR controls autoplay>
<source src='http://192.168.2.10:32000/$NAME.m3u8' type='application/x-mpegURL'>
</video>
-attr <name> genericStrmHtmlTag <img $HTMLATTR
+attr <name> genericStrmHtmlTag <img $HTMLATTR
src="http://192.168.2.10:32774"
onClick="FW_okDialog('<img src=http://192.168.2.10:32774 $PWS>')"
- >
+ >
- The variables $HTMLATTR, $NAME and $PWS are placeholders and absorb the attribute "htmlattr" (if set), the SSCam-Devicename
+ The variables $HTMLATTR, $NAME and $PWS are placeholders and absorb the attribute "htmlattr" (if set), the SSCam-Devicename
respectively the value of attribute "popupWindowSize" in streamin-device, which specify the windowsize of a popup window.
-
+
Streaming device "lastsnap"
-
- This type of streaming device playback the last (newest) snapshot.
- As default the snapshot is retrieved in a reduced resolution. In order to use the original resolution, the attribute
- "snapGallerySize = Full" has to be set in the associated camera device (compare Internal PARENT).
- There also the attribute "pollcaminfoall" should be set to retrieve the newest snapshot regularly.
-
-
+
+ This type of streaming device playback the last (newest) snapshot.
+ As default the snapshot is retrieved in a reduced resolution. In order to use the original resolution, the attribute
+ "snapGallerySize = Full" has to be set in the associated camera device (compare Internal PARENT).
+ There also the attribute "pollcaminfoall" should be set to retrieve the newest snapshot regularly.
+
+
Streaming Device "master"
-
- This type cannot play back streams itself. Switching the playback of the content of another defined
+
+ This type cannot play back streams itself. Switching the playback of the content of another defined
Streaming Devices is done by the Set command adopt in the Master Streaming Device.
-
-
+
+
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 (default "SSCam").
+
+ 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 (default "SSCam").
With the "ptzPanel_.*"-attributes or respectively the specific attributes of the SSCamSTRM-device
- the properties of the control panel can be affected.
+ the properties of the control panel can be affected.
-
+
createReadingsGroup [<name of readingsGroup>] (valid for CAM/SVS)
-
- This command creates a readingsGroup device to display an overview of all defined SSCam devices.
- A name for the new readingsGroup device can be specified. Is no own name specified, the readingsGroup device will be
+
+ This command creates a readingsGroup device to display an overview of all defined SSCam devices.
+ A name for the new readingsGroup device can be specified. Is no own name specified, the readingsGroup device will be
created with name "RG.SSCam".
-
+
-
+
createSnapGallery (valid for CAM)
-
- A snapshot gallery will be created as a separate device (type SSCamSTRM). The device will be provided in
+
+ A snapshot gallery will be created as a separate device (type SSCamSTRM). The device will be provided in
room "SSCam".
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.
+ you are able to manipulate the properties of the new snapshot gallery device.
-
+
Note
The camera names in Synology SVS should not be very similar, otherwise the retrieval of snapshots could come to inaccuracies.
-
+
credentials <username> <password> (valid for CAM/SVS)
-
- set username / password combination for access the Synology Surveillance Station.
+
+ set username / password combination for access the Synology Surveillance Station.
See Credentials for further informations.
-
+
-
+
delPreset <PresetName> (valid for PTZ-CAM)
-
+
Deletes a preset "<PresetName>". In FHEMWEB a drop-down list with current available presets is provieded.
-
- 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.
+
+ 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.
+ Is the field for the Day/Night-mode shown greyed in SVS -> IP-camera -> optimization -> exposure mode, this function will be probably unsupported.
-
+
extevent [ 1-10 ] (valid for SVS)
-
- This command triggers an external event (1-10) in 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.
-
+
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.
+
+ 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" .
The lense can be moved in smallest steps to very large steps into the desired direction.
@@ -12425,35 +12440,35 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
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.
+ Also in this case the procedure has to be repeated to bring the lense into the desired position if necessary.
-
+
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.
+ 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.
+
+ 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
@@ -12467,21 +12482,21 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
homeMode [on|off] (valid for SVS)
-
- Switch the HomeMode of the Surveillance Station on or off.
+
+ Switch the HomeMode of the Surveillance Station on or off.
Further informations about HomeMode you can find in the Synology Onlinehelp.
-
+
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".
-
+
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
+
+ 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.
+
+ 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.
-
+
Example:
CamMotDetSc SVS, sensitivity: 76, threshold: 55
-
+
move [ right | up | down | left | dir_X ] [Sekunden] (valid for CAM up to SVS version 7.1)
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
+
+ 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 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_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)"
-
+
off (valid for CAM)
- Stops the current recording.
+ Stops the current recording.
-
- A recording will be started. The default recording time is 15 seconds. It can be individually changed by
- the attribute "rectime".
+
+ A recording will be started. The default recording time is 15 seconds. It can be individually changed by
+ the attribute "rectime".
The recording time can be overwritten on-time by "set <name> on <rectime>" for the current recording.
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 this case
+ A special case is start recording by "set <name> on 0" respectively the attribute value "rectime = 0". In this case
an endless-recording will be started. One have to explicitely stop this recording with command "set <name> off".
- Furthermore the recording behavior can be impacted with attribute "recextend" as explained as
+ Furthermore the recording behavior can be impacted with attribute "recextend" as explained as
follows.
Attribute "recextend = 0" or not set (default):
@@ -12581,68 +12596,68 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
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.
+ 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
+
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.
-
- The shipping of recording by Synology Chat can be activated permanently by setting attribute recChatTxt
- Of course, the SSChatBot device which is
+
+ The shipping of recording by Synology Chat can be activated permanently by setting attribute recChatTxt
+ Of course, the SSChatBot device which is
used for send data, must be defined and fully functional before.
- If you want temporary overwrite the message text as set in attribute "recChatTxt", you can optionally specify the
+ If you want temporary overwrite the message text as set in attribute "recChatTxt", you can optionally specify the
"recChatTxt:"-tag as shown above. If the attribute "recChatTxt" is not set, the shipping by Telegram is
activated one-time. (the tag-syntax is equivalent to the "recChatTxt" attribute)
-
- The Email shipping of recordings can be activated by setting attribute "recEmailTxt".
- Before you have to prepare the Email shipping as described in section Setup Email shipping.
+
+ The Email shipping of recordings can be activated by setting attribute "recEmailTxt".
+ Before you have to prepare the Email shipping as described in section Setup Email shipping.
(for further information execute "get <name> versionNotes 7")
Alternatively you can activate the Email-shipping one-time when you specify the "recEmailTxt:"-tag in the "on"-command.
In this case the tag-text is used for creating the Email instead the text specified in "recEmailTxt"-attribute.
(the tag syntax is identical to the "recEmailTxt" attribute)
-
- The shipping of the last recording by Telegram can be activated permanently by setting attribute
- "recTelegramTxt". Of course, the TelegramBot device which is
+
+ The shipping of the last recording by Telegram can be activated permanently by setting attribute
+ "recTelegramTxt". Of course, the TelegramBot device which is
used, must be defined and fully functional before.
- If you want temporary overwrite the message text as set with attribute "recTelegramTxt", you can optionally specify the
+ If you want temporary overwrite the message text as set with attribute "recTelegramTxt", you can optionally specify the
"recTelegramTxt:"-tag as shown above. If the attribute "recTelegramTxt" is not set, the shipping by Telegram is
activated one-time. (the tag-syntax is equivalent to the "recTelegramTxt" attribute)
-
+
Examples:
set <name> on [rectime]
# starts a recording, stops automatically after [rectime]
-
+
set <name> on 0
# starts a permanent record which must be stopped with the "off"-command.
-
+
set <name> on recEmailTxt:"subject => New recording for $CAM created, body => The last recording of $CAM is atteched."
# starts a recording and send it after completion by Email.
-
+
set <name> on recTelegramTxt:"tbot => teleBot, peers => @xxxx , subject => Movement alarm by $CAM. The snapshot $FILE was created at $CTIME, option => silent"
# starts a recording and send it after completion by Telegram in silent-mode.
-
+
set <name> on recChatTxt:"chatbot => SynChatBot, peers => , subject => Movement alarm by $CAM. The snapshot $FILE was created at $CTIME."
# starts a recording and send it after completion by Synology Chat.
-
+
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
+
+ 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
+
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".
@@ -12650,32 +12665,32 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
# 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.
-
+
-
+
pirSensor [activate | deactivate] (valid for CAM)
-
- Activates / deactivates the infrared sensor of the camera (only posible if the camera has got a PIR sensor).
+
+ Activates / deactivates the infrared sensor of the camera (only posible if the camera has got a PIR sensor).
-
+
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.
+ 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.
-
- With "live_fw, live_link" a MJPEG-Livestream will be started, either as an embedded image
+
+ 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
+ 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
+ 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 "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 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
+
+ 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
+ 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 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.
+ At the time only the Mac Safari Browser and modern mobile iOS/Android-Devices are able to playback HLS-Streams.
-
+
Note for MJPEG:
The MJPEG stream is SVS internal transcoded from other codec and is usally only about 1 fps.
-
+
-
+
setHome <PresetName> (valid for PTZ-CAM)
-
+
Set the Home-preset to a predefined preset name "<PresetName>" or the current position of the camera.
-
+
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
+
+ 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.
-
+
One or multiple snapshots are triggered. The number of snapshots to trigger and the time difference (in seconds) between
each snapshot can be optionally specified. Without any specification only one snapshot is triggered.
- The ID and the filename of the last snapshot will be displayed in Reading "LastSnapId" respectively
+ The ID and the filename of the last snapshot will be displayed in Reading "LastSnapId" respectively
"LastSnapFilename".
To get data of the last 1-10 snapshots in various versions, the attribute snapReadingRotate
can be used.
-
- A snapshot shipping by Synology Chat can be permanently activated by setting attribute snapChatTxt.
- Of course, the SSChatBot device which is
+
+ A snapshot shipping by Synology Chat can be permanently activated by setting attribute snapChatTxt.
+ Of course, the SSChatBot device which is
used must be defined and fully functional before.
- If you want temporary overwrite the subject set in attribute "snapChatTxt", you can optionally specify the
+ If you want temporary overwrite the subject set in attribute "snapChatTxt", you can optionally specify the
"snapChatTxt:"-tag as shown above. If the attribute "snapChatTxt" is not set, the shipping by SSChatBot is
activated one-time (the tag-syntax is equivalent to the "snapChatTxt" attribute).
- In either case the attribute videofolderMap has to be set before. It must contain an URL to the
+ In either case the attribute videofolderMap has to be set before. It must contain an URL to the
root directory of recordings and snapshots (e.g. http://server.me:8081/surveillance).
-
- The snapshot Email shipping can be activated by setting attribute snapEmailTxt.
- Before you have to prepare the Email shipping as described in section Setup Email shipping.
+
+ The snapshot Email shipping can be activated by setting attribute snapEmailTxt.
+ Before you have to prepare the Email shipping as described in section Setup Email shipping.
(for further information execute "get <name> versionNotes 7")
- If you want temporary overwrite the message text set in attribute "snapEmailTxt", you can optionally specify the
+ If you want temporary overwrite the message text set in attribute "snapEmailTxt", you can optionally specify the
"snapEmailTxt:"-tag as shown above. If the attribute "snapEmailTxt" is not set, the Email shipping is
activated one-time. (the tag-syntax is equivalent to the "snapEmailTxt" attribut)
-
- A snapshot shipping by Telegram can be permanently activated by setting attribute snapTelegramTxt.
- Of course, the TelegramBot device which is
+
+ A snapshot shipping by Telegram can be permanently activated by setting attribute snapTelegramTxt.
+ Of course, the TelegramBot device which is
used must be defined and fully functional before.
- If you want temporary overwrite the message text set in attribute "snapTelegramTxt", you can optionally specify the
+ If you want temporary overwrite the message text set in attribute "snapTelegramTxt", you can optionally specify the
"snapTelegramTxt:"-tag as shown above. If the attribute "snapTelegramTxt" is not set, the shipping by Telegram is
activated one-time. (the tag-syntax is equivalent to the "snapTelegramTxt" attribut)
-
+
Examples:
set <name> snap
- set <name> snap 4
+ set <name> snap 4
set <name> snap 3 3 snapEmailTxt:"subject => Movement alarm $CAM, body => A movement was recognised at Carport"
set <name> snap 2 snapTelegramTxt:"tbot => teleBot, peers => , subject => Movement alarm by $CAM. The snapshot $FILE was created at $CTIME, option => silent"
set <name> snap 2 snapChatTxt:"chatbot => SynChatBot , peers => Frodo Sam, subject => Movement alarm by $CAM. At $CTIME the snapshot $FILE was created. Now it is: $TIME."
-
+
snapCams [<number>] [<time difference>] [CAM:"<camera>, <camera>, ..."] (valid for SVS)
-
- One or multiple snapshots of denoted cameras are triggered. If no cameras are denoted, the snapshots are triggered in all
+
+ One or multiple snapshots of denoted cameras are triggered. If no cameras are denoted, the snapshots are triggered in all
of the defined cameras in FHEM.
Optionally the number of snapshots to trigger (default: 1) and the time difference (in seconds) between
each snapshot (default: 2) can be specified.
The ID and the filename of the last snapshot will be displayed in Reading "LastSnapId" respectively "LastSnapFilename" of
the appropriate camera device.
-
- The snapshot Email shipping can be activated by setting attribute "snapEmailTxt" in the
- SVS device AND in the camera devices whose snapshots should be shipped.
- Before you have to prepare the Email shipping as described in section Setup Email shipping.
+
+ The snapshot Email shipping can be activated by setting attribute "snapEmailTxt" in the
+ SVS device AND in the camera devices whose snapshots should be shipped.
+ Before you have to prepare the Email shipping as described in section Setup Email shipping.
(for further information execute "get <name> versionNotes 7")
- Only the message text set in attribute "snapEmailTxt" of the SVS device is used in the created Email. The settings of
+ Only the message text set in attribute "snapEmailTxt" of the SVS device is used in the created Email. The settings of
those attribute in the camera devices is ignored !!
-
+
Examples:
- set <name> snapCams 4
+ set <name> snapCams 4
set <name> snapCams 3 3 CAM:"CamHE1, CamCarport"
-
+
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
+ 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".
-
+
Note
The camera names in Synology SVS should not be very similar, otherwise the retrieval of snapshots could come to inaccuracies.
-
+
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").
-
+
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").
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.
+ 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.
-
+
apiInfo
-
+
Retrieves the API information of the Synology Surveillance Station and open a popup window with its data.
-
caminfoall (valid for CAM/SVS)
+
caminfoall (valid for CAM/SVS)
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
+ 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".
-
-
+
+
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.
+
+ 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.
+ 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.
homeModeState (valid for SVS)
-
- HomeMode-state of the Surveillance Station will be retrieved.
+
+ HomeMode-state of the Surveillance Station will be retrieved.
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)
get <name> listLog severity:Error limit:5
@@ -12969,188 +12984,188 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
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
+
+
+ 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.
-
+
listPresets (valid for PTZ-CAM)
-
+
Get a popup with a lists of presets saved for the camera.
-
+
saveLastSnap [<Pfad>] (gilt für CAM)
-
- The (last) snapshot currently specified in the reading "LastSnapId" is saved locally as a jpg file.
+
+ The (last) snapshot currently specified in the reading "LastSnapId" is saved locally as a jpg file.
Optionally, the path to save the file can be specified in the command (default: modpath in global Device).
The file is locally given the same name as contained in the reading "LastSnapFilename".
The resolution of the snapshot is determined by the attribute "snapGallerySize".
-
+
-
+
Example:
get <name> saveLastSnap /opt/fhem/log
-
+
saveRecording [<path>] (valid for CAM)
-
- The current recording present in Reading "CamLastRec" is saved lcally as a MP4 file. Optionally you can specify the path
+
+ The current recording present in Reading "CamLastRec" is saved lcally as a MP4 file. Optionally you can specify the path
for the file to save (default: modpath in global device).
The name of the saved local file is the same as displayed in Reading "CamLastRec".
-
+
Example:
get <name> saveRecording /opt/fhem/log
-
+
-
-
+
+
scanVirgin (valid for CAM/SVS)
-
- This command is similar to get caminfoall, informations relating to SVS and the camera will be retrieved.
+
+ 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.
+ new identified and all necessary API-parameters will be new investigated.
-
-
+
+
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
+
+ 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
+ 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
+
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. The camera names in Synology SVS should not be very similar, otherwise the retrieval of
+ ressources are needed. The camera names in Synology SVS should not be very similar, otherwise the retrieval of
snapshots could come to inaccuracies.
-
+
snapfileinfo (valid for CAM)
-
- The filename of the last snapshot will be retrieved. This command will be executed with "get <name> snap"
+
+ The filename of the last snapshot will be retrieved. This command will be executed with "get <name> snap"
automatically.
-
-
+
+
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.
-
-
+
+
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
+
+ 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
+ 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 !
+
+ 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 !
-
+
storedCredentials (valid for CAM/SVS)
-
+
Shows the stored login credentials in a popup as plain text.
-
-
+
+
svsinfo (valid for CAM/SVS)
-
+
Determines common informations about the installed SVS-version and other properties.
-
+
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.
-
+
Setup Email shipping
-
+
- Snapshots and recordings can be sent by Email after creation. For this purpose the module contains its
- own Email client. Before you can use this function you have to install the Perl-module MIME::Lite. On debian
+ Snapshots and recordings can be sent by Email after creation. For this purpose the module contains its
+ own Email client. Before you can use this function you have to install the Perl-module MIME::Lite. On debian
systems it can be installed with command:
-
+
sudo apt-get install libmime-lite-perl
-
+
There are some attributes must be set or can be used optionally.
At first the Credentials for access the Email outgoing server must be set by command "set <name> smtpcredentials <user> <password>".
- The connection establishment to the server is initially done unencrypted and switches to an encrypted connection if SSL
- encryption is available. In that case the transmission of User/Password takes place encrypted too.
+ The connection establishment to the server is initially done unencrypted and switches to an encrypted connection if SSL
+ encryption is available. In that case the transmission of User/Password takes place encrypted too.
If attribute "smtpSSLPort" is defined, the established connection to the Email server will be encrypted immediately.
Attributes which are optional are marked:
-
-
-
+
+
+
snapEmailTxt
- Activates the Email shipping of snapshots. This attribute has the format:
subject => <subject text>, body => <message text>
- The placeholder $CAM, $DATE and $TIME can be used.
+ The placeholder $CAM, $DATE and $TIME can be used.
Optionally you can specify the "snapEmailTxt:"-tag when trigger a snapshot with the "snap"-command.
- In this case the Email shipping is activated one-time for the snapshot or the tag-text
+ In this case the Email shipping is activated one-time for the snapshot or the tag-text
is used instead of the text defined in the "snapEmailTxt"-attribute.
- The placeholder $CAM, $DATE and $TIME can be used.
+ The placeholder $CAM, $DATE and $TIME can be used.
Optionally you can specify the "recEmailTxt:"-tag when start recording with the "on"-command.
- In this case the Email shipping is activated one-time for the started recording or the tag-text
+ In this case the Email shipping is activated one-time for the started recording or the tag-text
is used instead of the text defined in the "recEmailTxt"-attribute.
@@ -13210,13 +13225,13 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
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
@@ -13229,9 +13244,9 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
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
+ A marginal difference between the polling intervals of the defined cameras, e.g. 1 second, can already be faced as
sufficient value.
cacheServerParam
Specification of connection parameters to a central data cache.
-
+
redis
: if network connection is used: <IP-address>:<port> / if Unix-Socket is used: <unix>:</path/to/socket>
-
+
-
-
+
+
cacheType
- Defines the used Cache for storage of snapshots, recordings und other mass data.
+ Defines the used Cache for storage of snapshots, recordings und other mass data.
(Default: internal).
Maybe further perl modules have to be installed, e.g. with help of the FHEM Installer.
The data are saved in "Namespaces" to permit the usage of central Caches (e.g. redis).
- The cahe types "file" and "redis" are convenient if the data shouldn't be hold in the RAM of the FHEM-Server.
+ The cahe types "file" and "redis" are convenient if the data shouldn't be hold in the RAM of the FHEM-Server.
For the usage of Redis at first a the Redis Key-Value Store has to be provide, e.g. in a Docker image on the
Synology Diskstation (redis).
: create and use a file structure in subdirectory "FhemUtils"
redis
: use a external Redis Key-Value Store over TCP/IP or Unix-Socket. Please see also attribute "cacheServerParam".
-
+
-
-
+
+
debugactivetoken
- If set, the state of active token will be logged - only for debugging, don't use it in normal operation !
+ If set, the state of active token will be logged - only for debugging, don't use it in normal operation !
-
+
-
debugCachetime
- Shows the consumed time of cache operations.
+
debugCachetime
+ Shows the consumed time of cache operations.
-
+
disable
- deactivates the device definition
+ 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")
-
+ This attribute contains HTML-Tags for video-specification in a Streaming-Device of type "generic".
+ (see also "set <name> createStreamDev generic")
- The variables $HTMLATTR, $NAME and $PWS are placeholders and absorb the attribute "htmlattr" (if set), the SSCam-Devicename
+ The variables $HTMLATTR, $NAME and $PWS are placeholders and absorb the attribute "htmlattr" (if set), the SSCam-Devicename
respectively the value of attribute "popupWindowSize" in streaming-device, which specify the windowsize of a popup window.
-
+
hlsNetScript (settable in device model "SVS")
- If set, the latest hls.js library version from the project site is used (internet connection is needed).
+ If set, the latest hls.js library version from the project site is used (internet connection is needed).
- In default the local installed library version (./www/pgm2/sscam_hls.js) is uses for playback in all streaming devices
+ In default the local installed library version (./www/pgm2/sscam_hls.js) is uses for playback in all streaming devices
of type "hls" (please see also "set <name> createStreamDev hls").
This attribute has to be set in a device model "SVS" and applies to all streaming devices !
-
+
hlsStrmObject
- If a streaming device was defined by "set <name> createStreamDev hls", this attribute has to be set and must contain the
+ If a streaming device was defined by "set <name> createStreamDev hls", this attribute has to be set and must contain the
link to the video object to play back.
The attribute must specify a HTTP Live Streaming object with the extension ".m3u8".
The variable $NAME can be used as a placeholder and will be replaced by the camera device name.
-
-
+
+
Examples:
attr <name> hlsStrmObject https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8
attr <name> hlsStrmObject https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8
# Sample video streams used for testing the streaming device function (internet connection is needed)
-
+
attr <name> hlsStrmObject http://192.168.2.10:32000/CamHE1.m3u8
# playback a HLS video stream of a camera witch is delivered by e.g. a ffmpeg conversion process
-
+
attr <name> hlsStrmObject http://192.168.2.10:32000/$NAME.m3u8
- # Same as example above, but use the replacement with variable $NAME for "CamHE1"
+ # Same as example above, but use the replacement with variable $NAME for "CamHE1"
-
+
httptimeout
- Timeout-Value of HTTP-Calls to Synology Surveillance Station.
+ Timeout-Value of HTTP-Calls to Synology Surveillance Station.
(default: 20 seconds)
-
+
htmlattr
additional specifications to inline oictures to manipulate the behavior of stream, e.g. size of the image.
livestreamprefix
- Overwrites the specifications of protocol, servername and port for further use in livestream address and
+ 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:
+ It can be specified of two ways as follows:
-
+
-
DEF
: the protocol, servername and port as specified in device
+
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.
+ 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 delete the quotes for SID and for StmKeys.
- The attribute may be helpful in some cases to avoid errormessages "402 - permission denied" or "105 -
+ This attribute delete the quotes for SID and for StmKeys.
+ The attribute may be helpful in some cases to avoid errormessages "402 - permission denied" or "105 -
Insufficient user privilege" and makes login possible.
- (default: 0)
+ (default: 0)
-
+
pollcaminfoall
- Interval of automatic polling the Camera properties (<= 10: no polling, > 10: polling with interval)
+ Interval of automatic polling the Camera properties (<= 10: no polling, > 10: polling with interval)
pollnologging
"0" resp. not set = Logging device polling active (default), "1" = Logging device polling inactive
-
-
+
+
ptzNoCapPrePat
- Some PTZ cameras cannot store presets and patrols despite their PTZ capabilities.
- To avoid errors and corresponding log messages, the attribute ptzNoCapPrePat can be set in these cases.
+ Some PTZ cameras cannot store presets and patrols despite their PTZ capabilities.
+ To avoid errors and corresponding log messages, the attribute ptzNoCapPrePat can be set in these cases.
The system will be notified of a missing preset / patrol capability.
-
-
+
+
ptzPanel_Home
- In the PTZ-control panel the Home-Icon (in attribute "ptzPanel_row02") is automatically assigned to the value of
+ 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.
-
-
-
+ 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".
+ 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.
For further information execute "get <name> versionNotes 2,6".
-
+
ptzPanel_iconPrefix
- Prefix for icons used in PTZ-control panel, default is "black_btn_".
+ 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
+ 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
+ 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".
+ 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
+ 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
+ Switch the usage of a PTZ-control panel in detail view respectively a created StreamDevice off or on
(default: on).
- The PTZ panel use its own icons.
- Thereby the system find the icons, in FHEMWEB device the attribute "iconPath" has to be completed by "sscam"
- (e.g. "attr WEB iconPath default:fhemSVG:openautomation:sscam").
-
-
+ The PTZ panel use its own icons.
+ Thereby the system find the icons, in FHEMWEB device the attribute "iconPath" has to be completed by "sscam"
+ (e.g. "attr WEB iconPath default:fhemSVG:openautomation:sscam").
+
+
recChatTxt chatbot => <SSChatBot device>, peers => [<peer1 peer2 ...>], subject => [<subject text>]
Activates the permanent shipping of recordings by Synology Chat after its creation.
- Before activating the attribute videofolderMap has to be set. It must contain an URL to the
+ Before activating the attribute videofolderMap has to be set. It must contain an URL to the
root directory of your SVS recordings and snapshots ( e.g. http://server.me:8081/surveillance ).
- The attribute recChatTxt has to be defined in the form as described. With key "chatbot" the SSChatBot device is specified,
- which is used for sending the data. Of course, the SSChatBot device
- must be available and work well.
- The setting of "peers" is optional, but the keys must be (empty) specified.
+ The attribute recChatTxt has to be defined in the form as described. With key "chatbot" the SSChatBot device is specified,
+ which is used for sending the data. Of course, the SSChatBot device
+ must be available and work well.
+ The setting of "peers" is optional, but the keys must be (empty) specified.
If "peer" is empty, the defaultPeer of the SSChatBot device is used.
-
+
You can use the following placeholders within "subject".
-
-
-
+
+
+
$CAM (#CAM)
- Device alias respectively the name of the camera in SVS if the device alias isn't set
-
-
+
+
+
Examples:
attr <device> recChatTxt chatbot => teleBot, peers => , subject => Motion alarm ($FILE)
attr <device> recChatTxt chatbot => teleBot, peers => Frodo Sam Gollum, subject => Motion alarm
attr <device> recChatTxt chatbot => teleBot, peers => , subject => Motion alarm
attr <device> recChatTxt chatbot => teleBot, peers => , subject => Motion alarm from $CAM. At $CTIME the recording $FILE was created. Now it is $TIME.
-
-
+
+
recEmailTxt subject => <subject text>, body => <message text>
Activates the Email shipping of recordings after whose creation.
- The attribute must be defined in the specified form.
+ The attribute must be defined in the specified form.
The following placeholders can be used in the subject or body.
-
-
-
+
+
+
$CAM (#CAM)
- Device alias respectively the name of the camera in SVS if the device alias isn't set
- Filename of the (last) recording (only usable in body)
$CTIME (#CTIME)
- Creation time of the (last) recording (only usable in body)
-
+
-
+
Example:
recEmailTxt subject => New recording $CAM, body => A new recording of $CAM is created and atteched.
-
+
recTelegramTxt tbot => <TelegramBot-Device>, peers => [<peer1 peer2 ...>], subject => [<Text>], option => [silent]
Enables permanent sending of recordings after their creation via TelegramBot.
- The attribute must be defined in the specified form.
+ The attribute must be defined in the specified form.
For optional specifications, the key must be specified >empty<.
rectime
- determines the recordtime when a recording starts. If rectime = 0 an endless recording will be started. If
+ 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
+ "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).
+ 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
- A logical "downgrade" to the specified SVS version is performed. The attribute is useful to temporarily eliminate
+ A logical "downgrade" to the specified SVS version is performed. The attribute is useful to temporarily eliminate
incompatibilities that may occur when updating/upgrading Synology Surveillance Station.
- Incompatibilities should be reported to the maitainer in a timely manner.
+ Incompatibilities should be reported to the maitainer in a timely manner.
-
+
smtpHost <Hostname>
The name or IP-address of outgoing email server (e.g. securesmtp.t-online.de).
@@ -13622,61 +13639,61 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
Optional you can enter a carbon-copy receiving address. Several receiving addresses are separated by ",".
-
+
smtpDebug
Switch the debugging mode for SMTP connection on (if Email shipping is used).
-
+
smtpFrom <name>@<domain>
Return address if Email shipping is used.
-
+
smtpPort <Port>
Optional setting of default SMTP port of outgoing email server (default: 25).
-
+
smtpSSLPort <Port>
- Optional setting of SSL port of outgoing email server (default: 465). If set, the established connection to the Email
+ Optional setting of SSL port of outgoing email server (default: 465). If set, the established connection to the Email
server will be encrypted immediately.
-
+
smtpTo <name>@<domain>[, <name>@<domain>][, <name>@<domain>]...
Receiving address for emal shipping. Several receiving addresses are separated by ",".
-
+
smtpNoUseSSL
If no Email SSL encryption should be used, set this attribute to "1" (default: 0).
-
+
snapChatTxt chatbot => <SSChatBot-Device>, peers => [<peer1 peer2 ...>], subject => [<subject text>]
- Activates the permanent shipping of snapshots by Synology Chat after their creation. If several snapshots were triggert,
+ Activates the permanent shipping of snapshots by Synology Chat after their creation. If several snapshots were triggert,
they will be sequentially delivered.
- Before activating the attribute videofolderMap has to be set. It must contain an URL to the
+ Before activating the attribute videofolderMap has to be set. It must contain an URL to the
root directory of your SVS recordings and snapshots ( e.g. http://server.me:8081/surveillance ).
- The attribute snapChatTxt has to be defined in the form as described. With key "chatbot" the SSChatBot device is specified,
- which is used for sending the data. Of course, the SSChatBot device
+ The attribute snapChatTxt has to be defined in the form as described. With key "chatbot" the SSChatBot device is specified,
+ which is used for sending the data. Of course, the SSChatBot device
must be available and work well.
The key "peers" contains valid names of Synology Chat Users who should receive the message.
- The setting of "peers" is optional, but the keys must (empty) specified.
+ The setting of "peers" is optional, but the keys must (empty) specified.
If "peer" is empty, the defaultPeer of the SSChatBot device is used.
-
+
You can use the following placeholders within "subject".
-
-
-
+
+
+
$CAM (#CAM)
- Device alias respectively the name of the camera in SVS if the device alias isn't set
snapEmailTxt subject => <subject text>, body => <message text>
Activates the Email shipping of snapshots after whose creation.
The attribute must be defined in the specified form.
The following placeholders can be used in the subject or body.
-
-
-
+
+
+
$CAM (#CAM)
- Device alias respectively the name of the camera in SVS if the device alias isn't set
- Filename of the (last) snapshot (only usable in body)
$CTIME (#CTIME)
- Creation time of the (last) snapshot (only usable in body)
-
+
-
+
Example:
snapEmailTxt subject => Motion alarm $CAM, body => A motion was recognized at $CAM.
-
+
snapTelegramTxt tbot => <TelegramBot device>, peers => [<peer1 peer2 ...>], subject => [<subject text>], option => [silent]
- Enables permanent sending of snapshots after their creation via TelegramBot.
+ Enables permanent sending of snapshots after their creation via TelegramBot.
If several snapshots were triggered, they are sent sequentially.
- The attribute must be defined in the specified form.
+ The attribute must be defined in the specified form.
For optional specifications, the key must be specified >empty<.
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.
+ 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
+ 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.
-
+
snapReadingRotate 0...10
- Activates the version control of snapshot readings (default: 0). A consecutive number of readings "LastSnapFilename",
+ Activates the version control of snapshot readings (default: 0). A consecutive number of readings "LastSnapFilename",
"LastSnapId" and "LastSnapTime" until to the specified value of snapReadingRotate will be created and contain the data
of the last X snapshots.
-
+
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". Use it if e.g. folders are mountet with different names than original
+ Replaces the content of reading "VideoFolder". Use it if e.g. folders are mountet with different names than original
in SVS or providing an URL for acces the snapshots / recordings by a web server.
-
+
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
+
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 !
@@ -13853,7 +13872,7 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
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)
- Mit diesem Modul können Operationen von in der Synology Surveillance Station (SVS) definierten Kameras und Funktionen
+ 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:
lokales Abspeichern der letzten Kamera-Aufnahme bzw. des letzten Schnappschusses
Auswahl unterschiedlicher Cache-Typen zur Bilddatenspeicherung (Attribut cacheType)
ausführen von Zoom-Aktionen (bei PTZ-Kameras die Zoom unterstützen)
-
+
-
+
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.
- Zur Integration von SSCam Streaming Devices (Typ SSCamSTRM) wird ein Widget bereitgestellt.
+ Zur Integration von SSCam Streaming Devices (Typ SSCamSTRM) wird ein Widget bereitgestellt.
Für weitere Information dazu bitte den Artikel im Wiki durchlesen: FTUI Widget für SSCam Streaming Devices (SSCamSTRM).
-
-
+
+
Vorbereitung
-
+
Dieses Modul nutzt die Perl-Module JSON und MIME::Lite die üblicherweise nachinstalliert werden müssen.
Auf Debian-Linux basierenden Systemen können sie installiert werden mit:
-
- 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
+
+ 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:
-
+
-
- SSCam benutzt einen eigenen Satz Icons.
+
+ SSCam benutzt einen eigenen Satz Icons.
Damit das System sie findet, ist im FHEMWEB Device das Attribut iconPath um sscam zu ergänzen.
Beispiel
attr WEB iconPath default:fhemSVG:openautomation:sscam
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
+ 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".
Die Kameras können einzeln manuell, alternativ auch automatisiert mittels einem vorher definierten SVS-Device angelegt werden.
-
+
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
+
+ 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:
-
- In diesem Fall wird statt <Kameraname in SVS> nur SVS angegeben.
- Ist das SVS-Device definiert und nach dem Setzen der Credentials einsatzbereit, können alle in der SVS vorhandenen Kameras mit dem Set-Befehl
+
+ In diesem Fall wird statt <Kameraname in SVS> nur SVS angegeben.
+ Ist das SVS-Device definiert und nach dem Setzen der Credentials einsatzbereit, können alle in der SVS vorhandenen Kameras mit dem Set-Befehl
"autocreateCams" in FHEM automatisiert angelegt werden.
-
- Das Modul SSCam basiert auf Funktionen der Synology Surveillance Station API.
-
+
+ Das Modul SSCam basiert auf Funktionen der Synology Surveillance Station API.
+
Die Parameter beschreiben im Einzelnen:
-
-
+
+
Name
der Name des neuen Gerätes in FHEM
@@ -14099,7 +14118,7 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
define DS1 SSCAM SVS 192.168.2.20 [5001] [https]
# erstellt ein neues SVS-Device DS1
-
+
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.
@@ -14110,54 +14129,54 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
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
+
+ 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. Sollte im DSM die 2-Stufen Verifizierung
+
+ 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. Sollte im DSM die 2-Stufen Verifizierung
aktiviert sein, ist die Session mit der Surveillance Station aufzubauen (Attribut "session = SurveillanceStation").
- 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
+ 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/Funktionen im Privilegienprofil beschränkt
+
+ 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/Funktionen 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
+
+ Ü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
+
+ 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.
Alle Funktionen dieses Moduls verwenden HTTP-Aufrufe gegenüber der SVS Web API.
- Durch Setzen des Attributes httptimeout > 0 kann dieser Wert bei Bedarf entsprechend
- den technischen Gegebenheiten angepasst werden.
-
+ 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
+ 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.
-
+
autocreateCams (gilt für SVS)
-
- Ist ein SVS-Device definiert, können mit diesem Befehl alle in der SVS integrierten Kameras automatisiert angelegt werden. Bereits definierte
- Kameradevices werden übersprungen.
- Die neu erstellten Kameradevices werden im gleichen Raum wie das SVS-Device definiert (default SSCam). Weitere sinnvolle Attribute werden ebenfalls
- voreingestellt.
+
+ Ist ein SVS-Device definiert, können mit diesem Befehl alle in der SVS integrierten Kameras automatisiert angelegt werden. Bereits definierte
+ Kameradevices werden übersprungen.
+ Die neu erstellten Kameradevices werden im gleichen Raum wie das SVS-Device definiert (default SSCam). Weitere sinnvolle Attribute werden ebenfalls
+ voreingestellt.
- Es wird ein separates Streaming-Device (Typ SSCamSTRM) erstellt. Dieses Device kann z.B. als separates Device
+ 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.
+ Dem Streaming-Device wird der aktuelle Raum des Kameradevice zugewiesen sofern dort gesetzt.
-
- Die Gestaltung kann durch HTML-Tags im Attribut htmlattr im Kameradevice oder mit den
+
+ Die Gestaltung kann durch HTML-Tags im Attribut htmlattr im Kameradevice oder mit den
spezifischen Attributen im Streaming-Device beeinflusst werden.
-
-
+
+
Streaming Device "hls"
-
+
Das Streaming-Device vom Typ "hls" verwendet die Bibliothek hls.js zur Bildverarbeitung und ist auf allen Browsern mit
- MediaSource extensions (MSE) lauffähig. Mit dem Attribut "hlsNetScript" kann bestimmt werden, ob
- die lokal installierte hls.js (./www/pgm2/sscam_hls.js) oder immer die aktuellste Bibliotheksversion von der hls.js Projektseite
+ MediaSource extensions (MSE) lauffähig. Mit dem Attribut "hlsNetScript" kann bestimmt werden, ob
+ die lokal installierte hls.js (./www/pgm2/sscam_hls.js) oder immer die aktuellste Bibliotheksversion von der hls.js Projektseite
verwendet werden soll. Dieses Attribut ist zentral in einem Device vom Typ "SVS" zu setzen !
- Bei Verwendung dieses Streamingdevices ist zwingend das Attribut "hlsStrmObject" im verbundenen
+ Bei Verwendung dieses Streamingdevices ist zwingend das Attribut "hlsStrmObject" im verbundenen
Kamera-Device (siehe Internal PARENT) anzugeben.
-
+
Streaming Device "switched hls"
-
+
Dieser Typ nutzt den von der Synology Surveillance Station gelieferten HLS Videostream.
- 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.
+ 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 dann 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.
+ HLS (HTTP Live Streaming) kann momentan nur auf Mac Safari oder mobilen iOS/Android-Geräten wiedergegeben werden.
-
+
Streaming Device "generic"
-
+
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 und $PWS sind Platzhalter und übernehmen ein gesetztes Attribut "htmlattr", den SSCam-
Devicenamen bzw. das Attribut "popupWindowSize" im Streaming-Device, welches die Größe eines Popup-Windows festlegt.
-
+
Streaming Device "lastsnap"
-
+
Dieser Typ gibt den neuesten Schnappschuß wieder. Der Schnappschuss wird per default als Icon, d.h. in einer verminderten
- Auflösung abgerufen. Um die Originalauflösung zu verwenden, ist im zugehörigen Kameradevice (Internal PARENT) das Attribut
- "snapGallerySize = Full" zu setzen.
+ Auflösung abgerufen. Um die Originalauflösung zu verwenden, ist im zugehörigen Kameradevice (Internal PARENT) das Attribut
+ "snapGallerySize = Full" zu setzen.
Dort sollte ebenfalls das Attribut "pollcaminfoall" gesetzt sein, um regelmäßig die neuesten Schnappschußdaten abzurufen.
-
+
Streaming Device "master"
-
- Dieser Typ kann selbst keine Streams wiedergeben. Die Umschaltung der Wiedergabe des Contents eines anderen definierten
+
+ Dieser Typ kann selbst keine Streams wiedergeben. Die Umschaltung der Wiedergabe des Contents eines anderen definierten
Streaming Devices erfolgt durch den Set-Befehl adopt im Master Streaming Device.
-
+
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 (default "SSCam").
- Mit den "ptzPanel_.*"-Attributen bzw. den spezifischen Attributen des erzeugten
- SSCamSTRM-Devices können die Eigenschaften des PTZ-Paneels beeinflusst werden.
+
+ Es wird ein separates PTZ-Steuerungspaneel (Type SSCamSTRM) erstellt. Es wird der aktuelle Raum des Kameradevice
+ zugewiesen sofern dort gesetzt (default "SSCam").
+ Mit den "ptzPanel_.*"-Attributen bzw. den spezifischen Attributen des erzeugten
+ SSCamSTRM-Devices können die Eigenschaften des PTZ-Paneels beeinflusst werden.
-
+
createReadingsGroup [<Name der readingsGroup>] (gilt für CAM/SVS)
-
- Es wird ein readingsGroup-Device zur Übersicht aller vorhandenen SSCam-Devices erstellt. Es kann ein eigener Name angegeben
+
+ Es wird ein readingsGroup-Device zur Übersicht aller vorhandenen SSCam-Devices erstellt. Es kann ein eigener Name angegeben
werden. Ist kein Name angegeben, wird eine readingsGroup mit dem Namen "RG.SSCam" erzeugt.
-
+
-
+
createSnapGallery (gilt für CAM)
-
- Es wird eine Schnappschußgallerie als separates Device (Type SSCamSTRM) erzeugt. Das Device wird im Raum
+
+ Es wird eine Schnappschußgallerie als separates Device (Type SSCamSTRM) erzeugt. Das Device wird im Raum
"SSCam" erstellt.
- Mit den "snapGallery..."-Attributen bzw. den spezifischen Attributen des erzeugten SSCamSTRM-Devices
- können die Eigenschaften der Schnappschußgallerie beeinflusst werden.
+ Mit den "snapGallery..."-Attributen bzw. den spezifischen Attributen des erzeugten SSCamSTRM-Devices
+ können die Eigenschaften der Schnappschußgallerie beeinflusst werden.
Hinweis
- Die Namen der Kameras in der SVS sollten sich nicht stark ähneln, da es ansonsten zu Ungenauigkeiten beim Abruf der
+ Die Namen der Kameras in der SVS sollten sich nicht stark ähneln, da es ansonsten zu Ungenauigkeiten beim Abruf der
Schnappschußgallerie kommen kann.
-
+
-
+
credentials <username> <password> (gilt für CAM/SVS)
-
- Setzt Username / Passwort für den Zugriff auf die Synology Surveillance Station.
+
+ Setzt Username / Passwort für den Zugriff auf die Synology Surveillance Station.
Siehe Credentials
-
+
-
+
delPreset <PresetName> (gilt für PTZ-CAM)
-
- Löscht einen Preset "<PresetName>". Im FHEMWEB wird eine Drop-Down Liste der aktuell vorhandenen
+
+ Löscht einen Preset "<PresetName>". Im FHEMWEB wird eine Drop-Down Liste der aktuell vorhandenen
Presets angeboten.
-
- Mit diesem Befehl kann der Belichtungsmodus der Kameras gesetzt werden. Dadurch wird z.B. das Verhalten der Kamera-LED's entsprechend gesteuert.
+
+ 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.
+ 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.
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
+
+ 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
+ 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.
-
+
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
+
+ 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.
-
+
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)
+ 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.
+ 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.
@@ -14442,35 +14461,35 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
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.
+ 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.
-
+
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.
+ 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
@@ -14481,29 +14500,29 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
-
+
homeMode [on|off] (gilt für SVS)
-
- Schaltet den HomeMode der Surveillance Station ein bzw. aus.
- Informationen zum HomeMode sind in der Synology Onlinehilfe
+
+ Schaltet den HomeMode der Surveillance Station ein bzw. aus.
+ Informationen zum HomeMode sind in der Synology Onlinehilfe
enthalten.
-
+
motdetsc [camera [<options>] | SVS [<options>] | disable] (gilt für CAM)
-
- Der Befehl 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
+
+ Der Befehl 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. Optionen können in einem Script verwendet werden.
-
- Für die Bewegungserkennung durch SVS bzw. durch Kamera können weitere Optionen angegeben werden.
+
+ 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 "Schwellenwert".
-
+
Wird die Bewegungserkennung durch die Kamera genutzt, stehen die Optionen "Empfindlichkeit", "Objektgröße" und "Prozentsatz für Auslösung" zur Verfügung.
# 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
+ 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
+
+ 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.
+
+ Ü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.
-
+
Beipiel:
CamMotDetSc SVS, sensitivity: 76, threshold: 55
-
+
-
move [ right | up | down | left | dir_X ] [Sekunden] (gilt für CAM bis SVS Version 7.1)
+
move [ right | up | down | left | dir_X ] [Sekunden] (gilt für CAM bis SVS Version 7.1)
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
+
+ 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
+ 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.
+ 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_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)"
-
+
off (gilt für CAM)
- Stoppt eine laufende Aufnahme.
+ Stoppt eine laufende Aufnahme.
- 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>"
+ 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
+ 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.
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
+
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
+
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.
-
+
Ein Synology Chat Versand der Aufnahme kann durch Setzen des recChatTxt Attributs permanent aktiviert
- werden. Das zu verwendende SSChatBot-Device muss natürlich
+ werden. Das zu verwendende SSChatBot-Device muss natürlich
funktionstüchtig eingerichtet sein.
- Der Text im Attribut "recChatTxt" kann durch die Spezifikation des optionalen "recChatTxt:"-Tags, wie oben
+ Der Text im Attribut "recChatTxt" kann durch die Spezifikation des optionalen "recChatTxt:"-Tags, wie oben
gezeigt, temporär überschrieben bzw. geändert werden. Sollte das Attribut "recChatTxt" nicht gesetzt sein, wird durch Angabe dieses Tags
der Versand mit Synology Chat einmalig aktiviert. (die Tag-Syntax entspricht dem "recChatTxt"-Attribut)
-
- Ein Email-Versand der letzten Aufnahme kann durch Setzen des Attributs "recEmailTxt"
+
+ Ein Email-Versand der letzten Aufnahme kann durch Setzen des Attributs "recEmailTxt"
aktiviert werden. Zuvor ist der Email-Versand, wie im Abschnitt Einstellung Email-Versand beschrieben,
einzustellen. (Für weitere Informationen "get <name> versionNotes 7" ausführen)
Alternativ kann durch Verwendung des optionalen "recEmailTxt:"-Tags der Email-Versand der gestarteten Aufnahme nach deren
- Beendigung aktiviert werden. Sollte das Attribut "recEmailTxt" bereits gesetzt sein, wird der Text des "recEmailTxt:"-Tags
+ Beendigung aktiviert werden. Sollte das Attribut "recEmailTxt" bereits gesetzt sein, wird der Text des "recEmailTxt:"-Tags
anstatt des Attribut-Textes verwendet.
-
+
Ein Telegram-Versand der letzten Aufnahme kann durch Setzen des Attributs "recTelegramTxt" permanent aktiviert
- werden. Das zu verwendende TelegramBot-Device muss natürlich
+ werden. Das zu verwendende TelegramBot-Device muss natürlich
funktionstüchtig eingerichtet sein.
- Der Text im Attribut "recTelegramTxt" kann durch die Spezifikation des optionalen "recTelegramTxt:"-Tags, wie oben
+ Der Text im Attribut "recTelegramTxt" kann durch die Spezifikation des optionalen "recTelegramTxt:"-Tags, wie oben
gezeigt, temporär überschrieben bzw. geändert werden. Sollte das Attribut "recTelegramTxt" nicht gesetzt sein, wird durch Angabe dieses Tags
der Telegram-Versand einmalig aktiviert. (die Tag-Syntax entspricht dem "recTelegramTxt"-Attribut)
-
+
Beispiele : set <name> on [rectime]
- # startet die Aufnahme der Kamera <name>, automatischer Stop der Aufnahme nach Ablauf der Zeit [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> on 0
# startet eine Daueraufnahme die mit "off" gestoppt werden muss.
-
+
set <name> on recEmailTxt:"subject => Neue Aufnahme $CAM, body => Die aktuelle Aufnahme von $CAM ist angehängt."
# startet eine Aufnahme und versendet sie nach Beendigung per Email.
-
+
set <name> on recTelegramTxt:"tbot => teleBot, peers => @xxxx , subject => Bewegungsalarm bei $CAM. Es wurde $CTIME die Aufnahme $FILE erstellt, option => silent"
# startet eine Aufnahme und versendet sie nach Beendigung per Telegram im Silent-Mode.
-
+
set <name> on recChatTxt:"chatbot => SynChatBot, peers => , subject => Bewegungsalarm bei $CAM. Es wurde $CTIME die Aufnahme $FILE erstellt. Jetzt ist es $TIME."
# startet eine Aufnahme und versendet sie nach Beendigung per Synology Chat.
-
+
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
+
+ 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
+
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.
@@ -14675,33 +14694,33 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
# 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.
-
+
-
+
pirSensor [activate | deactivate] (gilt für CAM)
-
- Aktiviert / deaktiviert den Infrarot-Sensor der Kamera (sofern die Kamera einen PIR-Sensor enthält).
+
+ Aktiviert / deaktiviert den Infrarot-Sensor der Kamera (sofern die Kamera einen PIR-Sensor enthält).
-
+
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.
+ 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
+ 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.
+ Nähere Informationen zur Anlage von Überwachungstouren sind in der Hilfe zur Surveillance Station enthalten.
-
- Mit "live_fw, live_link, live_open" wird ein MJPEG-Livestream, entweder als eingebettetes Image
+
+ 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.
+ 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.
+ 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
+ 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
+ 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
+ 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.
-
+
Hinweis zu MJPEG:
Der MJPEG Stream wird innerhalb der SVS aus anderen Codecs (H.264) transkodiert und beträgt normalerweise ca. 1 Fps.
-
+
-
-
+
+
setHome <PresetName> (gilt für PTZ-CAM)
-
- Setzt die Home-Position der Kamera auf einen vordefinierten Preset "<PresetName>" oder auf die aktuell angefahrene
+
+ Setzt die Home-Position der Kamera auf einen vordefinierten Preset "<PresetName>" oder auf die aktuell angefahrene
Position.
-
+
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.
-
+
Ein oder mehrere Schnappschüsse werden ausgelöst. Es kann die Anzahl der auszulösenden Schnappschüsse und deren zeitlicher
Abstand in Sekunden optional angegeben werden. Ohne Angabe wird ein Schnappschuß getriggert.
- Es wird die ID und der Filename des letzten Snapshots als Wert der Readings "LastSnapId" bzw. "LastSnapFilename" in
+ Es wird die ID und der Filename des letzten Snapshots als Wert der Readings "LastSnapId" bzw. "LastSnapFilename" in
der Kamera gespeichert.
Um die Daten der letzen 1-10 Schnappschüsse zu versionieren, kann das Attribut "snapReadingRotate"
verwendet werden.
-
+
Ein Synology Chat Versand der Schnappschüsse kann durch Setzen des Attributs snapChatTxt permanent aktiviert
- werden. Das zu verwendende SSChatBot-Device muss natürlich
+ werden. Das zu verwendende SSChatBot-Device muss natürlich
funktionstüchtig eingerichtet sein.
- Der Text im Attribut "snapChatTxt" kann durch die Spezifikation des optionalen "snapChatTxt:"-Tags, wie oben
+ Der Text im Attribut "snapChatTxt" kann durch die Spezifikation des optionalen "snapChatTxt:"-Tags, wie oben
gezeigt, temporär überschrieben bzw. geändert werden. Sollte das Attribut "snapChatTxt" nicht gesetzt sein, wird durch Angabe dieses Tags
der SSChatBot-Versand einmalig aktiviert (die Syntax entspricht dem "snapChatTxt"-Attribut).
- In jedem Fall ist vorher das Attribut videofolderMap zu setzen. Es muß eine URL zum
+ In jedem Fall ist vorher das Attribut videofolderMap zu setzen. Es muß eine URL zum
root-Verzeichnis der Aufnahmen und Schnappschüssen enthalten ( z.B. http://server.mein:8081/surveillance ).
-
+
Ein Email-Versand der Schnappschüsse kann durch Setzen des Attributs snapEmailTxt permanent aktiviert
werden. Zuvor ist der Email-Versand, wie im Abschnitt Einstellung Email-Versand beschrieben,
einzustellen. (Für weitere Informationen "get <name> versionNotes 7" ausführen)
- Der Text im Attribut "snapEmailTxt" kann durch die Spezifikation des optionalen "snapEmailTxt:"-Tags, wie oben
+ Der Text im Attribut "snapEmailTxt" kann durch die Spezifikation des optionalen "snapEmailTxt:"-Tags, wie oben
gezeigt, temporär überschrieben bzw. geändert werden. Sollte das Attribut "snapEmailTxt" nicht gesetzt sein, wird durch Angabe dieses Tags
der Email-Versand einmalig aktiviert. (die Tag-Syntax entspricht dem "snapEmailTxt"-Attribut)
-
- Ein Telegram-Versand der Schnappschüsse kann durch Setzen des Attributs
- snapTelegramTxt permanent aktiviert werden.
- Das zu verwendende TelegramBot-Device muss natürlich
+
+ Ein Telegram-Versand der Schnappschüsse kann durch Setzen des Attributs
+ snapTelegramTxt permanent aktiviert werden.
+ Das zu verwendende TelegramBot-Device muss natürlich
funktionstüchtig eingerichtet sein.
- Der Text im Attribut "snapTelegramTxt" kann durch die Spezifikation des optionalen "snapTelegramTxt:"-Tags, wie oben
- gezeigt, temporär überschrieben bzw. geändert werden. Sollte das Attribut "snapTelegramTxt" nicht gesetzt sein, wird
- durch Angabe dieses Tags der Telegram-Versand einmalig aktiviert.
+ Der Text im Attribut "snapTelegramTxt" kann durch die Spezifikation des optionalen "snapTelegramTxt:"-Tags, wie oben
+ gezeigt, temporär überschrieben bzw. geändert werden. Sollte das Attribut "snapTelegramTxt" nicht gesetzt sein, wird
+ durch Angabe dieses Tags der Telegram-Versand einmalig aktiviert.
(die Tag-Syntax entspricht dem "snapTelegramTxt"-Attribut)
-
+
Beispiele:
set <name> snap
- set <name> snap 4
+ set <name> snap 4
set <name> snap 3 3 snapEmailTxt:"subject => Bewegungsalarm $CAM, body => Eine Bewegung wurde am Carport registriert"
set <name> snap 2 snapTelegramTxt:"tbot => teleBot, peers => , subject => Bewegungsalarm bei $CAM. Es wurde $CTIME der Schnappschuss $FILE erstellt, option => silent"
set <name> snap 2 snapChatTxt:"chatbot => SynChatBot , peers => Frodo Sam, subject => Bewegungsalarm bei $CAM. Es wurde $CTIME der Schnappschuss $FILE erstellt. Jetzt ist es: $TIME."
-
+
snapCams [<Anzahl>] [<Zeitabstand>] [CAM:"<Kamera>, <Kamera>, ..."] (gilt für SVS)
-
- Ein oder mehrere Schnappschüsse der angegebenen Kamera-Devices werden ausgelöst. Sind keine Kamera-Devices angegeben,
- werden die Schnappschüsse bei allen in FHEM definierten Kamera-Devices getriggert.
+
+ Ein oder mehrere Schnappschüsse der angegebenen Kamera-Devices werden ausgelöst. Sind keine Kamera-Devices angegeben,
+ werden die Schnappschüsse bei allen in FHEM definierten Kamera-Devices getriggert.
Optional kann die Anzahl der auszulösenden Schnappschüsse (default: 1) und deren zeitlicher Abstand in Sekunden
(default: 2) angegeben werden.
- Es wird die ID und der Filename des letzten Snapshots als Wert der Readings "LastSnapId" bzw. "LastSnapFilename"
+ Es wird die ID und der Filename des letzten Snapshots als Wert der Readings "LastSnapId" bzw. "LastSnapFilename"
der entsprechenden Kamera gespeichert.
- Ein Email-Versand der Schnappschüsse kann durch Setzen des Attributs"snapEmailTxt" im
- SVS-Device UND in den Kamera-Devices, deren Schnappschüsse versendet werden sollen, aktiviert werden.
+ Ein Email-Versand der Schnappschüsse kann durch Setzen des Attributs"snapEmailTxt" im
+ SVS-Device UND in den Kamera-Devices, deren Schnappschüsse versendet werden sollen, aktiviert werden.
Bei Kamera-Devices die kein Attribut "snapEmailTxt" gesetzt haben, werden die Schnappschüsse ausgelöst, aber nicht versendet.
Zuvor ist der Email-Versand, wie im Abschnitt Einstellung Email-Versand beschrieben,
einzustellen. (Für weitere Informationen "get <name> versionNotes 7" ausführen)
- Es wird ausschließlich der im Attribut "snapEmailTxt" des SVS-Devices hinterlegte Email-Text in der erstellten Email
+ Es wird ausschließlich der im Attribut "snapEmailTxt" des SVS-Devices hinterlegte Email-Text in der erstellten Email
verwendet. Der Text im Attribut "snapEmailTxt" der einzelnen Kameras wird ignoriert !!
-
+
Beispiele:
- set <name> snapCams 4
+ set <name> snapCams 4
set <name> snapCams 3 3 CAM:"CamHE1, CamCarport"
-
+
-
+
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
+ 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.
-
+
Hinweis
- Die Namen der Kameras in der SVS sollten sich nicht stark ähneln, da es ansonsten zu Ungenauigkeiten beim Abruf der
+ Die Namen der Kameras in der SVS sollten sich nicht stark ähneln, da es ansonsten zu Ungenauigkeiten beim Abruf der
Schnappschußgallerie kommen kann.
-
+
-
+
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").
-
+
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").
@@ -14943,62 +14962,62 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
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
+ 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.
-
+
apiInfo
-
+
Ruft die API Informationen der Synology Surveillance Station ab und öffnet ein Popup mit diesen Informationen.
-
+
caminfoall (gilt für CAM/SVS)
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
+
+ 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
+ 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.
-
-
+
+
eventlist (gilt für CAM)
-
- Es wird das Reading "CamEventNum" und "CamLastRec"
+
+ 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
+ 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: \
+ 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]')})
-
+
homeModeState (gilt für SVS)
-
- HomeMode-Status der Surveillance Station wird abgerufen.
+
+ HomeMode-Status der Surveillance Station wird abgerufen.
-
-
+
+
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)
get <name> listLog severity:Error limit:5
- Zeigt die letzten 5 Logeinträge mit dem Schweregrad "Error"
+ 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
+ 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
+
+
+ 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
+ Im Protokoll-Setup der SVS kann man einstellen was protokolliert werden soll. Für weitere Informationen
siehe Synology Online-Hlfe.
-
-
+
+
listPresets (gilt für PTZ-CAM)
-
+
Die für die Kamera gespeicherten Presets werden in einem Popup ausgegeben.
-
-
+
+
saveLastSnap [<Pfad>] (gilt für CAM)
-
- Der aktuell im Reading "LastSnapId" angegebene (letzte) Schnappschuß wird lokal als jpg-File gespeichert.
+
+ Der aktuell im Reading "LastSnapId" angegebene (letzte) Schnappschuß wird lokal als jpg-File gespeichert.
Optional kann der Pfad zur Speicherung des Files im Befehl angegeben werden (default: modpath im global Device).
Das File erhält lokal den gleichen Namen wie im Reading "LastSnapFilename" enthalten.
Die Auflösung des Schnappschusses wird durch das Attribut "snapGallerySize" bestimmt.
-
+
-
+
Beispiel:
get <name> saveLastSnap /opt/fhem/log
-
+
-
-
+
+
saveRecording [<Pfad>] (gilt für CAM)
-
- Die aktuell im Reading "CamLastRec" angegebene Aufnahme wird lokal als MP4-File gespeichert. Optional kann der Pfad zur
+
+ Die aktuell im Reading "CamLastRec" angegebene Aufnahme wird lokal als MP4-File gespeichert. Optional kann der Pfad zur
Speicherung des Files im Befehl angegeben werden (default: modpath im global Device).
Das File erhält lokal den gleichen Namen wie im Reading "CamLastRec" angegeben.
-
+
Beispiel:
get <name> saveRecording /opt/fhem/log
-
+
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.
+
+ 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.
-
-
+
+
snapGallery [1-10] (gilt für CAM)
-
- Es wird ein Popup mit den letzten [x] Schnapschüssen erzeugt. Ist das Attribut "snapGalleryBoost" gesetzt,
+
+ 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
+ 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
+
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. Die Namen der Kameras in der SVS sollten sich nicht stark ähneln, da es ansonsten zu
+ RAM-Ressourcen benötigt. Die Namen der Kameras in der SVS sollten sich nicht stark ähneln, da es ansonsten zu
Ungnauigkeiten beim Abruf der Schnappschußgallerie kommen kann.
-
+
snapfileinfo (gilt für CAM)
-
- Es wird der Filename des letzten Schnapschusses ermittelt. Der Befehl wird implizit mit "get <name> snap"
+
+ Es wird der Filename des letzten Schnapschusses ermittelt. Der Befehl wird implizit mit "get <name> snap"
ausgeführt.
-
-
+
+
snapinfo (gilt für CAM)
-
- Es werden Schnappschussinformationen gelesen. Hilfreich wenn Schnappschüsse nicht durch SSCam, sondern durch die Bewegungserkennung der Kamera
+
+ Es werden Schnappschussinformationen gelesen. Hilfreich wenn Schnappschüsse nicht durch SSCam, sondern durch die Bewegungserkennung der Kamera
oder Surveillance Station erzeugt werden.
-
-
+
+
stmUrlPath (gilt für CAM)
-
- Mit diesem Kommando wird der aktuelle Streamkey der Kamera abgerufen und das Reading mit dem Key-Wert gefüllt.
+
+ 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.
+ 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:
-
+
+ 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
+
+ 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 !
-
+
storedCredentials (gilt für CAM/SVS)
-
+
Die gespeicherten Anmeldeinformationen (Credentials) werden in einem Popup als Klartext angezeigt.
-
-
+
+
svsinfo (gilt für CAM/SVS)
-
+
Ermittelt allgemeine Informationen zur installierten SVS-Version und andere Eigenschaften.
-
-
+
+
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
+
+ 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
+ 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.
-
-
+
+
-
+
Einstellung Email-Versand
- Schnappschüsse und Aufnahmen können nach der Erstellung per Email versendet werden. Dazu enthält das
- Modul einen eigenen Email-Client.
- Zur Verwendung dieser Funktion muss das Perl-Modul MIME::Lite installiert sein. Auf Debian-Systemen kann
+ Schnappschüsse und Aufnahmen können nach der Erstellung per Email versendet werden. Dazu enthält das
+ Modul einen eigenen Email-Client.
+ Zur Verwendung dieser Funktion muss das Perl-Modul MIME::Lite installiert sein. Auf Debian-Systemen kann
es mit
-
+
sudo apt-get install libmime-lite-perl
-
+
installiert werden.
-
+
Für die Verwendung des Email-Versands müssen einige Attribute gesetzt oder können optional genutzt werden.
Die Credentials für den Zugang zum Email-Server müssen mit dem Befehl "set <name> smtpcredentials <user> <password>"
hinterlegt werden. Der Verbindungsaufbau zum Postausgangsserver erfolgt initial unverschüsselt und wechselt zu einer verschlüsselten
Verbindung wenn SSL zur Verfügung steht. In diesem Fall erfolgt auch die Übermittlung von User/Password verschlüsselt.
- Ist das Attribut smtpSSLPort definiert, erfolgt der Verbindungsaufbau zum Email-Server sofort verschlüsselt.
+ Ist das Attribut smtpSSLPort definiert, erfolgt der Verbindungsaufbau zum Email-Server sofort verschlüsselt.
-
+
Optionale Attribute sind gekennzeichnet:
-
-
-
+
+
+
-
snapEmailTxt
- Aktiviert den Email-Versand von Schnappschüssen.
+
snapEmailTxt
- Aktiviert den Email-Versand von Schnappschüssen.
Das Attribut hat das Format:
subject => <Betreff-Text>, body => <Mitteilung-Text>
Es können die Platzhalter $CAM, $DATE und $TIME verwendet werden.
- Der Email-Versand des letzten Schnappschusses wird einmalig aktiviert falls der "snapEmailTxt:"-Tag
- beim "snap"-Kommando verwendet wird bzw. der in diesem Tag definierte Text statt des Textes im
+ Der Email-Versand des letzten Schnappschusses wird einmalig aktiviert falls der "snapEmailTxt:"-Tag
+ beim "snap"-Kommando verwendet wird bzw. der in diesem Tag definierte Text statt des Textes im
Attribut "snapEmailTxt" verwendet.
-
recEmailTxt
- Aktiviert den Email-Versand von Aufnahmen.
+
recEmailTxt
- Aktiviert den Email-Versand von Aufnahmen.
Das Attribut hat das Format:
subject => <Betreff-Text>, body => <Mitteilung-Text>
Es können die Platzhalter $CAM, $DATE und $TIME verwendet werden.
- Der Email-Versand der letzten Aufnahme wird einamlig aktiviert falls der "recEmailTxt:"-Tag beim
- "on"-Kommando verwendet wird bzw. der in diesem Tag definierte Text statt des Textes im
+ Der Email-Versand der letzten Aufnahme wird einamlig aktiviert falls der "recEmailTxt:"-Tag beim
+ "on"-Kommando verwendet wird bzw. der in diesem Tag definierte Text statt des Textes im
Attribut "recEmailTxt" verwendet.
-
+
smtpHost
- Hostname oder IP-Adresse des Postausgangsservers (z.B. securesmtp.t-online.de)
@@ -15271,13 +15290,13 @@ http(s)://<hostname><port>/webapi/entry.cgi?api=SYNO.SurveillanceSta
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:
@@ -15291,9 +15310,9 @@ http(s)://<hostname><port>/webapi/entry.cgi?api=SYNO.SurveillanceSta
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.
+ Ein geringfügiger Unterschied zwischen den Pollingintervallen der definierten Kameras von z.B. 1s kann bereits als ausreichend angesehen werden.
cacheServerParam
Angabe der Verbindungsparameter zu einem zentralen Datencache.
-
+
redis
: bei Netzwerkverbindung: <IP-Adresse>:<Port> / bei Unix-Socket: <unix>:</path/zum/socket>
-
+
-
-
+
+
-
cacheType
- Legt den zu verwendenden Cache für die Speicherung von Schnappschüssen, Aufnahmen und anderen Massendaten fest.
+
cacheType
+ Legt den zu verwendenden Cache für die Speicherung von Schnappschüssen, Aufnahmen und anderen Massendaten fest.
(Default: internal).
Es müssen eventuell weitere Module installiert werden, z.B. mit Hilfe des FHEM Installers.
Die Daten werden in "Namespaces" gespeichert um die Nutzung zentraler Caches (redis) zu ermöglichen.
- Die Cache Typen "file" und "redis" bieten sich an, wenn die Daten nicht im RAM des FHEM-Servers gehalten werden sollen.
+ Die Cache Typen "file" und "redis" bieten sich an, wenn die Daten nicht im RAM des FHEM-Servers gehalten werden sollen.
Für die Verwendung von Redis ist zunächst ein Redis Key-Value Store bereitzustellen, z.B. in einem Docker-Image auf
der Synology Diskstation (redis).
: erstellt und verwendet eine Verzeichnisstruktur im Directory "FhemUtils"
redis
: Verwendet einen externen Redis Key-Value Store per TCP oder Unix-Socket. Siehe dazu Attribut "cacheServerParam".
-
+
-
-
+
+
-
debugactivetoken
- Wenn gesetzt, wird der Status des Active-Tokens gelogged - nur für Debugging, nicht im
- normalen Betrieb benutzen !
+
debugactivetoken
+ Wenn gesetzt, wird der Status des Active-Tokens gelogged - nur für Debugging, nicht im
+ normalen Betrieb benutzen !
-
+
-
debugCachetime
- Zeigt die verbrauchte Zeit für Cache-Operationen an.
+
debugCachetime
+ Zeigt die verbrauchte Zeit für Cache-Operationen an.
-
+
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")
-
+ Das Attribut enthält HTML-Tags zur Video-Spezifikation in einem Streaming-Device von Typ "generic".
+ (siehe "set <name> createStreamDev generic")
Die Variablen $HTMLATTR, $NAME und $PWS sind Platzhalter und übernehmen ein gesetztes Attribut "htmlattr", den SSCam-
- Devicenamen bzw. das Attribut "popupWindowSize" im Streaming-Device, welches die Größe eines Popup-Windows festlegt.
+ Devicenamen bzw. das Attribut "popupWindowSize" im Streaming-Device, welches die Größe eines Popup-Windows festlegt.
-
+
httptimeout
- Timeout-Wert für HTTP-Aufrufe zur Synology Surveillance Station.
+ Timeout-Wert für HTTP-Aufrufe zur Synology Surveillance Station.
(default: 20 Sekunden)
-
+
hlsNetScript (setzbar in Device Model "SVS")
- Wenn gesetzt, wird die aktuellste hls.js Version von der Projektseite verwendet (Internetverbindung nötig).
+ Wenn gesetzt, wird die aktuellste hls.js Version von der Projektseite verwendet (Internetverbindung nötig).
- Im Standard wird die lokal installierte Version (./fhem/www/pgm2/sscam_hls.js) zur Wiedergabe von Daten in allen
+ Im Standard wird die lokal installierte Version (./fhem/www/pgm2/sscam_hls.js) zur Wiedergabe von Daten in allen
Streaming Devices vom Typ "hls" genutzt (siehe "set <name> createStreamDev hls").
Dieses Attribut wird in einem Device vom Model "SVS" gesetzt und gilt zentral für alle Streaming Devices !
-
+
hlsStrmObject
- Wurde ein Streaming Device mit "set <name> createStreamDev hls" definiert, muss mit diesem Attribut der Link zum
+ Wurde ein Streaming Device mit "set <name> createStreamDev hls" definiert, muss mit diesem Attribut der Link zum
Wiedergabeobjekt bekannt gemacht werden.
Die Angabe muss ein HTTP Live Streaming Objekt mit der Endung ".m3u8" enthalten.
Die Variable $NAME kann als Platzhalter genutzt werden und übernimmt den SSCam-Devicenamen.
-
-
+
+
Beispiele:
attr <name> hlsStrmObject https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8
attr <name> hlsStrmObject https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8
# Beispielstreams der zum Test des Streaming Devices verwendet werden kann (Internetverbindung nötig)
-
+
attr <name> hlsStrmObject http://192.168.2.10:32000/CamHE1.m3u8
# Wiedergabe eines Kamera HLS-Streams der z.B. durch ffmpeg bereitgestellt wird
-
+
attr <name> hlsStrmObject http://192.168.2.10:32000/$NAME.m3u8
- # Wie obiges Beispiel mit der Variablennutzung für "CamHE1"
+ # Wie obiges Beispiel mit der Variablennutzung für "CamHE1"
-
-
+
+
htmlattr
- ergänzende Angaben zur Inline-Bilddarstellung um das Verhalten wie Bildgröße zu beeinflussen.
-
+ ergänzende Angaben zur Inline-Bilddarstellung um das Verhalten wie Bildgröße zu beeinflussen.
livestreamprefix
- Überschreibt die Angaben zu Protokoll, Servernamen und Port in StmKey.*-Readings bzw. der Livestreamadresse zur
+ Ü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:
+ Die Spezifikation kann auf zwei Arten erfolgen:
-
+
DEF
: es wird Protokoll, Servername und Port aus der Definition
des SSCam-Devices verwendet
@@ -15457,112 +15476,112 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
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 entfernt Quotes für SID bzw. der StmKeys.
+ Dieses Attribut entfernt Quotes für SID bzw. der StmKeys.
Es kann in bestimmten Fällen die Fehlermeldung "402 - permission denied" oder "105 - Insufficient user privilege"
vermeiden und ein login ermöglichen.
(default: 0)
-
-
+
+
pollcaminfoall
Intervall der automatischen Eigenschaftsabfrage (Polling) einer Kamera (<= 10: kein Polling, > 10: Polling mit Intervall)
-
+
pollnologging
- "0" bzw. nicht gesetzt = Logging Gerätepolling aktiv (default), "1" = Logging
+ "0" bzw. nicht gesetzt = Logging Gerätepolling aktiv (default), "1" = Logging
Gerätepolling inaktiv
-
-
+
+
ptzNoCapPrePat
- Manche PTZ-Kameras können trotz ihrer PTZ-Fähigkeiten keine Presets und Patrols speichern.
- Um Fehler und entsprechende Logmeldungen zu vermeiden, kann in diesen Fällen das Attribut ptzNoCapPrePat gesetzt
- werden. Dem System wird eine fehlende Preset / Patrol Fähigkeit mitgeteilt.
-
-
-
+ Manche PTZ-Kameras können trotz ihrer PTZ-Fähigkeiten keine Presets und Patrols speichern.
+ Um Fehler und entsprechende Logmeldungen zu vermeiden, kann in diesen Fällen das Attribut ptzNoCapPrePat gesetzt
+ werden. Dem System wird eine fehlende Preset / Patrol Fähigkeit mitgeteilt.
+
+
+
ptzPanel_Home
- Im PTZ-Steuerungspaneel wird dem Home-Icon (im Attribut "ptzPanel_row02") automatisch der Wert des Readings
+ 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.
-
-
-
+ 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".
+ 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.
Für weitere Information bitte "get <name> versionNotes 2,6" ausführen.
-
+
ptzPanel_iconPrefix
- Prefix für Icon-Dateien im PTZ-Steuerungspaneel, default ist "black_btn_".
+ 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.
+ 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"
+ 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
+ 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
+ Die Anzeige des PTZ-Steuerungspaneels in der Detailanzeige bzw. innerhalb eines generierten Streamdevice wird
ein- bzw. ausgeschaltet (default ein).
- Das PTZ-Panel benutzt einen eigenen Satz Icons.
- Damit das System sie finden kann, ist im FHEMWEB Device das Attribut "iconPath" um "sscam" zu ergänzen
+ Das PTZ-Panel benutzt einen eigenen Satz Icons.
+ Damit das System sie finden kann, ist im FHEMWEB Device das Attribut "iconPath" um "sscam" zu ergänzen
(z.B. "attr WEB iconPath default:fhemSVG:openautomation:sscam").
-
-
+
+
recChatTxt chatbot => <SSChatBot-Device>, peers => [<peer1 peer2 ...>], subject => [<Betreff-Text>]
Aktiviert den permanenten Versand von Aufnahmen nach deren Erstellung per Synology Chat.
- Vor der Aktivierung ist das Attribut videofolderMap zu setzen. Es muß eine URL zum
+ Vor der Aktivierung ist das Attribut videofolderMap zu setzen. Es muß eine URL zum
root-Verzeichnis der Aufnahmen und Schnappschüsse enthalten ( z.B. http://server.mein:8081/surveillance ).
- Das Attribut recChatTxt muß in der angegebenen Form definiert werden. Im Schlüssel "chatbot" ist das SSChatBot-Device
+ Das Attribut recChatTxt muß in der angegebenen Form definiert werden. Im Schlüssel "chatbot" ist das SSChatBot-Device
anzugeben, welches für den Versand der Daten verwendet werden soll.
Das SSChatBot-Device muss natürlich vorhanden und funktionstüchtig sein.
Der Schlüssel "peers" enthält gültige Namen von Synology Chat Nutzern an die die Nachricht gesendet werden soll.
- Die Angabe von "peers" ist optional, jedoch muß der Schlüssel (leer) angegeben werden.
+ Die Angabe von "peers" ist optional, jedoch muß der Schlüssel (leer) angegeben werden.
Wurde "peers" leer gelassen, wird der defaultPeer des SSChatBot-Devices verwendet.
-
+
Es können die folgenden Platzhalter im subject verwendet werden.
-
-
-
+
+
+
$CAM (#CAM)
- Device-Alias bzw. den Namen der Kamera in der SVS ersetzt falls der Device-Alias nicht vorhanden ist
-
-
+
+
+
Beispiele:
attr <device> recChatTxt chatbot => SynChatBot, peers => , subject => Bewegungsalarm ($FILE)
attr <device> recChatTxt chatbot => SynChatBot, peers => Frodo Sam Gollum, subject => Achtung
@@ -15586,9 +15605,9 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
Aktiviert den Emailversand von Aufnahmen nach deren Erstellung.
Das Attribut muß in der angegebenen Form definiert werden.
Es können die folgenden Platzhalter im subject bzw. body verwendet werden.
-
-
-
+
+
+
$CAM (#CAM)
- Device-Alias bzw. der Name der Kamera in der SVS falls der Device-Alias nicht vorhanden ist
- Filename der (letzten) Aufnahme (nur in body verwendbar)
$CTIME (#CTIME)
- Erstellungszeit des (letzten) Aufnahme (nur in body verwendbar)
-
+
-
+
Beispiel:
recEmailTxt subject => Neue Aufnahme $CAM, body => Die aktuelle Aufnahme von $CAM ist angehängt.
-
-
+
+
recTelegramTxt tbot => <TelegramBot-Device>, peers => [<peer1 peer2 ...>], subject => [<Text>], option => [silent]
Aktiviert den permanenten Versand von Aufnahmen nach deren Erstellung per TelegramBot.
- Das Attribut muß in der angegebenen Form definiert werden.
+ Das Attribut muß in der angegebenen Form definiert werden.
Bei optionalen Angaben muß der Schlüssel >leer< angegeben werden.
rectime
- festgelegte Aufnahmezeit wenn eine Aufnahme gestartet wird. Mit rectime = 0 wird eine
- Endlosaufnahme gestartet. Ist "rectime" nicht gesetzt, wird der Defaultwert von 15s
+ 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
+ "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
+ 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
- Es wird ein logisches "Downgrade" auf die angegebene SVS-Version ausgeführt. Das Attribut ist hilfreich um eventuell
+ Es wird ein logisches "Downgrade" auf die angegebene SVS-Version ausgeführt. Das Attribut ist hilfreich um eventuell
bei einem Update/Upgrade der Synology Surveillance Station auftretende Inkompatibilitäten temporär zu eliminieren.
Auftretende Inkompatibilitäten sollten zeitnah dem Maitainer mitgeteilt werden.
-
+
smtpHost <Hostname>
Gibt den Hostnamen oder die IP-Adresse des Postausgangsservers für den Emailversand an (z.B. securesmtp.t-online.de).
-
+
smtpCc <name>@<domain>[, <name>@<domain>][, <name>@<domain>]...
Optionale zusätzliche Empfängeradresse(n) für den Email-Versand. Mehrere Adressen müssen durch "," getrennt werden.
-
+
smtpDebug
Schaltet den Debugging-Modus der Verbindung zum Email-Server ein (wenn Email Versand verwendet wird).
-
+
smtpFrom <name>@<domain>
Absenderadresse bei Verwendung des Emailversands.
-
+
smtpPort <Port>
Optionale Angabe Standard-SMTP-Port des Postausgangsservers (default: 25).
-
+
smtpSSLPort <Port>
Optionale Angabe SSL Port des Postausgangsservers (default: 465). Ist dieses Attribut gesetzt, erfolgt die Verbindung zum
Email-Server sofort verschlüsselt.
-
-
+
+
smtpTo <name>@<domain>[, <name>@<domain>][, <name>@<domain>]...
Empfängeradresse(n) für den Email-Versand. Mehrere Adressen müssen durch "," getrennt werden.
-
+
smtpNoUseSSL
Soll keine Email SSL-Verschlüsselung genutzt werden, ist dieses Attribut auf "1" zu setzen (default: 0).
-
+
snapChatTxt chatbot => <SSChatBot-Device>, peers => [<peer1 peer2 ...>], subject => [<Betreff-Text>]
- Aktiviert den permanenten Versand von Schnappschüssen nach deren Erstellung per Synology Chat. Wurden mehrere Schnappschüsse ausgelöst,
+ Aktiviert den permanenten Versand von Schnappschüssen nach deren Erstellung per Synology Chat. Wurden mehrere Schnappschüsse ausgelöst,
werden sie sequentiell versendet.
- Vor der Aktivierung ist das Attribut videofolderMap zu setzen. Es muß eine URL zum
+ Vor der Aktivierung ist das Attribut videofolderMap zu setzen. Es muß eine URL zum
root-Verzeichnis der Aufnahmen und Schnappschüsse enthalten ( z.B. http://server.mein:8081/surveillance ).
- Das Attribut snapChatTxt muß in der angegebenen Form definiert werden. Im Schlüssel "chatbot" ist das SSChatBot-Device
- anzugeben, welches für den Versand der Daten verwendet werden soll.
+ Das Attribut snapChatTxt muß in der angegebenen Form definiert werden. Im Schlüssel "chatbot" ist das SSChatBot-Device
+ anzugeben, welches für den Versand der Daten verwendet werden soll.
Das SSChatBot-Device muss natürlich vorhanden und funktionstüchtig sein.
Der Schlüssel "peers" enthält gültige Namen von Synology Chat Nutzern an die die Nachricht gesendet werden soll.
- Die Angabe von "peers" ist optional, jedoch muß der Schlüssel (leer) angegeben werden.
+ Die Angabe von "peers" ist optional, jedoch muß der Schlüssel (leer) angegeben werden.
Wurde "peers" leer gelassen, wird der defaultPeer des SSChatBot-Devices verwendet.
-
+
Es können folgende Platzhalter im subject verwendet werden.
-
-
-
+
+
+
$CAM (#CAM)
- Device-Alias bzw. den Namen der Kamera in der SVS ersetzt falls der Device-Alias nicht vorhanden ist
snapEmailTxt subject => <Betreff-Text>, body => <Mitteilung-Text>
- Aktiviert den Emailversand von Schnappschüssen nach deren Erstellung. Wurden mehrere Schnappschüsse ausgelöst,
+ Aktiviert den Emailversand von Schnappschüssen nach deren Erstellung. Wurden mehrere Schnappschüsse ausgelöst,
werden sie gemeinsam in einer Mail versendet.
Das Attribut muß in der angegebenen Form definiert werden.
Es können die folgenden Platzhalter im subject bzw. body verwendet werden.
-
-
-
+
+
+
$CAM (#CAM)
- Device-Alias bzw. der Name der Kamera in der SVS falls der Device-Alias nicht vorhanden ist
- Filename des (letzten) Schnappschusses (nur in body verwendbar)
$CTIME (#CTIME)
- Erstellungszeit des (letzten) Schnappschusses (nur in body verwendbar)
-
-
-
+
+
+
Beispiel:
snapEmailTxt subject => Bewegungsalarm $CAM, body => Eine Bewegung wurde an der $CAM registriert.
-
+
snapTelegramTxt tbot => <TelegramBot-Device>, peers => [<peer1 peer2 ...>], subject => [<Betreff-Text>], option => [silent]
- Aktiviert den permanenten Versand von Schnappschüssen nach deren Erstellung per TelegramBot.
+ Aktiviert den permanenten Versand von Schnappschüssen nach deren Erstellung per TelegramBot.
Wurden mehrere Schnappschüsse ausgelöst, werden sie sequentiell versendet.
- Das Attribut muß in der angegebenen Form definiert werden.
+ Das Attribut muß in der angegebenen Form definiert werden.
Bei optionalen Angaben muß der Schlüssel >leer< angegeben werden.
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.
+ 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
+ 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.
snapReadingRotate 0...10
- Aktiviert die Versionierung von Schnappschußreadings (default: 0). Es wird eine fortlaufende Nummer der Readings
- "LastSnapFilename", "LastSnapId" und "LastSnapTime" bis zum eingestellten Wert von snapReadingRotate erzeugt und enthält
+ Aktiviert die Versionierung von Schnappschußreadings (default: 0). Es wird eine fortlaufende Nummer der Readings
+ "LastSnapFilename", "LastSnapId" und "LastSnapTime" bis zum eingestellten Wert von snapReadingRotate erzeugt und enthält
die Daten der letzten X Schnappschüsse.
-
+
showStmInfoFull
- zusaätzliche Streaminformationen wie LiveStreamUrl, StmKeyUnicst, StmKeymjpegHttp werden
+ zusaätzliche Streaminformationen wie LiveStreamUrl, StmKeyUnicst, StmKeymjpegHttp werden
ausgegeben
-
+
showPassInLog
- Wenn gesetzt, wird das verwendete Passwort im Logfile mit verbose 4 angezeigt.
+ 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
+ Ersetzt den Inhalt des Readings "VideoFolder". Verwendung z.B. bei gemounteten
Verzeichnissen oder URL-Bereitstellung durch einen Webserver.
-
+
verbose
-
+
Es werden verschiedene Verbose-Level unterstützt.
Dies sind im Einzelnen:
-
-
@@ -15921,7 +15944,7 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
Ü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)