diff --git a/fhem/contrib/DS_Starter/49_SSCam.pm b/fhem/contrib/DS_Starter/49_SSCam.pm
index c685eb6fd..bcbc9aef3 100644
--- a/fhem/contrib/DS_Starter/49_SSCam.pm
+++ b/fhem/contrib/DS_Starter/49_SSCam.pm
@@ -47,7 +47,7 @@ use Encode;
# Versions History intern
our %SSCam_vNotesIntern = (
- "8.5.0" => "20.01.2019 SVS device set snapAllCams ",
+ "8.5.0" => "17.01.2019 SVS device set snapAllCams ",
"8.4.5" => "15.01.2019 fix event generation after request snapshots ",
"8.4.4" => "14.01.2019 change: generate event of every snapfile,id etc. if snap was called with arguments, Forum:#45671 #msg887484 ",
"8.4.3" => "11.01.2019 fix blocking Active-Token if snap was done with arguments and snapEmailTxt not set, Forum:#45671 #msg885475 ",
@@ -766,14 +766,15 @@ sub SSCam_Set($@) {
my ($num,$lag,$ncount) = (1,2,1);
my $emtxt = "";
- if($prop && $prop =~ /[\d+]/) { # Anzahl der Schnappschüsse zu triggern (default: 1)
+ if($prop && $prop =~ /^\d+$/) { # Anzahl der Schnappschüsse zu triggern (default: 1)
$num = $prop;
$ncount = $prop;
}
- if($prop1 && $prop1 =~ /[\d+]/) { # Zeit zwischen zwei Schnappschüssen (default: 2 Sekunden)
+ if($prop1 && $prop1 =~ /^\d+$/) { # Zeit zwischen zwei Schnappschüssen (default: 2 Sekunden)
$lag = $prop1;
}
-
+
+ Log3($name, 4, "$name - Trigger snapshots - Number: $num, Lag: $lag");
$hash->{HELPER}{SNAPBYSTRMDEV} = 1 if ($prop2 && $prop2 =~ /STRM/); # $prop wird mitgegeben durch Snap by SSCamSTRM-Device
my $at = join(" ",@a);
@@ -795,11 +796,11 @@ sub SSCam_Set($@) {
my ($num,$lag,$ncount) = (1,2,1);
my $cams = "all";
my $emtxt = '';
- if($prop && $prop =~ /[\d+]/) { # Anzahl der Schnappschüsse zu triggern (default: 1)
+ if($prop && $prop =~ /^\d+$/) { # Anzahl der Schnappschüsse zu triggern (default: 1)
$num = $prop;
$ncount = $prop;
}
- if($prop1 && $prop1 =~ /[\d+]/) { # Zeit zwischen zwei Schnappschüssen (default: 2 Sekunden)
+ if($prop1 && $prop1 =~ /^\d+$/) { # Zeit zwischen zwei Schnappschüssen (default: 2 Sekunden)
$lag = $prop1;
}
@@ -811,30 +812,39 @@ sub SSCam_Set($@) {
}
my @camdvs;
- my %snapac = (); # Schnappschuss Hash für alle Cams -> Schnappschudaten sollen hinein
-
+ my %snapac = (); # Schnappschuss Hash für alle Cams -> Schnappschudaten sollen hinein
if($cams eq "all") { # alle nicht disabled Kameras auslösen, sonst nur die gewählten
@camdvs = devspec2array("TYPE=SSCam:FILTER=MODEL!=SVS");
foreach (@camdvs) {
- if(!IsDisabled($_)) {
+ if($defs{$_} && !IsDisabled($_)) {
$snapac{$_} = "";
}
}
} else {
@camdvs = split(",",$cams);
foreach (@camdvs) {
- if(!IsDisabled($_)) {
+ if($defs{$_} && !IsDisabled($_)) {
$snapac{$_} = "";
}
}
}
+ return "No valid camera devices are specified for trigger snapshots" if(!%snapac);
+
my $asref = \%snapac;
$hash->{HELPER}{ALLSNAPREF} = $asref;
+ my ($csnap,$cmail) = ("","");
foreach my $key (keys%{$asref}) {
- delete $asref->{$key} if(!AttrVal($key, "snapEmailTxt", "")); # Snap dieser Kamera auslösen aber nicht senden
- SSCam_camsnap("$key:$num:$lag:$ncount:$emtxt");
+ if(!AttrVal($key, "snapEmailTxt", "")) {
+ delete $asref->{$key}; # Snap dieser Kamera auslösen aber nicht senden
+ $csnap .= $csnap?", $key":$key;
+ } else {
+ $cmail .= $cmail?", $key":$key;
+ }
+ SSCam_camsnap("$key:$num:$lag:$ncount:$emtxt");
}
+ Log3($name, 4, "$name - Trigger snapshots by SVS - Number: $num, Lag: $lag, Snap only: \"$csnap\", Snap and send: \"$cmail\" ");
+
} elsif ($opt eq "startTracking" && SSCam_IsModelCam($hash)) {
if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
@@ -7798,8 +7808,40 @@ return ($str);
# Hint Hash EN
#############################################################################################
%SSCam_vHintsExt_en = (
+ "7" => "Setup Email Shipping
".
+ "====================
".
+ "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:".
+ "
".
+ "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 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)
".
+ "- smtpFrom - Return address (<name>@<domain>)
".
+ "- smtpTo - Receiving address(es) (<name>@<domain>)
".
+ "- smtpPort - (optional) Port of outgoing Email server (default: 25)
".
+ "- smtpCc - (optional) carbon-copy receiving address(es) (<name>@<domain>)
".
+ "- 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:
".
- "- in FHEMWEB device attribute iconPath complete with \"sscam\", e.g.: attr WEB iconPath default:fhemSVG:openautomation:sscam
".
+ "- in FHEMWEB device attribute iconPath complete with \"sscam\". e.g.: attr WEB iconPath default:fhemSVG:openautomation:sscam
".
"After that execute \"rereadicons\" or restart FHEM. ".
"
",
"5" => "Find more Informations about manage users and the appropriate privilege profiles in ".
@@ -7859,7 +7901,7 @@ return ($str);
"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:
".
- "- im FHEMWEB Device Attribut iconPath um \"sscam\" ergänzen, z.B.: attr WEB iconPath default:fhemSVG:openautomation:sscam
".
+ "- im FHEMWEB Device Attribut iconPath um \"sscam\" ergänzen. z.B.: attr WEB iconPath default:fhemSVG:openautomation:sscam
".
"Danach ein \"rereadicons\" bzw. einen FHEM restart ausführen.".
"
",
"5" => "Informationen zum Management von Usern und entsprechenden Rechte-Profilen sind in der ".
@@ -8661,52 +8703,46 @@ attr <name> genericStrmHtmlTag <video $HTMLATTR controls autoplay>
set <name> snap [<number>] [<time difference>] [snapEmailTxt:"subject => <subject text>, body => <message text>"] (valid for CAM)
One or multiple snapshots are triggered. The number of snapshots to trigger and the time difference (in seconds) between
- each snapshots 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 "LastSnapFilename" of the
- device.
- The snapshot Email shipping is activated by setting the attribute "snapEmailTxt". If you want
- temporary overwrite the message text set in "snapEmailTxt", you can optionally specify the "snapEmailTxt:"-tag as shown
- above.
+ 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 "LastSnapFilename".
+
- Email shipping preparation
+ 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
+ "snapEmailTxt:"-tag as shown above.
- The 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:
-
-
- sudo apt-get install libmime-lite-perl
-
-
+ Examples:
+
+ set <name> snap 4
+ set <name> snap 3 3 snapEmailTxt:"subject => Movement alarm $CAM, body => A movement was recognised at Carport"
+
+
+
- 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.
- If attribute "smtpSSLPort" is defined, the established connection to the Email server will be encrypted immediately.
- Attributes which are optional are marked:
+
+ - set <name> snapCams [<number>] [<time difference>] [CAM:"<camera>, <camera>, ..."] (valid for SVS)
-
-
-
- snapEmailTxt | - Activates the Email shipping. Has the form:
- subject => <subject text>, body => <message text>
- The placeholder variables $CAM, $DATE and $TIME can be used. $CAM is
- replaced by the 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 of outgoing Email server (e.g. securesmtp.t-online.de) |
- smtpFrom | - Return address (<name>@<domain>) |
- smtpTo | - Receiving address(es) (<name>@<domain>) |
- smtpPort | - (optional) Port of outgoing Email server (default: 25) |
- smtpCc | - (optional) carbon-copy receiving address(es) (<name>@<domain>) |
- 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.
+ 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.
+ (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
+ those attribute in the camera devices is ignored !!
+
+ Examples:
+
+ set <name> snapCams 4
+ set <name> snapCams 3 3 CAM:"CamHE1, CamCarport"
+
@@ -8941,7 +8977,51 @@ http(s)://<hostname><port>/webapi/entry.cgi?api=SYNO.SurveillanceSta
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 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:
+
+
+ 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.
+ 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 of outgoing Email server (e.g. securesmtp.t-online.de) |
+ smtpFrom | - Return address (<name>@<domain>) |
+ smtpTo | - Receiving address(es) (<name>@<domain>) |
+ smtpPort | - (optional) Port of outgoing Email server (default: 25) |
+ smtpCc | - (optional) carbon-copy receiving address(es) (<name>@<domain>) |
+ 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.
+
+
@@ -10216,8 +10296,13 @@ attr <name> genericStrmHtmlTag <video $HTMLATTR controls autoplay>
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
- gezeigt, temporär überschrieben bzw. geändert werden.
-
+ gezeigt, temporär überschrieben bzw. geändert werden.
+
+ Beispiele:
+
+ set <name> snap 4
+ set <name> snap 3 3 snapEmailTxt:"subject => Bewegungsalarm $CAM, body => Eine Bewegung wurde am Carport registriert"
+
@@ -10232,10 +10317,18 @@ attr <name> genericStrmHtmlTag <video $HTMLATTR controls autoplay>
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.
+ 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 verwendet. Der Text im
- Attribut "snapEmailTxt" der einzelnen Kameras wird ignoriert !!
+ 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 3 3 CAM:"CamHE1, CamCarport"
+
+