From 70a2e6bc9ca67a0cd88e4a21a6cdd2198e1d5b35 Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Sat, 1 Jun 2019 13:25:55 +0000 Subject: [PATCH] 49_SSCam: contrib 8.14.0 git-svn-id: https://svn.fhem.de/fhem/trunk@19520 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/DS_Starter/49_SSCam.pm | 107 +++++++++++++++++++++++++--- 1 file changed, 99 insertions(+), 8 deletions(-) diff --git a/fhem/contrib/DS_Starter/49_SSCam.pm b/fhem/contrib/DS_Starter/49_SSCam.pm index 6b7a90967..ac6a18af3 100644 --- a/fhem/contrib/DS_Starter/49_SSCam.pm +++ b/fhem/contrib/DS_Starter/49_SSCam.pm @@ -1,5 +1,5 @@ ######################################################################################################################## -# $Id: 49_SSCam.pm 19280 2019-04-28 17:20:21Z DS_Starter $ +# $Id: 49_SSCam.pm 19470 2019-05-26 20:37:39Z DS_Starter $ ######################################################################################################################### # 49_SSCam.pm # @@ -48,6 +48,8 @@ eval "use FHEM::Meta;1" or my $modMetaAbsent = 1; # Versions History intern our %SSCam_vNotesIntern = ( + "8.14.0" => "01.06.2019 Link to Cam/SVS-Setup Screen and online help in Detailview ", + "8.13.6" => "26.05.2019 enhanced log entries of snapinfos with debugactivetoken ", "8.13.5" => "23.05.2019 StmKey quoted depending on attr noQuotesForSID (Forum: https://forum.fhem.de/index.php/topic,45671.msg938236.html#msg938236), ". "autoplay muted of hls-StreamDev", "8.13.4" => "21.05.2019 rec/snapemailtxt, rec/snaptelegramtxt can contain \":\", commandref revised ", @@ -148,6 +150,7 @@ our %SSCam_vNotesIntern = ( # Versions History extern our %SSCam_vNotesExtern = ( + "8.14.0" => "01.06.2019 In detailview now there are buttons to open the camera setup screen or Synology Surveillance Station and the Synology Surveillance Station online help. ", "8.12.0" => "25.03.2019 Delay FHEM shutdown as long as sessions are not terminated, but not longer than global attribute \"maxShutdownDelay\". ", "8.11.0" => "25.02.2019 compatibility set to SVS version 8.2.3, Popup possible for streaming devices of type \"generic\", ". "support for \"genericStrmHtmlTag\" in streaming devices ", @@ -325,6 +328,9 @@ our %SSCam_ttips_en = ( tth264run => "Playback of last H.264 recording of camera "§NAME§".
It only starts if the recording is type H.264", ttlmjpegrun => "Playback of last MJPEG recording of camera "§NAME§".
It only starts if the recording is type MJPEG", ttlsnaprun => "Playback of last snapshot of camera "§NAME§".", + confcam => "The configuration menu of camera "§NAME§" will be opened in a new Browser page", + confsvs => "The configuration page of Synology Surveillance Station will be opened in a new Browser page", + helpsvs => "The online help page of Synology Surveillance Station will be opened in a new Browser page", ); our %SSCam_ttips_de = ( @@ -340,6 +346,9 @@ our %SSCam_ttips_de = ( tth264run => "Wiedergabe der letzten H.264 Aufnahme von Kamera "§NAME§".
Die Wiedergabe startet nur wenn die Aufnahme vom Typ H.264 ist.", ttlmjpegrun => "Wiedergabe der letzten MJPEG Aufnahme von Kamera "§NAME§".
Die Wiedergabe startet nur wenn die Aufnahme vom Typ MJPEG ist.", ttlsnaprun => "Wiedergabe des letzten Schnappschusses von Kamera "§NAME§".", + confcam => "Das Konfigurationsmenü von Kamera "§NAME§" wird in einer neuen Browserseite geöffnet", + confsvs => "Die Konfigurationsseite der Synology Surveillance Station wird in einer neuen Browserseite geöffnet", + helpsvs => "Die Onlinehilfe der Synology Surveillance Station wird in einer neuen Browserseite geöffnet", ); # Standardvariablen und Forward-Deklaration @@ -1881,15 +1890,91 @@ return $ret; sub SSCam_FWdetailFn ($$$$) { my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash is set for summaryFn. my $hash = $defs{$d}; + my $ret = ""; - return undef if(!AttrVal($d,"ptzPanel_use",1)); + $hash->{".setup"} = SSCam_FWconfCam($d,$room); + $ret .= $hash->{".setup"}; + + # return undef if(!AttrVal($d,"ptzPanel_use",1)); $hash->{".ptzhtml"} = SSCam_ptzpanel($d) if($hash->{".ptzhtml"} eq ""); - if($hash->{".ptzhtml"} ne "") { - return $hash->{".ptzhtml"}; - } else { - return undef; + if($hash->{".ptzhtml"} ne "" && AttrVal($d,"ptzPanel_use",1)) { + $ret .= $hash->{".ptzhtml"}; + } + +return $ret; +} + +############################################################################### +# Aufruf Konfigseite Kamera +############################################################################### +sub SSCam_FWconfCam($$) { + my ($name,$room) = @_; + my $hash = $defs{$name}; + my $cip = ReadingsVal("$name","CamIP",""); + my $svsip = $hash->{SERVERADDR}; + my $svsport = $hash->{SERVERPORT}; + my $svsprot = $hash->{PROTOCOL}; + my $ttjs = "/fhem/pgm2/sscam_tooltip.js"; + my $attr = AttrVal($name, "htmlattr", ""); + my $alias = AttrVal($name, "alias", $name); + my $winname = $name."_view"; + my $cicon = 'edit_settings.svg'; # Icon für Cam/SVS Setup-Screen + my $hicon = 'message_help.svg'; # Icon für SVS Hilfeseite + my $w = 150; + my ($ret,$cexpl,$hexpl) = ("","",""); + my ($cs,$bs,$ch,$bh,); + + if(SSCam_IsModelCam($hash)) { # Camera Device + return $ret if(!$cip); + if(AttrVal("global","language","EN") =~ /DE/) { + $cexpl = $SSCam_ttips_de{"confcam"}; $cexpl =~ s/\s/ /g; $cexpl =~ s/§NAME§/$alias/g; + } else { + $cexpl = $SSCam_ttips_en{"confcam"}; $cexpl =~ s/\s/ /g; $cexpl =~ s/§NAME§/$alias/g; + } + $cs = "window.open('http://$cip')"; + + } else { # SVS-Device + return $ret if(!$svsip); + if(AttrVal("global","language","EN") =~ /DE/) { + $cexpl = $SSCam_ttips_de{"confsvs"}; $cexpl =~ s/\s/ /g; $cexpl =~ s/§NAME§/$alias/g; + } else { + $cexpl = $SSCam_ttips_en{"confsvs"}; $cexpl =~ s/\s/ /g; $cexpl =~ s/§NAME§/$alias/g; + } + $cs = "window.open('$svsprot://$svsip:$svsport/cam')"; } + + if(AttrVal("global","language","EN") =~ /DE/) { + $hexpl = $SSCam_ttips_de{"helpsvs"}; $hexpl =~ s/\s/ /g; + $ch = "window.open('https://www.synology.com/de-de/knowledgebase/Surveillance/help')"; + } else { + $hexpl = $SSCam_ttips_en{"helpsvs"}; $hexpl =~ s/\s/ /g; + $ch = "window.open('https://www.synology.com/en-global/knowledgebase/Surveillance/help')"; + } + + $cicon = FW_makeImage($cicon); $hicon = FW_makeImage($hicon); + $bs = "Tip('$cexpl')"; + $bh = "Tip('$hexpl')"; + + $ret .= ""; + $ret .= ""; + $ret .= ""; + $ret .= ''; + $ret .= ""; + $ret .= ""; + $ret .= ''; + $ret .= "
"; + + $ret .= " $cicon "; + + $ret .= ""; + + $ret .= " $hicon "; + + $ret .= "
"; + $ret .= "
"; + +return $ret; } ###################################################################################### @@ -5249,6 +5334,9 @@ sub SSCam_camop_parse ($) { my $num = $hash->{HELPER}{SNAPNUM}; # Gesamtzahl der auszulösenden Schnappschüsse my $ncount = $hash->{HELPER}{SNAPNUMCOUNT}; # Restzahl der auszulösenden Schnappschüsse + if (AttrVal($name,"debugactivetoken",0)) { + Log3($name, 1, "$name - Snapshot number ".($num-$ncount+1)." (ID: $snapid) of total $num snapshots with transaction-ID: $tac done"); + } $ncount--; # wird vermindert je Snap my $lag = $hash->{HELPER}{SNAPLAG}; # Zeitverzögerung zwischen zwei Schnappschüssen my $emtxt = $hash->{HELPER}{SMTPMSG}?$hash->{HELPER}{SMTPMSG}:""; # Text für Email-Versand @@ -5263,6 +5351,9 @@ sub SSCam_camop_parse ($) { # Anzahl und Size für Schnappschußabruf bestimmen my ($slim,$ssize) = SSCam_snaplimsize($hash); + if (AttrVal($name,"debugactivetoken",0)) { + Log3($name, 1, "$name - start get snapinfo of last $slim snapshots with transaction-ID: $tac"); + } if(!$hash->{HELPER}{TRANSACTION}) { # Token freigeben vor nächstem Kommando wenn keine Transaktion läuft @@ -8845,12 +8936,12 @@ sub SSCam_setVersionInfo($) { if($modules{$type}{META}{x_prereqs_src} && !$hash->{HELPER}{MODMETAABSENT}) { # META-Daten sind vorhanden $modules{$type}{META}{version} = "v".$v; # Version aus META.json überschreiben, Anzeige mit {Dumper $modules{SMAPortal}{META}} - if($modules{$type}{META}{x_version}) { # {x_version} ( nur gesetzt wenn $Id: 49_SSCam.pm 19280 2019-04-28 17:20:21Z DS_Starter $ im Kopf komplett! vorhanden ) + if($modules{$type}{META}{x_version}) { # {x_version} ( nur gesetzt wenn $Id: 49_SSCam.pm 19470 2019-05-26 20:37:39Z DS_Starter $ im Kopf komplett! vorhanden ) $modules{$type}{META}{x_version} =~ s/1.1.1/$v/g; } else { $modules{$type}{META}{x_version} = $v; } - return $@ unless (FHEM::Meta::SetInternals($hash)); # FVERSION wird gesetzt ( nur gesetzt wenn $Id: 49_SSCam.pm 19280 2019-04-28 17:20:21Z DS_Starter $ im Kopf komplett! vorhanden ) + return $@ unless (FHEM::Meta::SetInternals($hash)); # FVERSION wird gesetzt ( nur gesetzt wenn $Id: 49_SSCam.pm 19470 2019-05-26 20:37:39Z DS_Starter $ im Kopf komplett! vorhanden ) if(__PACKAGE__ eq "FHEM::$type" || __PACKAGE__ eq $type) { # es wird mit Packages gearbeitet -> Perl übliche Modulversion setzen # mit {->VERSION()} im FHEMWEB kann Modulversion abgefragt werden