mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
49_SSCam: contrib 9.10.7
git-svn-id: https://svn.fhem.de/fhem/trunk@26270 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
f299e404c8
commit
996f7596c8
@ -185,7 +185,7 @@ BEGIN {
|
|||||||
|
|
||||||
# Versions History intern
|
# Versions History intern
|
||||||
my %vNotesIntern = (
|
my %vNotesIntern = (
|
||||||
"9.10.7" => "27.07.2022 allow placeholders #CAM, #DATE, #TIME, #FILE, #CTIME ",
|
"9.10.7" => "29.07.2022 allow placeholders #CAM, #DATE, #TIME, #FILE, #CTIME (also for Email) ",
|
||||||
"9.10.6" => "18.07.2022 textField-long property set for recChatTxt, recEmailTxt, recTelegramTxt, snapChatTxt, snapEmailTxt, snapTelegramTxt, ".
|
"9.10.6" => "18.07.2022 textField-long property set for recChatTxt, recEmailTxt, recTelegramTxt, snapChatTxt, snapEmailTxt, snapTelegramTxt, ".
|
||||||
"set 'part1type' to default => text/html instead of text/plain",
|
"set 'part1type' to default => text/html instead of text/plain",
|
||||||
"9.10.5" => "01.07.2022 fix noQuotesForSID using in streaming devices type mjpeg ",
|
"9.10.5" => "01.07.2022 fix noQuotesForSID using in streaming devices type mjpeg ",
|
||||||
@ -10844,6 +10844,7 @@ sub __sendEmailblocking { ##
|
|||||||
}
|
}
|
||||||
|
|
||||||
$subject = decode_utf8($subject);
|
$subject = decode_utf8($subject);
|
||||||
|
|
||||||
my $mailmsg = MIME::Lite->new(
|
my $mailmsg = MIME::Lite->new(
|
||||||
From => $from,
|
From => $from,
|
||||||
To => $to,
|
To => $to,
|
||||||
@ -10851,15 +10852,10 @@ sub __sendEmailblocking { ##
|
|||||||
Type => 'multipart/mixed', #'multipart/mixed', # was 'text/plain'
|
Type => 'multipart/mixed', #'multipart/mixed', # was 'text/plain'
|
||||||
);
|
);
|
||||||
|
|
||||||
### Add the text message part:
|
|
||||||
### (Note that "attach" has same arguments as "new"):
|
|
||||||
$part1txt = decode_utf8($part1txt);
|
$part1txt = decode_utf8($part1txt);
|
||||||
$mailmsg->attach(
|
|
||||||
Type => $part1type,
|
|
||||||
Data => $part1txt,
|
|
||||||
);
|
|
||||||
|
|
||||||
### Add image, Das Image liegt bereits als File vor
|
### Add image, Das Image liegt bereits als File vor
|
||||||
|
####################################################
|
||||||
if($image) {
|
if($image) {
|
||||||
$mailmsg->attach(
|
$mailmsg->attach(
|
||||||
Type => $part2type,
|
Type => $part2type,
|
||||||
@ -10886,8 +10882,20 @@ sub __sendEmailblocking { ##
|
|||||||
Filename => $fname,
|
Filename => $fname,
|
||||||
Disposition => 'attachment',
|
Disposition => 'attachment',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
my $params = {
|
||||||
|
hash => $hash,
|
||||||
|
name => $name,
|
||||||
|
txt => $part1txt,
|
||||||
|
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 {
|
else {
|
||||||
@ -10914,8 +10922,20 @@ sub __sendEmailblocking { ##
|
|||||||
Filename => $fname,
|
Filename => $fname,
|
||||||
Disposition => 'attachment',
|
Disposition => 'attachment',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
my $params = {
|
||||||
|
hash => $hash,
|
||||||
|
name => $name,
|
||||||
|
txt => $part1txt,
|
||||||
|
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);
|
BlockingInformParent("FHEM::SSCam::subaddFromBlocking", [$name, "-", $tac], 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -10935,8 +10955,20 @@ sub __sendEmailblocking { ##
|
|||||||
Filename => $fname,
|
Filename => $fname,
|
||||||
Disposition => 'attachment',
|
Disposition => 'attachment',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
my $params = {
|
||||||
|
hash => $hash,
|
||||||
|
name => $name,
|
||||||
|
txt => $part1txt,
|
||||||
|
fname => $fname,
|
||||||
|
ct => $ct
|
||||||
|
};
|
||||||
|
|
||||||
|
$part1txt = __extractForEmail ($params);
|
||||||
|
|
||||||
Log3($name, 4, "$name - Video data sequence [$key] decoded from internal Cache for Email attachment");
|
Log3($name, 4, "$name - Video data sequence [$key] decoded from internal Cache for Email attachment");
|
||||||
}
|
}
|
||||||
|
|
||||||
BlockingInformParent("FHEM::SSCam::subaddFromBlocking", [$name, "-", $tac], 0);
|
BlockingInformParent("FHEM::SSCam::subaddFromBlocking", [$name, "-", $tac], 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -10963,12 +10995,31 @@ sub __sendEmailblocking { ##
|
|||||||
Filename => $fname,
|
Filename => $fname,
|
||||||
Disposition => 'attachment',
|
Disposition => 'attachment',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
my $params = {
|
||||||
|
hash => $hash,
|
||||||
|
name => $name,
|
||||||
|
txt => $part1txt,
|
||||||
|
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');
|
$mailmsg->attr('content-type.charset' => 'UTF-8');
|
||||||
|
|
||||||
##### SMTP-Connection #####
|
##### SMTP-Connection #####
|
||||||
@ -11088,6 +11139,22 @@ sub __sendEmailblocking { ##
|
|||||||
return "$name|''|$ret";
|
return "$name|''|$ret";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
####################################################################################################
|
||||||
|
# Daten extrahieren für Email Versand
|
||||||
|
####################################################################################################
|
||||||
|
sub __extractForEmail {
|
||||||
|
my $paref = shift;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
####################################################################################################
|
####################################################################################################
|
||||||
# Auswertungsroutine nichtblockierendes Send EMail
|
# Auswertungsroutine nichtblockierendes Send EMail
|
||||||
####################################################################################################
|
####################################################################################################
|
||||||
@ -13411,15 +13478,17 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
|
|||||||
<a name="recEmailTxt"></a>
|
<a name="recEmailTxt"></a>
|
||||||
<li><b>recEmailTxt subject => <subject text>, body => <message text> </b><br>
|
<li><b>recEmailTxt subject => <subject text>, body => <message text> </b><br>
|
||||||
Activates the Email shipping of recordings after whose creation. <br>
|
Activates the Email shipping of recordings after whose creation. <br>
|
||||||
The attribute has to be definied in the form as described. <br>
|
The attribute must be defined in the specified form. <br>
|
||||||
You can use the following placeholders in "subject" and "body". <br><br>
|
The following placeholders can be used in the subject or body. <br><br>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<table>
|
<table>
|
||||||
<colgroup> <col width=10%> <col width=90%> </colgroup>
|
<colgroup> <col width=10%> <col width=90%> </colgroup>
|
||||||
<tr><td> $CAM </td><td>- Device alias respectively the name of the camera in SVS if the device alias isn't set </td></tr>
|
<tr><td> $CAM </td><td>- Device alias respectively the name of the camera in SVS if the device alias isn't set </td></tr>
|
||||||
<tr><td> $DATE </td><td>- current date </td></tr>
|
<tr><td> $DATE </td><td>- current date </td></tr>
|
||||||
<tr><td> $TIME </td><td>- aktuelle time </td></tr>
|
<tr><td> $TIME </td><td>- aktuelle time </td></tr>
|
||||||
|
<tr><td> $FILE </td><td>- Filename of the (last) recording (only usable in body) </td></tr>
|
||||||
|
<tr><td> $CTIME </td><td>- Creation time of the (last) recording (only usable in body) </td></tr>
|
||||||
</table>
|
</table>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
@ -13576,8 +13645,8 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
|
|||||||
<a name="snapEmailTxt"></a>
|
<a name="snapEmailTxt"></a>
|
||||||
<li><b>snapEmailTxt subject => <subject text>, body => <message text> </b><br>
|
<li><b>snapEmailTxt subject => <subject text>, body => <message text> </b><br>
|
||||||
Activates the Email shipping of snapshots after whose creation. <br>
|
Activates the Email shipping of snapshots after whose creation. <br>
|
||||||
The attribute has to be defined in the form as described. <br>
|
The attribute must be defined in the specified form. <br>
|
||||||
You can use the following placeholders in "subject" and "body". <br><br>
|
The following placeholders can be used in the subject or body. <br><br>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<table>
|
<table>
|
||||||
@ -13585,6 +13654,8 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
|
|||||||
<tr><td> $CAM </td><td>- Device alias respectively the name of the camera in SVS if the device alias isn't set </td></tr>
|
<tr><td> $CAM </td><td>- Device alias respectively the name of the camera in SVS if the device alias isn't set </td></tr>
|
||||||
<tr><td> $DATE </td><td>- current date </td></tr>
|
<tr><td> $DATE </td><td>- current date </td></tr>
|
||||||
<tr><td> $TIME </td><td>- current time </td></tr>
|
<tr><td> $TIME </td><td>- current time </td></tr>
|
||||||
|
<tr><td> $FILE </td><td>- Filename of the (last) snapshot (only usable in body) </td></tr>
|
||||||
|
<tr><td> $CTIME </td><td>- Creation time of the (last) snapshot (only usable in body) </td></tr>
|
||||||
</table>
|
</table>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
@ -15440,14 +15511,16 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
|
|||||||
<li><b>recEmailTxt subject => <Betreff-Text>, body => <Mitteilung-Text> </b><br>
|
<li><b>recEmailTxt subject => <Betreff-Text>, body => <Mitteilung-Text> </b><br>
|
||||||
Aktiviert den Emailversand von Aufnahmen nach deren Erstellung. <br>
|
Aktiviert den Emailversand von Aufnahmen nach deren Erstellung. <br>
|
||||||
Das Attribut muß in der angegebenen Form definiert werden. <br>
|
Das Attribut muß in der angegebenen Form definiert werden. <br>
|
||||||
Es können die folgenden Platzhalter im subject und body verwendet werden. <br><br>
|
Es können die folgenden Platzhalter im subject bzw. body verwendet werden. <br><br>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<table>
|
<table>
|
||||||
<colgroup> <col width=10%> <col width=90%> </colgroup>
|
<colgroup> <col width=10%> <col width=90%> </colgroup>
|
||||||
<tr><td> $CAM </td><td>- Device-Alias bzw. der Name der Kamera in der SVS falls der Device-Alias nicht vorhanden ist </td></tr>
|
<tr><td> $CAM </td><td>- Device-Alias bzw. der Name der Kamera in der SVS falls der Device-Alias nicht vorhanden ist </td></tr>
|
||||||
<tr><td> $DATE </td><td>- aktuelles Datum </td></tr>
|
<tr><td> $DATE </td><td>- aktuelles Datum </td></tr>
|
||||||
<tr><td> $TIME </td><td>- aktuelle Zeit </td></tr>
|
<tr><td> $TIME </td><td>- aktuelle Zeit </td></tr>
|
||||||
|
<tr><td> $FILE </td><td>- Filename der (letzten) Aufnahme (nur in body verwendbar) </td></tr>
|
||||||
|
<tr><td> $CTIME </td><td>- Erstellungszeit des (letzten) Aufnahme (nur in body verwendbar) </td></tr>
|
||||||
</table>
|
</table>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
@ -15607,14 +15680,16 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
|
|||||||
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. <br>
|
werden sie gemeinsam in einer Mail versendet. <br>
|
||||||
Das Attribut muß in der angegebenen Form definiert werden. <br>
|
Das Attribut muß in der angegebenen Form definiert werden. <br>
|
||||||
Es können die folgenden Platzhalter im subject und body verwendet werden. <br><br>
|
Es können die folgenden Platzhalter im subject bzw. body verwendet werden. <br><br>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<table>
|
<table>
|
||||||
<colgroup> <col width=10%> <col width=90%> </colgroup>
|
<colgroup> <col width=10%> <col width=90%> </colgroup>
|
||||||
<tr><td> $CAM </td><td>- Device-Alias bzw. der Name der Kamera in der SVS falls der Device-Alias nicht vorhanden ist </td></tr>
|
<tr><td> $CAM </td><td>- Device-Alias bzw. der Name der Kamera in der SVS falls der Device-Alias nicht vorhanden ist </td></tr>
|
||||||
<tr><td> $DATE </td><td>- aktuelles Datum </td></tr>
|
<tr><td> $DATE </td><td>- aktuelles Datum </td></tr>
|
||||||
<tr><td> $TIME </td><td>- aktuelle Zeit </td></tr>
|
<tr><td> $TIME </td><td>- aktuelle Zeit </td></tr>
|
||||||
|
<tr><td> $FILE </td><td>- Filename des (letzten) Schnappschusses (nur in body verwendbar) </td></tr>
|
||||||
|
<tr><td> $CTIME </td><td>- Erstellungszeit des (letzten) Schnappschusses (nur in body verwendbar) </td></tr>
|
||||||
</table>
|
</table>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
|
Loading…
Reference in New Issue
Block a user