From 2aa0a89263ea3989593c0b587e4f4a91a060cfc7 Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Sun, 22 Jan 2023 15:07:12 +0000 Subject: [PATCH] 49_SSCAM: contrib 9.10.9 git-svn-id: https://svn.fhem.de/fhem/trunk@27100 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/DS_Starter/49_SSCam.pm | 212 +++++++++++++++------------- 1 file changed, 112 insertions(+), 100 deletions(-) diff --git a/fhem/contrib/DS_Starter/49_SSCam.pm b/fhem/contrib/DS_Starter/49_SSCam.pm index 3f9b2a40b..cdf27eb03 100644 --- a/fhem/contrib/DS_Starter/49_SSCam.pm +++ b/fhem/contrib/DS_Starter/49_SSCam.pm @@ -1,9 +1,9 @@ ######################################################################################################################## -# $Id: 49_SSCam.pm 26244 2022-07-18 16:49:55Z DS_Starter $ +# $Id: 49_SSCam.pm 27053 2023-01-14 13:00:46Z DS_Starter $ ######################################################################################################################### # 49_SSCam.pm # -# (c) 2015-2022 by Heiko Maaz +# (c) 2015-2023 by Heiko Maaz # e-mail: Heiko dot Maaz at t-online dot de # # This Module can be used to operate Cameras defined in Synology Surveillance Station 7.0 or higher. @@ -185,7 +185,9 @@ BEGIN { # Versions History intern my %vNotesIntern = ( - "9.10.7" => "29.07.2022 allow placeholders #CAM, #DATE, #TIME, #FILE, #CTIME (also for Email) ", + "9.10.9" => "22.01.2023 substitution of \$#TIME corrected ", + "9.10.8" => "14.01.2023 add blank line in setter runView, goPreset, runPatrol ", + "9.10.7" => "02.08.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, ". "set 'part1type' to default => text/html instead of text/plain", "9.10.5" => "01.07.2022 fix noQuotesForSID using in streaming devices type mjpeg ", @@ -1578,30 +1580,31 @@ sub Set { } elsif(IsModelCam($hash)) { # selist für Cams my $hlslfw = IsCapHLS($hash) ? ",live_fw_hls," : ","; + $setlist = "Unknown argument $opt, choose one of ". + "createSnapGallery:noArg ". + "createStreamDev:generic,hls,lastsnap,mjpeg,switched ". + "createReadingsGroup ". "credentials ". - "smtpcredentials ". + "disable:noArg ". + "enable:noArg ". "expmode:auto,day,night ". - "on ". - "off:noArg ". "motdetsc:disable,camera,SVS ". "snap ". (AttrVal($name, "snapGalleryBoost",0) ? (AttrVal($name,"snapGalleryNumber",undef) || AttrVal($name,"snapGalleryBoost",0)) ? "snapGallery:noArg " : "snapGallery:$defSnum " : " "). - "createReadingsGroup ". - "createSnapGallery:noArg ". - "createStreamDev:generic,hls,lastsnap,mjpeg,switched ". - "enable:noArg ". - "disable:noArg ". + "on ". + "off:noArg ". "optimizeParams ". - "runView:live_fw".$hlslfw."live_link,live_open,lastrec_fw,lastrec_fw_MJPEG,lastrec_fw_MPEG4/H.264,lastrec_open,lastsnap_fw ". + "runView:#,live_fw".$hlslfw."live_link,live_open,lastrec_fw,lastrec_fw_MJPEG,lastrec_fw_MPEG4/H.264,lastrec_open,lastsnap_fw ". "stopView:noArg ". + "smtpcredentials ". (IsCapPTZObjTrack($hash) ? "startTracking:noArg " : ""). (IsCapPTZObjTrack($hash) ? "stopTracking:noArg " : ""). (IsCapPTZPan($hash) ? "setPreset ": ""). (IsCapPTZPan($hash) ? "setHome:---currentPosition---,".ReadingsVal("$name","Presets","")." " : ""). (IsCapPTZPan($hash) ? "delPreset:".ReadingsVal("$name","Presets","")." " : ""). - (IsCapPTZPan($hash) ? "runPatrol:".ReadingsVal("$name", "Patrols", "")." " : ""). - (IsCapPTZPan($hash) ? "goPreset:".ReadingsVal("$name", "Presets", "")." " : ""). + (IsCapPTZPan($hash) ? "runPatrol:#,".ReadingsVal("$name", "Patrols", "")." " : ""). + (IsCapPTZPan($hash) ? "goPreset:#,".ReadingsVal("$name", "Presets", "")." " : ""). (IsCapPTZ($hash) ? "createPTZcontrol:noArg " : ""). (IsCapPTZAbs($hash) ? "goAbsPTZ"." " : ""). (IsCapPTZDir($hash) ? "move"." " : ""). @@ -2566,7 +2569,7 @@ sub _setrunView { ## no critic "not used" my $prop = $paref->{prop}; my $prop1 = $paref->{prop1}; - return if(!IsModelCam($hash)); + return if(!IsModelCam($hash) || !$prop); my $spec = join " ", @$aref; if($spec =~ /STRM:/x) { @@ -6281,7 +6284,7 @@ sub _parsegethomemodestate { ## no critic "not used" my $name = $paref->{name}; my $data = $paref->{data}; - my $lang = AttrVal("global","language","EN"); + my $lang = AttrVal('global', 'language', 'EN'); my $hmst = $data->{'data'}{'on'}; my $hmststr = $hmst == 1 ? "on" : "off"; @@ -9103,12 +9106,13 @@ sub ptzPanel { my $ftui = $paref->{ftui}; my $hash = $defs{$name}; - my $iconpath = AttrVal ("$name", "ptzPanel_iconPath", "www/images/sscam"); - my $iconprefix = AttrVal ("$name", "ptzPanel_iconPrefix", "black_btn_" ); - my $valPresets = ReadingsVal("$name", "Presets", "" ); - my $valPatrols = ReadingsVal("$name", "Patrols", "" ); + my $iconpath = AttrVal ("$name", 'ptzPanel_iconPath', 'www/images/sscam'); + my $iconprefix = AttrVal ("$name", 'ptzPanel_iconPrefix', 'black_btn_'); + my $valPresets = '#,'.ReadingsVal("$name", 'Presets', ''); + my $valPatrols = '#,'.ReadingsVal("$name", 'Patrols', ''); my $rowisset = 0; my ($pbs,$pbsf) = ("",""); + my ($row,$ptz_ret); return "" if(myVersion($hash) <= 71); @@ -9135,9 +9139,10 @@ sub ptzPanel { $rownr = sprintf("%2.2d",$rownr); $row = AttrVal("$name","ptzPanel_row$rownr",undef); next if (!$row); + $rowisset = 1; $ptz_ret .= ""; - my @btn = split (",",$row); # die Anzahl Buttons in einer Reihe + my @btn = split (",",$row); # die Anzahl Buttons in einer Reihe for my $btnnr (0..$#btn) { $ptz_ret .= ""; @@ -9205,6 +9210,7 @@ sub ptzPanel { } else { # $FW_ME = URL-Pfad unter dem der FHEMWEB-Server via HTTP erreichbar ist, z.B. /fhem my $iPath = FW_iconPath($img); # automatisches Suchen der Icons im FHEMWEB iconPath + if($iPath) { $iPath = "$FW_ME/$FW_icondir/$iPath"; } @@ -9224,7 +9230,6 @@ sub ptzPanel { $cmd1 = "ftui.setFhemStatus('set $name setZoom $cmd')" if($ftui); $ptz_ret .= "$img"; - $ptz_ret .= ""; } @@ -9293,7 +9298,7 @@ sub ptzPanel { return $ptz_ret; } else { - return ""; + return ''; } } @@ -10107,7 +10112,7 @@ sub _prepSendTelegram { $subjt = trim($subjt); $subjt =~ s/[\$#]CAM/$calias/gx; $subjt =~ s/[\$#]DATE/$date/gx; - $subjt =~ s/\[\$#]TIME/$time/gx; + $subjt =~ s/[\$#]TIME/$time/gx; } my %telemsg = (); @@ -10912,10 +10917,12 @@ sub __sendEmailblocking { ## for my $key (@unique) { # attach mail 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); + $mailmsg->attach( Type => $part2type, Data => $decoded, @@ -10949,6 +10956,7 @@ sub __sendEmailblocking { ## $ct = delete $vdat->{$key}{createdTm}; $video = delete $vdat->{$key}{imageData}; $fname = delete $vdat->{$key}{fileName}; + $mailmsg->attach( Type => $part2type, Data => $video, @@ -10986,9 +10994,11 @@ sub __sendEmailblocking { ## # attach mail for my $key (@unique) { 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}"); + $mailmsg->attach( Type => $part2type, Data => $video, @@ -13457,12 +13467,12 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
@@ -13483,12 +13493,12 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
@@ -13513,12 +13523,12 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
@@ -13624,12 +13634,12 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
@@ -13650,12 +13660,12 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
@@ -13681,12 +13691,12 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR
@@ -14510,10 +14520,12 @@ attr <name> genericStrmHtmlTag <img $HTMLATTR