diff --git a/fhem/CHANGED b/fhem/CHANGED index 504e1c1cf..9d67020b5 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - change: 49_SSCam: panel PTZ Control changed - new: 10_SD_GT: Processing of messages from remote controls GT-9000 like - change: 98_Heating_Control: Move to deprecated - change: 76_SMAPortal: live Data extraction, minor fixes diff --git a/fhem/FHEM/49_SSCam.pm b/fhem/FHEM/49_SSCam.pm index a04484235..777ce5eb9 100644 --- a/fhem/FHEM/49_SSCam.pm +++ b/fhem/FHEM/49_SSCam.pm @@ -156,6 +156,7 @@ BEGIN { # Versions History intern my %vNotesIntern = ( + "9.4.2" => "10.07.2020 more changes according PBP level 3, headline PTZ Control ", "9.4.1" => "05.07.2020 new Zoom icons ", "9.4.0" => "01.07.2020 switch to packages, much more changes according PBP ", "9.3.0" => "21.06.2020 SVS device 'inctive' if disabled, add zoom capability, much more internal code changes ", @@ -484,13 +485,142 @@ my $valZoom = ".++,+,stop,-,--."; # Inhalt des Setters " #use vars qw($FW_detail); # currently selected device for detail view #use vars qw($FW_wname); # Web instance # sub FW_pH(@); # add href -use vars qw(%vHintsExt_en); -use vars qw(%vHintsExt_de); +# use vars qw(%vHintsExt_en); +# use vars qw(%vHintsExt_de); #sub SSChatBot_formString; #sub SSChatBot_addQueue($$$$$$$$); #sub SSChatBot_getapisites($); +############################################################################################# +# Hint Hash EN +############################################################################################# +my %vHintsExt_en = ( + "9" => "Further infomations about sending snapshots and recordings by Synology Chat server in our ". + "Wiki. ". + "In addition here is provided the link to the Chat knowledgebase.

", + "8" => "Link to official Surveillance Forum in Synology community". + "

", + "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:". + "". + "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:

". + "". + "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:
". + "". + "After that execute \"rereadicons\" or restart FHEM. ". + "

", + "5" => "Find more Informations about manage users and the appropriate privilege profiles in ". + "Surveillance Station online help ". + "

", + "4" => "The message Meldung \"WARNING - The current/simulated SVS-version ... may be incompatible with SSCam version...\" means that ". + "the used SSCam version was currently not tested or (partially) incompatible with the installed version of Synology Surveillance Station (Reading \"SVSversion\"). ". + "The compatible SVS-Version is printed out in the Internal COMPATIBILITY.\n". + "Actions: At first please update your SSCam version. If the message does appear furthermore, please inform the SSCam Maintainer. ". + "To ignore this message temporary, you may reduce the verbose level of your SSCam device. ". + "

", + "3" => "Link to SSCam english commandRef ". + "

", + "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". + "

", +); + +############################################################################################# +# Hint Hash DE +############################################################################################# +my %vHintsExt_de = ( + "9" => "Weitere Informationen zum Versand von Schnappschüssen und Aufnahmen mit dem Synology Chat Server findet man im ". + "Wiki. ". + "Ergänzend dazu Hinweise zur Einrichtung und Administration des Synology Chat Servers im ". + "Support-Center.

", + "8" => "Link zur offiziellen Surveillance Forum Seite innerhalb der Synology Community". + "

", + "7" => "Einstellung Email-Versand
". + "=========================


". + "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". + "". + "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>\"
". + "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:

". + "". + "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:
". + "". + "Danach ein \"rereadicons\" bzw. einen FHEM restart ausführen.". + "

", + "5" => "Informationen zum Management von Usern und entsprechenden Rechte-Profilen sind in der ". + "Surveillance Station Online-Hilfe zu finden.". + "

", + "4" => "Die Meldung \"WARNING - The current/simulated SVS-version ... may be incompatible with SSCam version...\" ist ein Hinweis darauf, dass ". + "die eingesetzte SSCam Version noch nicht mit der verwendeten Version von Synology Surveillance Station (Reading \"SVSversion\") getestet ". + "wurde oder (teilweise) mit dieser Version nicht kompatibel ist. Die kompatible SVS-Version ist im Internal COMPATIBILITY ersichtlich.\n". + "Maßnahmen: Bitte SSCam zunächst updaten. Sollte die Meldung weiterhin auftreten, bitte den SSCam Maintainer informieren. Zur ". + "vorübergehenden Ignorierung kann der verbose Level des SSCam-Devices entsprechend reduziert werden. ". + "

", + "3" => "Link zur deutschen SSCam commandRef ". + "

", + "2" => "Zur Erstellung eigener PTZ-Steuericons gibt es eine Vorlage im SVN die hier contrib/sscam/black_btn_CAM_Template.pdn heruntergeladen werden kann.\n". + "Diese Vorlage kann zum Beispiel mit Paint.Net bearbeitet werden. ". + "

", + "1" => "Hilfreiche Hinweise zu SSCam im FHEM-Wiki". + "

", +); + ################################################################ sub Initialize { my $hash = shift; @@ -552,7 +682,7 @@ sub Initialize { "webCmd ". $readingFnAttributes; - eval { FHEM::Meta::InitMod( __FILE__, $hash ) }; # für Meta.pm (https://forum.fhem.de/index.php/topic,97589.0.html) + eval { FHEM::Meta::InitMod( __FILE__, $hash ) }; ## no critic 'eval' # für Meta.pm (https://forum.fhem.de/index.php/topic,97589.0.html) return; } @@ -932,20 +1062,20 @@ sub Attr { } if ($cmd eq "set") { - if ($aName =~ m/httptimeout|snapGalleryColumns|rectime|pollcaminfoall/) { - unless ($aVal =~ /^\d+$/) { return " The Value for $aName is not valid. Use only figures 1-9 !";} + if ($aName =~ m/httptimeout|snapGalleryColumns|rectime|pollcaminfoall/x) { + unless ($aVal =~ /^\d+$/x) { return " The Value for $aName is not valid. Use only figures 1-9 !";} } - if($aName =~ m/pollcaminfoall/) { + if($aName =~ m/pollcaminfoall/x) { return "The value of \"$aName\" has to be greater than 10 seconds." if($aVal <= 10); } - if($aName =~ m/cacheServerParam/) { + if($aName =~ m/cacheServerParam/x) { return "Please provide the Redis server parameters in form: : or unix:" if($aVal !~ /^(.*:\d+|unix:.+)$/); my $type = AttrVal($name, "cacheType", "internal"); if($hash->{HELPER}{CACHEKEY} && $type eq "redis") { cache($name, "c_destroy"); } } - if($aName =~ m/snapChatTxt|recChatTxt/) { + if($aName =~ m/snapChatTxt|recChatTxt/x) { return "When you want activate \"$aName\", you have to set first the attribute \"videofolderMap\" to the root folder ". "of recordings and snapshots provided by an URL.\n". "Example: http://server.domain:8081/surveillance " @@ -955,7 +1085,7 @@ sub Attr { } if ($cmd eq "del") { - if ($aName =~ m/pollcaminfoall/ ) { + if ($aName =~ m/pollcaminfoall/x) { # Polling nicht ausschalten wenn snapGalleryBoost ein (regelmäßig neu einlesen) return "Please switch off \"snapGalleryBoost\" first if you want to deactivate \"pollcaminfoall\" because the functionality of \"snapGalleryBoost\" depends on retrieving snapshots periodical." if(AttrVal($name,"snapGalleryBoost",0)); @@ -1065,19 +1195,19 @@ sub Set { if ($opt eq "on" && IsModelCam($hash)) { if (!$hash->{CREDENTIALS}) {return qq{Credentials of $name are not set - make sure you've set it with "set $name credentials username password"};} - if (defined($prop) && $prop =~ /^\d+$/) { + if (defined($prop) && $prop =~ /^\d+$/x) { $hash->{HELPER}{RECTIME_TEMP} = $prop; } my $spec = join(" ",@a); - if($spec =~ /STRM:/) { - $spec =~ m/.*STRM:(.*).*/i; # Aufnahme durch SSCamSTRM-Device - $hash->{HELPER}{INFORM} = $1; + if($spec =~ /STRM:/x) { + my ($inf) = $spec =~ m/STRM:(.*)/ix; # Aufnahme durch SSCamSTRM-Device + $hash->{HELPER}{INFORM} = $inf; } my $emtxt = AttrVal($name, "recEmailTxt", ""); - if($spec =~ /recEmailTxt:/) { - $spec =~ m/.*recEmailTxt:"(.*)".*/i; + if($spec =~ /recEmailTxt:/x) { + $spec =~ m/recEmailTxt:"(.*)"/xi; $emtxt = $1; } @@ -1089,8 +1219,8 @@ sub Set { } my $teletxt = AttrVal($name, "recTelegramTxt", ""); - if($spec =~ /recTelegramTxt:/) { - $spec =~ m/.*recTelegramTxt:"(.*)".*/i; + if($spec =~ /recTelegramTxt:/x) { + $spec =~ m/recTelegramTxt:"(.*)"/xi; $teletxt = $1; } @@ -1101,8 +1231,8 @@ sub Set { } my $chattxt = AttrVal($name, "recChatTxt", ""); - if($spec =~ /recChatTxt:/) { - $spec =~ m/.*recChatTxt:"(.*)".*/i; + if($spec =~ /recChatTxt:/x) { + $spec =~ m/recChatTxt:"(.*)"/xi; $chattxt = $1; } @@ -1118,8 +1248,8 @@ sub Set { if (!$hash->{CREDENTIALS}) {return qq{Credentials of $name are not set - make sure you've set it with "set $name credentials username password"};} my $spec = join(" ",@a); - if($spec =~ /STRM:/) { - $spec =~ m/.*STRM:(.*).*/i; # Aufnahmestop durch SSCamSTRM-Device + if($spec =~ /STRM:/x) { + $spec =~ m/STRM:(.*)/xi; # Aufnahmestop durch SSCamSTRM-Device $hash->{HELPER}{INFORM} = $1; } @@ -1129,25 +1259,25 @@ sub Set { if (!$hash->{CREDENTIALS}) {return qq{Credentials of $name are not set - make sure you've set it with "set $name credentials username password"};} my ($num,$lag,$ncount) = (1,2,1); - if($prop && $prop =~ /^\d+$/) { # Anzahl der Schnappschüsse zu triggern (default: 1) + if($prop && $prop =~ /^\d+$/x) { # 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+$/x) { # Zeit zwischen zwei Schnappschüssen (default: 2 Sekunden) $lag = $prop1; } Log3($name, 4, "$name - Trigger snapshots - Number: $num, Lag: $lag"); my $spec = join(" ",@a); - if($spec =~ /STRM:/) { - $spec =~ m/.*STRM:(.*).*/i; # Snap by SSCamSTRM-Device + if($spec =~ /STRM:/x) { + $spec =~ m/STRM:(.*)/xi; # Snap by SSCamSTRM-Device $hash->{HELPER}{INFORM} = $1; } my $emtxt = AttrVal($name, "snapEmailTxt", ""); - if($spec =~ /snapEmailTxt:/) { - $spec =~ m/.*snapEmailTxt:"(.*)".*/i; + if($spec =~ /snapEmailTxt:/x) { + $spec =~ m/snapEmailTxt:"(.*)"/xi; $emtxt = $1; } @@ -1159,8 +1289,8 @@ sub Set { } my $teletxt = AttrVal($name, "snapTelegramTxt", ""); - if($spec =~ /snapTelegramTxt:/) { - $spec =~ m/.*snapTelegramTxt:"(.*)".*/i; + if($spec =~ /snapTelegramTxt:/x) { + $spec =~ m/snapTelegramTxt:"(.*)"/xi; $teletxt = $1; } @@ -1171,8 +1301,8 @@ sub Set { } my $chattxt = AttrVal($name, "snapChatTxt", ""); - if($spec =~ /snapChatTxt:/) { - $spec =~ m/.*snapChatTxt:"(.*)".*/i; + if($spec =~ /snapChatTxt:/x) { + $spec =~ m/snapChatTxt:"(.*)"/xi; $chattxt = $1; } @@ -1189,19 +1319,19 @@ sub Set { my ($num,$lag,$ncount) = (1,2,1); my $cams = "all"; - if($prop && $prop =~ /^\d+$/) { # Anzahl der Schnappschüsse zu triggern (default: 1) + if($prop && $prop =~ /^\d+$/x) { # 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+$/x) { # Zeit zwischen zwei Schnappschüssen (default: 2 Sekunden) $lag = $prop1; } my $at = join(" ",@a); - if($at =~ /CAM:/i) { - $at =~ m/.*CAM:"(.*)".*/i; + if($at =~ /CAM:/xi) { + $at =~ m/CAM:"(.*)"/xi; $cams = $1; - $cams =~ s/\s//g; + $cams =~ s/\s//gx; } my @camdvs; @@ -1227,8 +1357,8 @@ sub Set { my $teletxt = ""; my $rawet = AttrVal($name, "snapEmailTxt", ""); my $bt = join(" ",@a); - if($bt =~ /snapEmailTxt:/) { - $bt =~ m/.*snapEmailTxt:"(.*)".*/i; + if($bt =~ /snapEmailTxt:/x) { + $bt =~ m/snapEmailTxt:"(.*)"/xi; $rawet = $1; } if($rawet) { @@ -1325,24 +1455,24 @@ sub Set { if (!$hash->{CREDENTIALS}) {return qq{Credentials of $name are not set - make sure you've set it with "set $name credentials username password"};} my ($livedev,$ret); - if($prop =~ /mjpeg/) { + if($prop =~ /mjpeg/x) { $livedev = "SSCamSTRM.$name.mjpeg"; $ret = CommandDefine($hash->{CL},"$livedev SSCamSTRM {FHEM::SSCam::streamDev('$name','$livedev','mjpeg')}"); return $ret if($ret); } - if($prop =~ /generic/) { + if($prop =~ /generic/x) { $livedev = "SSCamSTRM.$name.generic"; $ret = CommandDefine($hash->{CL},"$livedev SSCamSTRM {FHEM::SSCam::streamDev('$name','$livedev','generic')}"); return $ret if($ret); } - if($prop =~ /hls/) { + if($prop =~ /hls/x) { $livedev = "SSCamSTRM.$name.hls"; $ret = CommandDefine($hash->{CL},"$livedev SSCamSTRM {FHEM::SSCam::streamDev('$name','$livedev','hls')}"); return $ret if($ret); my $c = "The device needs to set attribute \"hlsStrmObject\" in camera device \"$name\" to a valid HLS videostream"; CommandAttr($hash->{CL},"$livedev comment $c"); } - if($prop =~ /lastsnap/) { + if($prop =~ /lastsnap/x) { $livedev = "SSCamSTRM.$name.lastsnap"; $ret = CommandDefine($hash->{CL},"$livedev SSCamSTRM {FHEM::SSCam::streamDev('$name','$livedev','lastsnap')}"); return $ret if($ret); @@ -1351,7 +1481,7 @@ sub Set { "Set also attribute \"snapGallerySize = Full\" in camera device \"$name\" to retrieve snapshots in original resolution."; CommandAttr($hash->{CL},"$livedev comment $c"); } - if($prop =~ /switched/) { + if($prop =~ /switched/x) { $livedev = "SSCamSTRM.$name.switched"; $ret = CommandDefine($hash->{CL},"$livedev SSCamSTRM {FHEM::SSCam::streamDev('$name','$livedev','switched')}"); return $ret if($ret); @@ -1585,8 +1715,8 @@ sub Set { if (!$hash->{CREDENTIALS}) {return qq{Credentials of $name are not set - make sure you've set it with "set $name credentials username password"};} my $spec = join(" ",@a); - if($spec =~ /STRM:/) { - $spec =~ m/.*STRM:(.*).*/i; # Call by SSCamSTRM-Device + if($spec =~ /STRM:/x) { + $spec =~ m/STRM:(.*)/xi; # Call by SSCamSTRM-Device $hash->{HELPER}{INFORM} = $1; } @@ -1664,8 +1794,8 @@ sub Set { if (!$hash->{CREDENTIALS}) {return qq{Credentials of $name are not set - make sure you've set it with "set $name credentials username password"};} my $spec = join(" ",@a); - if($spec =~ /STRM:/) { - $spec =~ m/.*STRM:(.*).*/i; # Call by SSCamSTRM-Device + if($spec =~ /STRM:/x) { + $spec =~ m/STRM:(.*)/xi; # Call by SSCamSTRM-Device $hash->{HELPER}{INFORM} = $1; } activateHls($hash); @@ -1673,8 +1803,8 @@ sub Set { } elsif ($opt eq "refresh" && IsModelCam($hash)) { # ohne SET-Menüeintrag my $spec = join(" ",@a); - if($spec =~ /STRM:/) { - $spec =~ m/.*STRM:(.*).*/i; # Refresh by SSCamSTRM-Device + if($spec =~ /STRM:/x) { + $spec =~ m/STRM:(.*)/xi; # Refresh by SSCamSTRM-Device $hash->{HELPER}{INFORM} = $1; roomRefresh($hash,0,0,1); # kein Room-Refresh, kein SSCam-state-Event, SSCamSTRM-Event } @@ -1688,8 +1818,8 @@ sub Set { if (!$hash->{CREDENTIALS}) {return qq{Credentials of $name are not set - make sure you've set it with "set $name credentials username password"};} my $spec = join(" ",@a); - if($spec =~ /STRM:/) { - $spec =~ m/.*STRM:(.*).*/i; # Stop by SSCamSTRM-Device + if($spec =~ /STRM:/x) { + $spec =~ m/STRM:(.*)/xi; # Stop by SSCamSTRM-Device $hash->{HELPER}{INFORM} = $1; } stopLiveview($hash); @@ -1894,7 +2024,7 @@ sub Get { # "1" ist Statusbit für manuelle Abfrage, kein Einstieg in Pollingroutine getCaminfoAll($hash,1); - } elsif ($opt =~ /versionNotes/) { + } elsif ($opt =~ /versionNotes/x) { my $header = "Module release information
"; my $header1 = "Helpful hints
"; my %hs; @@ -1906,12 +2036,12 @@ sub Get { $ret = ""; # Hints - if(!$arg || $arg =~ /hints/ || $arg =~ /[\d]+/) { + if(!$arg || $arg =~ /hints/x || $arg =~ /[\d]+/x) { $ret .= sprintf("
$header1
"); $ret .= ""; $ret .= ""; $ret .= ""; - if($arg && $arg =~ /[\d]+/) { + if($arg && $arg =~ /[\d]+/x) { my @hints = split(",",$arg); for (@hints) { if(AttrVal("global","language","EN") eq "DE") { @@ -1947,7 +2077,7 @@ sub Get { } # Notes - if(!$arg || $arg =~ /rel/) { + if(!$arg || $arg =~ /rel/x) { $ret .= sprintf("
$header
"); $ret .= "
"; $ret .= ""; @@ -1996,7 +2126,7 @@ sub FWsummaryFn { my $ret = ""; my $alias; - return if(!$hash->{HELPER}{LINK} || ReadingsVal($d, "state", "") =~ /^dis.*/ || IsDisabled($name)); + return if(!$hash->{HELPER}{LINK} || ReadingsVal($d, "state", "") =~ /^dis/x || IsDisabled($name)); # Definition Tasten my $imgblank = ""; # nicht sichtbare Leertaste @@ -2030,18 +2160,18 @@ sub FWsummaryFn { my $calias = $hash->{CAMNAME}; # Alias der Kamera my $ttjs = "/fhem/pgm2/sscam_tooltip.js"; my ($ttrefresh, $ttrecstart, $ttrecstop, $ttsnap, $ttcmdstop, $tthlsreact, $ttmjpegrun, $tthlsrun, $ttlrrun, $tth264run, $ttlmjpegrun, $ttlsnaprun); - if(AttrVal("global","language","EN") =~ /EN/) { - $ttrecstart = $ttips_en{"ttrecstart"}; $ttrecstart =~ s/§NAME§/$calias/g; - $ttrecstop = $ttips_en{"ttrecstop"}; $ttrecstop =~ s/§NAME§/$calias/g; - $ttsnap = $ttips_en{"ttsnap"}; $ttsnap =~ s/§NAME§/$calias/g; - $ttcmdstop = $ttips_en{"ttcmdstop"}; $ttcmdstop =~ s/§NAME§/$calias/g; - $tthlsreact = $ttips_en{"tthlsreact"}; $tthlsreact =~ s/§NAME§/$calias/g; + if(AttrVal("global","language","EN") =~ /EN/x) { + $ttrecstart = $ttips_en{"ttrecstart"}; $ttrecstart =~ s/§NAME§/$calias/gx; + $ttrecstop = $ttips_en{"ttrecstop"}; $ttrecstop =~ s/§NAME§/$calias/gx; + $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/g; - $ttrecstop = $ttips_de{"ttrecstop"}; $ttrecstop =~ s/§NAME§/$calias/g; - $ttsnap = $ttips_de{"ttsnap"}; $ttsnap =~ s/§NAME§/$calias/g; - $ttcmdstop = $ttips_de{"ttcmdstop"}; $ttcmdstop =~ s/§NAME§/$calias/g; - $tthlsreact = $ttips_de{"tthlsreact"}; $tthlsreact =~ s/§NAME§/$calias/g; + $ttrecstart = $ttips_de{"ttrecstart"}; $ttrecstart =~ s/§NAME§/$calias/gx; + $ttrecstop = $ttips_de{"ttrecstop"}; $ttrecstop =~ s/§NAME§/$calias/gx; + $ttsnap = $ttips_de{"ttsnap"}; $ttsnap =~ s/§NAME§/$calias/gx; + $ttcmdstop = $ttips_de{"ttcmdstop"}; $ttcmdstop =~ s/§NAME§/$calias/gx; + $tthlsreact = $ttips_de{"tthlsreact"}; $tthlsreact =~ s/§NAME§/$calias/gx; } $ret .= ""; @@ -2054,7 +2184,7 @@ sub FWsummaryFn { } $ret .= "$imgstop "; $ret .= $imgblank; - if($hash->{HELPER}{RUNVIEW} =~ /live_fw/) { + if($hash->{HELPER}{RUNVIEW} =~ /live_fw/x) { if(ReadingsVal($d, "Record", "Stop") eq "Stop") { # Aufnahmebutton endlos Start $ret .= "$imgrecendless "; @@ -2188,28 +2318,28 @@ sub FWconfCam { if(IsModelCam($hash)) { # Camera Device return $ret if(!$cip); - if(AttrVal("global","language","EN") =~ /DE/) { - $cexpl = $ttips_de{confcam}; $cexpl =~ s/§NAME§/$alias/g; $cexpl =~ s/\s+/ /g; + if(AttrVal("global","language","EN") =~ /DE/x) { + $cexpl = $ttips_de{confcam}; $cexpl =~ s/§NAME§/$alias/gx; $cexpl =~ s/\s+/ /gx; } else { - $cexpl = $ttips_en{confcam}; $cexpl =~ s/§NAME§/$alias/g; $cexpl =~ s/\s+/ /g; + $cexpl = $ttips_en{confcam}; $cexpl =~ s/§NAME§/$alias/gx; $cexpl =~ s/\s+/ /gx; } $cs = "window.open('http://$cip')"; } else { # SVS-Device return $ret if(!$svsip); - if(AttrVal("global","language","EN") =~ /DE/) { - $cexpl = $ttips_de{confsvs}; $cexpl =~ s/§NAME§/$alias/g; $cexpl =~ s/\s+/ /g; + if(AttrVal("global","language","EN") =~ /DE/x) { + $cexpl = $ttips_de{confsvs}; $cexpl =~ s/§NAME§/$alias/gx; $cexpl =~ s/\s+/ /gx; } else { - $cexpl = $ttips_en{confsvs}; $cexpl =~ s/§NAME§/$alias/g; $cexpl =~ s/\s+/ /g; + $cexpl = $ttips_en{confsvs}; $cexpl =~ s/§NAME§/$alias/gx; $cexpl =~ s/\s+/ /gx; } $cs = "window.open('$svsprot://$svsip:$svsport/cam')"; } - if(AttrVal("global","language","EN") =~ /DE/) { - $hexpl = $ttips_de{"helpsvs"}; $hexpl =~ s/\s/ /g; + if(AttrVal("global","language","EN") =~ /DE/x) { + $hexpl = $ttips_de{"helpsvs"}; $hexpl =~ s/\s/ /gx; $ch = "window.open('https://www.synology.com/de-de/knowledgebase/Surveillance/help')"; } else { - $hexpl = $ttips_en{"helpsvs"}; $hexpl =~ s/\s/ /g; + $hexpl = $ttips_en{"helpsvs"}; $hexpl =~ s/\s/ /gx; $ch = "window.open('https://www.synology.com/en-global/knowledgebase/Surveillance/help')"; } @@ -2328,7 +2458,7 @@ sub myVersion { my @vl = split (/-/,ReadingsVal($name, "SVSversion", ""),2); if(@vl) { $actvs = $vl[0]; - $actvs =~ s/\.//g; + $actvs =~ s/\.//gx; } return $actvs; @@ -2487,7 +2617,7 @@ sub wdpollcaminfo { my $lupd = ReadingsVal($name, "LastUpdateTime", "1970-01-01 / 01:00:00"); my ($year,$month,$mday,$hour,$min,$sec); - if ($lupd =~ /(\d+)\.(\d+)\.(\d+).*/) { + if ($lupd =~ /(\d+)\.(\d+)\.(\d+)/x) { ($mday, $month, $year, $hour, $min, $sec) = ($lupd =~ /(\d+)\.(\d+)\.(\d+) \/ (\d+):(\d+):(\d+)/); } else { ($year, $month, $mday, $hour, $min, $sec) = ($lupd =~ /(\d+)-(\d+)-(\d+) \/ (\d+):(\d+):(\d+)/); @@ -2531,7 +2661,7 @@ sub camStartRec { RemoveInternalTimer($hash, "camStartRec"); return if(IsDisabled($name)); - if (ReadingsVal("$name", "state", "") =~ /^dis.*/) { + if (ReadingsVal("$name", "state", "") =~ /^dis/x) { if (ReadingsVal("$name", "state", "") eq "disabled") { $errorcode = "402"; } elsif (ReadingsVal("$name", "state", "") eq "disconnected") { @@ -2594,7 +2724,7 @@ sub camStopRec { RemoveInternalTimer($hash, "FHEM::SSCam::camStopRec"); return if(IsDisabled($name)); - if (ReadingsVal("$name", "state", "") =~ /^dis.*/) { + if (ReadingsVal("$name", "state", "") =~ /^dis/x) { if (ReadingsVal("$name", "state", "") eq "disabled") { $errorcode = "402"; } elsif (ReadingsVal("$name", "state", "") eq "disconnected") { @@ -2646,7 +2776,7 @@ sub camExpmode { RemoveInternalTimer($hash, "FHEM::SSCam::camExpmode"); return if(IsDisabled($name)); - if (ReadingsVal("$name", "state", "") =~ /^dis.*/) { + if (ReadingsVal("$name", "state", "") =~ /^dis/x) { if (ReadingsVal("$name", "state", "") eq "disabled") { $errorcode = "402"; } elsif (ReadingsVal("$name", "state", "") eq "disconnected") { @@ -2693,7 +2823,7 @@ sub amMotDetSc { RemoveInternalTimer($hash, "FHEM::SSCam::amMotDetSc"); return if(IsDisabled($name)); - if (ReadingsVal("$name", "state", "") =~ /^dis.*/) { + if (ReadingsVal("$name", "state", "") =~ /^dis/x) { if (ReadingsVal("$name", "state", "") eq "disabled") { $errorcode = "402"; } elsif (ReadingsVal("$name", "state", "") eq "disconnected") { @@ -2747,7 +2877,7 @@ sub camSnap { RemoveInternalTimer($hash, "FHEM::SSCam::camSnap"); return if(IsDisabled($name)); - if (ReadingsVal("$name", "state", "") =~ /^dis.*/) { + if (ReadingsVal("$name", "state", "") =~ /^dis/x) { if (ReadingsVal("$name", "state", "") eq "disabled") { $errorcode = "402"; } elsif (ReadingsVal("$name", "state", "") eq "disconnected") { @@ -2804,7 +2934,7 @@ sub getRec { RemoveInternalTimer($hash, "FHEM::SSCam::getRec"); return if(IsDisabled($name)); - if (ReadingsVal("$name", "state", "") =~ /^dis.*/) { + if (ReadingsVal("$name", "state", "") =~ /^dis/x) { if (ReadingsVal("$name", "state", "") eq "disabled") { $errorcode = "402"; } elsif (ReadingsVal("$name", "state", "") eq "disconnected") { @@ -2852,7 +2982,7 @@ sub getRecAndSave { RemoveInternalTimer($hash, "FHEM::SSCam::getRecAndSave"); return if(IsDisabled($name)); - if (ReadingsVal("$name", "state", "") =~ /^dis.*/) { + if (ReadingsVal("$name", "state", "") =~ /^dis/x) { if (ReadingsVal("$name", "state", "") eq "disabled") { $errorcode = "402"; } elsif (ReadingsVal("$name", "state", "") eq "disconnected") { @@ -2900,7 +3030,7 @@ sub startTrack { RemoveInternalTimer($hash, "FHEM::SSCam::startTrack"); return if(IsDisabled($name)); - if (ReadingsVal("$name", "state", "") =~ /^dis.*/) { + if (ReadingsVal("$name", "state", "") =~ /^dis/x) { if (ReadingsVal("$name", "state", "") eq "disabled") { $errorcode = "402"; } elsif (ReadingsVal("$name", "state", "") eq "disconnected") { @@ -2947,7 +3077,7 @@ sub stopTrack { RemoveInternalTimer($hash, "FHEM::SSCam::stopTrack"); return if(IsDisabled($name)); - if (ReadingsVal("$name", "state", "") =~ /^dis.*/) { + if (ReadingsVal("$name", "state", "") =~ /^dis/x) { if (ReadingsVal("$name", "state", "") eq "disabled") { $errorcode = "402"; } elsif (ReadingsVal("$name", "state", "") eq "disconnected") { @@ -2996,7 +3126,7 @@ sub setZoom { RemoveInternalTimer($hash, "FHEM::SSCam::setZoom"); return if(IsDisabled($name)); - if (ReadingsVal("$name", "state", "") =~ /^dis.*/) { + if (ReadingsVal("$name", "state", "") =~ /^dis/x) { if (ReadingsVal("$name", "state", "") eq "disabled") { $errorcode = "402"; } elsif (ReadingsVal("$name", "state", "") eq "disconnected") { @@ -3050,7 +3180,7 @@ sub getPresets { RemoveInternalTimer($hash, "FHEM::SSCam::getPresets"); return if(IsDisabled($name)); - if (ReadingsVal("$name", "state", "") =~ /^dis.*/) { + if (ReadingsVal("$name", "state", "") =~ /^dis/x) { if (ReadingsVal("$name", "state", "") eq "disabled") { $errorcode = "402"; } elsif (ReadingsVal("$name", "state", "") eq "disconnected") { @@ -3098,7 +3228,7 @@ sub setPreset { RemoveInternalTimer($hash, "FHEM::SSCam::setPreset"); return if(IsDisabled($name)); - if (ReadingsVal("$name", "state", "") =~ /^dis.*/) { + if (ReadingsVal("$name", "state", "") =~ /^dis/x) { if (ReadingsVal("$name", "state", "") eq "disabled") { $errorcode = "402"; } elsif (ReadingsVal("$name", "state", "") eq "disconnected") { @@ -3145,7 +3275,7 @@ sub delPreset { RemoveInternalTimer($hash, "FHEM::SSCam::delPreset"); return if(IsDisabled($name)); - if (ReadingsVal("$name", "state", "") =~ /^dis.*/) { + if (ReadingsVal("$name", "state", "") =~ /^dis/x) { if (ReadingsVal("$name", "state", "") eq "disabled") { $errorcode = "402"; } elsif (ReadingsVal("$name", "state", "") eq "disconnected") { @@ -3193,7 +3323,7 @@ sub setHome { RemoveInternalTimer($hash, "FHEM::SSCam::setHome"); return if(IsDisabled($name)); - if (ReadingsVal("$name", "state", "") =~ /^dis.*/) { + if (ReadingsVal("$name", "state", "") =~ /^dis/x) { if (ReadingsVal("$name", "state", "") eq "disabled") { $errorcode = "402"; } elsif (ReadingsVal("$name", "state", "") eq "disconnected") { @@ -3241,7 +3371,7 @@ sub managePir { RemoveInternalTimer($hash, "FHEM::SSCam::managePir"); return if(IsDisabled($name)); - if (ReadingsVal("$name", "state", "") =~ /^dis.*/) { + if (ReadingsVal("$name", "state", "") =~ /^dis/x) { if (ReadingsVal("$name", "state", "") eq "disabled") { $errorcode = "402"; } elsif (ReadingsVal("$name", "state", "") eq "disconnected") { @@ -3289,7 +3419,7 @@ sub runLiveview { RemoveInternalTimer($hash, "FHEM::SSCam::runLiveview"); return if(IsDisabled($name)); - if (ReadingsVal("$name", "state", "") =~ /^dis.*/) { + if (ReadingsVal("$name", "state", "") =~ /^dis/x) { if (ReadingsVal("$name", "state", "") eq "disabled") { $errorcode = "402"; } elsif (ReadingsVal("$name", "state", "") eq "disconnected") { @@ -3339,7 +3469,7 @@ sub activateHls { RemoveInternalTimer($hash, "FHEM::SSCam::activateHls"); return if(IsDisabled($name)); - if (ReadingsVal("$name", "state", "") =~ /^dis.*/) { + if (ReadingsVal("$name", "state", "") =~ /^dis/x) { if (ReadingsVal("$name", "state", "") eq "disabled") { $errorcode = "402"; } elsif (ReadingsVal("$name", "state", "") eq "disconnected") { @@ -3386,7 +3516,7 @@ sub camAutocreate { RemoveInternalTimer($hash, "FHEM::SSCam::camAutocreate"); return if(IsDisabled($name)); - if (ReadingsVal("$name", "state", "") =~ /^dis.*/) { + if (ReadingsVal("$name", "state", "") =~ /^dis/x) { if (ReadingsVal("$name", "state", "") eq "disabled") { $errorcode = "402"; } elsif (ReadingsVal("$name", "state", "") eq "disconnected") { @@ -3432,7 +3562,7 @@ sub reactivateHls { RemoveInternalTimer($hash, "FHEM::SSCam::reactivateHls"); return if(IsDisabled($name)); - if (ReadingsVal("$name", "state", "") =~ /^dis.*/) { + if (ReadingsVal("$name", "state", "") =~ /^dis/x) { if (ReadingsVal("$name", "state", "") eq "disabled") { $errorcode = "402"; } elsif (ReadingsVal("$name", "state", "") eq "disconnected") { @@ -3596,7 +3726,7 @@ sub doPtzAaction { } } - if (ReadingsVal("$name", "state", "") =~ /^dis.*/) { + if (ReadingsVal("$name", "state", "") =~ /^dis/x) { if (ReadingsVal("$name", "state", "") eq "disabled") { $errorcode = "402"; } elsif (ReadingsVal("$name", "state", "") eq "disconnected") { @@ -4543,7 +4673,7 @@ sub getApiSites_Parse { my @vl = split (/\.|-/,AttrVal($name, "simu_SVSversion", "")); $actvs = $vl[0]; $actvs .= $vl[1]; - $actvs .= ($vl[2] =~ /\d/) ? $vl[2]."xxxx" : $vl[2]; + $actvs .= ($vl[2] =~ /\d/x) ? $vl[2]."xxxx" : $vl[2]; $actvs .= "-simu"; } @@ -4566,7 +4696,7 @@ sub getApiSites_Parse { if (AttrVal($name, "simu_SVSversion", undef)) { Log3($name, 4, "$name - SVS version $actvs will be simulated"); - if ($actvs =~ /^71/) { + if ($actvs =~ /^71/x) { $apicammaxver = 8; Log3($name, 4, "$name - MaxVersion of $apicam adapted to: $apicammaxver"); $apiauthmaxver = 4; @@ -4575,7 +4705,7 @@ sub getApiSites_Parse { Log3($name, 4, "$name - MaxVersion of $apiextrec adapted to: $apiextrecmaxver"); $apiptzmaxver = 4; Log3($name, 4, "$name - MaxVersion of $apiptz adapted to: $apiptzmaxver"); - } elsif ($actvs =~ /^72/) { + } elsif ($actvs =~ /^72/x) { $apicammaxver = 8; Log3($name, 4, "$name - MaxVersion of $apicam adapted to: $apicammaxver"); $apiauthmaxver = 6; @@ -4584,7 +4714,7 @@ sub getApiSites_Parse { Log3($name, 4, "$name - MaxVersion of $apiextrec adapted to: $apiextrecmaxver"); $apiptzmaxver = 5; Log3($name, 4, "$name - MaxVersion of $apiptz adapted to: $apiptzmaxver"); - } elsif ($actvs =~ /^800/) { + } elsif ($actvs =~ /^800/x) { $apicammaxver = 9; Log3($name, 4, "$name - MaxVersion of $apicam adapted to: $apicammaxver"); $apiauthmaxver = 6; @@ -4593,7 +4723,7 @@ sub getApiSites_Parse { Log3($name, 4, "$name - MaxVersion of $apiextrec adapted to: $apiextrecmaxver"); $apiptzmaxver = 5; Log3($name, 4, "$name - MaxVersion of $apiptz adapted to: $apiptzmaxver"); - } elsif ($actvs =~ /^815/) { + } elsif ($actvs =~ /^815/x) { $apicammaxver = 9; Log3($name, 4, "$name - MaxVersion of $apicam adapted to: $apicammaxver"); $apiauthmaxver = 6; @@ -4602,7 +4732,7 @@ sub getApiSites_Parse { Log3($name, 4, "$name - MaxVersion of $apiextrec adapted to: $apiextrecmaxver"); $apiptzmaxver = 5; Log3($name, 4, "$name - MaxVersion of $apiptz adapted to: $apiptzmaxver"); - } elsif ($actvs =~ /^820/) { + } elsif ($actvs =~ /^820/x) { # ab API v2.8 kein "SYNO.SurveillanceStation.VideoStream", "SYNO.SurveillanceStation.AudioStream", # "SYNO.SurveillanceStation.Streaming" mehr enthalten $apivideostmsmaxver = 0; @@ -4882,7 +5012,7 @@ sub getCamId_Parse { readingsBulkUpdate($hash,"Error",$error); readingsEndUpdate($hash, 1); - if ($errorcode =~ /(105|401)/) { + if ($errorcode =~ /(105|401)/x) { # neue Login-Versuche Log3($name, 2, "$name - ERROR - $errorcode - $error -> try new login"); return login($hash,'getApiSites'); @@ -4966,7 +5096,7 @@ sub camOp { Log3($name, 4, "$name - --- Begin Function $OpMode nonblocking ---"); $httptimeout = AttrVal($name, "httptimeout", 4); - $httptimeout = $httptimeout+90 if($OpMode =~ /setoptpar|Disable/); # setzen der Optimierungsparameter/Disable dauert lange ! + $httptimeout = $httptimeout+90 if($OpMode =~ /setoptpar|Disable/x); # setzen der Optimierungsparameter/Disable dauert lange ! Log3($name, 5, "$name - HTTP-Call will be done with httptimeout-Value: $httptimeout s"); @@ -5003,7 +5133,7 @@ sub camOp { my $imgsize = $hash->{HELPER}{SNAPIMGSIZE}; my $keyword = $hash->{HELPER}{KEYWORD}; my $snapid = ReadingsVal("$name", "LastSnapId", " "); - if($OpMode eq "getsnapinfo" && $snapid =~/\d+/) { + if($OpMode eq "getsnapinfo" && $snapid =~/\d+/x) { # getsnapinfo UND Reading LastSnapId gesetzt Log3($name,4, "$name - Call getsnapinfo with params: Image numbers => $limit, Image size => $imgsize, Id => $snapid"); $url = "$proto://$serveraddr:$serverport/webapi/$apitakesnappath?api=\"$apitakesnap\"&method=\"List\"&version=\"$apitakesnapmaxver\"&idList=\"$snapid\"&imgSize=\"$imgsize\"&limit=\"$limit\"&_sid=\"$sid\""; @@ -5117,7 +5247,7 @@ sub camOp { $mco = IsModelCam($hash) ? $hash->{CAMNAME} : $mco; $lim = 1 if(!$hash->{HELPER}{CL}{1}); # Datenabruf im Hintergrund - $sev = (lc($sev) =~ /error/) ? 3 :(lc($sev) =~ /warning/) ? 2 :(lc($sev) =~ /info/) ? 1 : ""; + $sev = (lc($sev) =~ /error/x) ? 3 :(lc($sev) =~ /warning/x) ? 2 :(lc($sev) =~ /info/x) ? 1 : ""; $url = "$proto://$serveraddr:$serverport/webapi/$apilogpath?api=$apilog&version=\"2\"&method=\"List\"&time2String=\"no\"&level=\"$sev\"&limit=\"$lim\"&keyword=\"$mco\"&_sid=\"$sid\""; @@ -5252,7 +5382,7 @@ sub camOp { } elsif ($OpMode eq "runliveview" && $hash->{HELPER}{RUNVIEW} !~ m/snap|^live_.*hls$/) { $exturl = AttrVal($name, "livestreamprefix", "$proto://$serveraddr:$serverport"); $exturl = ($exturl eq "DEF")?"$proto://$serveraddr:$serverport":$exturl; - if ($hash->{HELPER}{RUNVIEW} =~ m/live/) { + if ($hash->{HELPER}{RUNVIEW} =~ m/live/x) { if($apiaudiostmmaxver) { # API "SYNO.SurveillanceStation.AudioStream" vorhanden ? (removed ab API v2.8) $hash->{HELPER}{AUDIOLINK} = "$proto://$serveraddr:$serverport/webapi/$apiaudiostmpath?api=$apiaudiostm&version=$apiaudiostmmaxver&method=Stream&cameraId=$camid&_sid=$sid"; } else { @@ -5306,7 +5436,7 @@ sub camOp { delActiveToken($hash); return; - } elsif ($OpMode eq "runliveview" && $hash->{HELPER}{RUNVIEW} =~ /snap/) { + } elsif ($OpMode eq "runliveview" && $hash->{HELPER}{RUNVIEW} =~ /snap/x) { # den letzten Schnappschuß live anzeigen my $limit = 1; # nur 1 Snap laden, für lastsnap_fw my $imgsize = 2; # full size image, für lastsnap_fw @@ -5812,7 +5942,7 @@ sub camOp_Parse { InternalTimer(gettimeofday()+0.6, "FHEM::SSCam::getSnapInfo", "$name:$slim:$ssize:$tac", 0); return; - } elsif ($OpMode eq "getsnapinfo" || $OpMode eq "getsnapgallery" || ($OpMode eq "runliveview" && $hash->{HELPER}{RUNVIEW} =~ /snap/)) { + } elsif ($OpMode eq "getsnapinfo" || $OpMode eq "getsnapgallery" || ($OpMode eq "runliveview" && $hash->{HELPER}{RUNVIEW} =~ /snap/x)) { my ($cache,@as,$g); Log3($name, $verbose, "$name - Snapinfos of camera $camname retrieved"); @@ -5871,9 +6001,9 @@ sub camOp_Parse { ##### ein Schnapschuss soll als liveView angezeigt werden ##### ################################################################# Log3($name, 3, "$name - There is no snapshot of camera $camname to display ! Take one snapshot before.") - if(exists($hash->{HELPER}{RUNVIEW}) && $hash->{HELPER}{RUNVIEW} =~ /snap/ && !exists($data->{'data'}{'data'}[0]{imageData})); + if(exists($hash->{HELPER}{RUNVIEW}) && $hash->{HELPER}{RUNVIEW} =~ /snap/x && !exists($data->{'data'}{'data'}[0]{imageData})); - if (exists($hash->{HELPER}{RUNVIEW}) && $hash->{HELPER}{RUNVIEW} =~ /snap/ && exists($data->{'data'}{'data'}[0]{imageData})) { + if (exists($hash->{HELPER}{RUNVIEW}) && $hash->{HELPER}{RUNVIEW} =~ /snap/x && exists($data->{'data'}{'data'}[0]{imageData})) { delete $hash->{HELPER}{RUNVIEW}; $hash->{HELPER}{LINK} = $data->{data}{data}[0]{imageData}; } @@ -5902,7 +6032,7 @@ sub camOp_Parse { for(cache($name, "c_getkeys")) { # relevant keys aus allen vorkommenden selektieren next if $_ !~ /\{SNAPHASH\}\{(\d+)\}\{.*\}/; $_ =~ s/\{SNAPHASH\}\{(\d+)\}\{.*\}/$1/; - push @as,$_ if($_=~/^(\d+)$/); + push @as,$_ if($_=~/^(\d+)$/x); } my %seen; my @unique = sort{$a<=>$b} grep { !$seen{$_}++ } @as; @@ -6049,7 +6179,7 @@ sub camOp_Parse { for(cache($name, "c_getkeys")) { # relevant keys aus allen vorkommenden selektieren next if $_ !~ /\{SNAPHASH\}\{(\d+)\}\{.*\}/; $_ =~ s/\{SNAPHASH\}\{(\d+)\}\{.*\}/$1/; - push @as,$_ if($_=~/^(\d+)$/); + push @as,$_ if($_=~/^(\d+)$/x); } my %seen; my @unique = sort{$a<=>$b} grep { !$seen{$_}++ } @as; @@ -6397,14 +6527,14 @@ sub camOp_Parse { my @vl = split (/\.|-/,AttrVal($name, "simu_SVSversion", "")); $major = $vl[0]; $minor = $vl[1]; - $small = ($vl[2] =~ /\d/)?$vl[2]:''; + $small = ($vl[2] =~ /\d/x) ? $vl[2] : ''; $build = "xxxx-simu"; } # Kompatibilitätscheck - my $avsc = $major.$minor.(($small=~/\d/)?$small:0); + my $avsc = $major.$minor.(($small=~/\d/x) ? $small : 0); my $avcomp = $hash->{COMPATIBILITY}; - $avcomp =~ s/\.//g; + $avcomp =~ s/\.//gx; my $compstate; if($avsc <= $avcomp) { @@ -6422,19 +6552,21 @@ sub camOp_Parse { delete $defs{$name}{READINGS}{SVScustomPortHttps}; } - readingsBeginUpdate($hash); - readingsBulkUpdate($hash,"SVScustomPortHttp",$data->{'data'}{'customizedPortHttp'}); - readingsBulkUpdate($hash,"SVScustomPortHttps",$data->{'data'}{'customizedPortHttps'}); - readingsBulkUpdate($hash,"SVSlicenseNumber",$data->{'data'}{'liscenseNumber'}); - readingsBulkUpdate($hash,"SVSuserPriv",$userPriv); + readingsBeginUpdate ($hash); + + readingsBulkUpdate ($hash, "SVScustomPortHttp", $data->{'data'}{'customizedPortHttp'}); + readingsBulkUpdate ($hash, "SVScustomPortHttps", $data->{'data'}{'customizedPortHttps'}); + readingsBulkUpdate ($hash, "SVSlicenseNumber", $data->{'data'}{'liscenseNumber'}); + readingsBulkUpdate ($hash, "SVSuserPriv",$userPriv); if(defined($small)) { - readingsBulkUpdate($hash,"SVSversion",$major.".".$minor.".".$small."-".$build); + readingsBulkUpdate($hash, "SVSversion", $major.".".$minor.".".$small."-".$build); } else { - readingsBulkUpdate($hash,"SVSversion",$major.".".$minor."-".$build); + readingsBulkUpdate($hash, "SVSversion", $major.".".$minor."-".$build); } - readingsBulkUpdate($hash,"Errorcode","none"); - readingsBulkUpdate($hash,"Error","none"); - readingsEndUpdate($hash, 1); + readingsBulkUpdate ($hash, "Errorcode", "none"); + readingsBulkUpdate ($hash, "Error", "none"); + + readingsEndUpdate ($hash, 1); Log3($name, $verbose, "$name - Informations related to Surveillance Station retrieved"); @@ -6460,20 +6592,20 @@ sub camOp_Parse { # Rewrite Url's falls livestreamprefix ist gesetzt if (AttrVal($name, "livestreamprefix", undef)) { my $exturl = AttrVal($name, "livestreamprefix", "$proto://$serveraddr:$serverport"); - $exturl = ($exturl eq "DEF")?"$proto://$serveraddr:$serverport":$exturl; - my @mjh = split(/\//, $mjpegHttp, 4); + $exturl = ($exturl eq "DEF") ? "$proto://$serveraddr:$serverport" : $exturl; + my @mjh = split(/\//, $mjpegHttp, 4); $mjpegHttp = $exturl."/".$mjh[3]; - my @mxh = split(/\//, $mxpegHttp, 4); + my @mxh = split(/\//, $mxpegHttp, 4); $mxpegHttp = $exturl."/".$mxh[3]; if($unicastPath) { - my @ucp = split(/[@\|:]/, $unicastPath); - my @lspf = split(/[\/\/\|:]/, $exturl); + my @ucp = split(/[@\|:]/, $unicastPath); + my @lspf = split(/[\/\/\|:]/, $exturl); $unicastPath = $ucp[0].":".$ucp[1].":".$ucp[2]."@".$lspf[3].":".$ucp[4]; } } # StmKey extrahieren - my @sk = split(/&StmKey=/, $mjpegHttp); + my @sk = split(/&StmKey=/, $mjpegHttp); my $stmkey = $sk[1]; # Quotes in StmKey entfernen falls noQuotesForSID gesetzt @@ -6484,20 +6616,22 @@ sub camOp_Parse { } # Streaminginfos in Helper speichern - $hash->{HELPER}{STMKEYMJPEGHTTP} = $mjpegHttp if($mjpegHttp); - $hash->{HELPER}{STMKEYMXPEGHTTP} = $mxpegHttp if($mxpegHttp); - $hash->{HELPER}{STMKEYUNICSTOVERHTTP} = $unicastOverHttp if($unicastOverHttp); - $hash->{HELPER}{STMKEYUNICST} = $unicastPath if($unicastPath); + $hash->{HELPER}{STMKEYMJPEGHTTP} = $mjpegHttp if($mjpegHttp); + $hash->{HELPER}{STMKEYMXPEGHTTP} = $mxpegHttp if($mxpegHttp); + $hash->{HELPER}{STMKEYUNICSTOVERHTTP} = $unicastOverHttp if($unicastOverHttp); + $hash->{HELPER}{STMKEYUNICST} = $unicastPath if($unicastPath); readingsBeginUpdate($hash); - readingsBulkUpdate($hash,"CamForceEnableMulticast",$camforcemcast) if($camforcemcast); - readingsBulkUpdate($hash,"StmKey",$stmkey); - readingsBulkUpdate($hash,"StmKeymjpegHttp",$mjpegHttp) if(AttrVal($name,"showStmInfoFull",0)); - readingsBulkUpdate($hash,"StmKeymxpegHttp",$mxpegHttp) if(AttrVal($name,"showStmInfoFull",0)); - readingsBulkUpdate($hash,"StmKeyUnicstOverHttp",$unicastOverHttp) if(AttrVal($name,"showStmInfoFull",0) && $unicastOverHttp); - readingsBulkUpdate($hash,"StmKeyUnicst",$unicastPath) if(AttrVal($name,"showStmInfoFull",0) && $unicastPath); - readingsBulkUpdate($hash,"Errorcode","none"); - readingsBulkUpdate($hash,"Error","none"); + + readingsBulkUpdate($hash,"CamForceEnableMulticast", $camforcemcast) if($camforcemcast); + readingsBulkUpdate($hash,"StmKey", $stmkey); + readingsBulkUpdate($hash,"StmKeymjpegHttp", $mjpegHttp) if(AttrVal($name,"showStmInfoFull",0)); + readingsBulkUpdate($hash,"StmKeymxpegHttp", $mxpegHttp) if(AttrVal($name,"showStmInfoFull",0)); + readingsBulkUpdate($hash,"StmKeyUnicstOverHttp", $unicastOverHttp) if(AttrVal($name,"showStmInfoFull",0) && $unicastOverHttp); + readingsBulkUpdate($hash,"StmKeyUnicst", $unicastPath) if(AttrVal($name,"showStmInfoFull",0) && $unicastPath); + readingsBulkUpdate($hash,"Errorcode", "none"); + readingsBulkUpdate($hash,"Error", "none"); + readingsEndUpdate($hash, 1); Log3($name, $verbose, "$name - Stream-URLs of camera $camname retrieved"); @@ -6505,7 +6639,11 @@ sub camOp_Parse { } elsif ($OpMode eq "Getcaminfo") { # Parse Caminfos $camLiveMode = $data->{'data'}->{'cameras'}->[0]->{'camLiveMode'}; - if ($camLiveMode eq "0") {$camLiveMode = "Liveview from DS";}elsif ($camLiveMode eq "1") {$camLiveMode = "Liveview from Camera";} + if ($camLiveMode eq "0") { + $camLiveMode = "Liveview from DS"; + } elsif ($camLiveMode eq "1") { + $camLiveMode = "Liveview from Camera"; + } ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime; if($lang eq "DE") { @@ -6554,7 +6692,7 @@ sub camOp_Parse { } my $rotate = $data->{'data'}->{'cameras'}->[0]->{'video_rotation'}; - $rotate = $rotate == 1?"true":"false"; + $rotate = $rotate == 1 ? "true" : "false"; $exposuremode = jboolmap($data->{'data'}->{'cameras'}->[0]->{'exposure_mode'}); if ($exposuremode == 0) { @@ -6618,38 +6756,38 @@ sub camOp_Parse { my $fw = $data->{'data'}->{'cameras'}->[0]->{'detailInfo'}{'camFirmware'}; readingsBeginUpdate($hash); - readingsBulkUpdate($hash,"CamAudioType",$camaudiotype); - readingsBulkUpdate($hash,"CamFirmware",$fw) if($fw); - readingsBulkUpdate($hash,"CamLiveMode",$camLiveMode); - readingsBulkUpdate($hash,"CamLiveFps",$data->{'data'}->{'cameras'}->[0]->{'detailInfo'}{'camLiveFps'}); - readingsBulkUpdate($hash,"CamLiveResolution",$data->{'data'}->{'cameras'}->[0]->{'detailInfo'}{'camLiveResolution'}); - readingsBulkUpdate($hash,"CamLiveQuality",$data->{'data'}->{'cameras'}->[0]->{'detailInfo'}{'camLiveQuality'}); - readingsBulkUpdate($hash,"CamLiveStreamNo",$clstrmno); - readingsBulkUpdate($hash,"CamExposureMode",$exposuremode); - readingsBulkUpdate($hash,"CamExposureControl",$exposurecontrol); - readingsBulkUpdate($hash,"CamModel",$data->{'data'}->{'cameras'}->[0]->{'detailInfo'}{'camModel'}); - readingsBulkUpdate($hash,"CamRecShare",$data->{'data'}->{'cameras'}->[0]->{'camRecShare'}); - readingsBulkUpdate($hash,"CamRecVolume",$data->{'data'}->{'cameras'}->[0]->{'camRecVolume'}); - readingsBulkUpdate($hash,"CamIP",$data->{'data'}->{'cameras'}->[0]->{'host'}); - readingsBulkUpdate($hash,"CamNTPServer",$data->{'data'}->{'cameras'}->[0]->{'time_server'}) if($data->{'data'}->{'cameras'}->[0]->{'time_server'}); - readingsBulkUpdate($hash,"CamVendor",$data->{'data'}->{'cameras'}->[0]->{'detailInfo'}{'camVendor'}); - readingsBulkUpdate($hash,"CamVideoType",$data->{'data'}->{'cameras'}->[0]->{'camVideoType'}); - readingsBulkUpdate($hash,"CamPreRecTime",$data->{'data'}->{'cameras'}->[0]->{'detailInfo'}{'camPreRecTime'}); - readingsBulkUpdate($hash,"CamPort",$data->{'data'}->{'cameras'}->[0]->{'port'}); - readingsBulkUpdate($hash,"CamPtSpeed",$data->{'data'}->{'cameras'}->[0]->{'ptSpeed'}) if($deviceType =~ /PTZ/); - readingsBulkUpdate($hash,"CamblPresetSpeed",$data->{'data'}->{'cameras'}->[0]->{'blPresetSpeed'}); - readingsBulkUpdate($hash,"CamVideoMirror",$data->{'data'}->{'cameras'}->[0]->{'video_mirror'}); - readingsBulkUpdate($hash,"CamVideoFlip",$data->{'data'}->{'cameras'}->[0]->{'video_flip'}); - readingsBulkUpdate($hash,"CamVideoRotate",$rotate); - readingsBulkUpdate($hash,"CapPIR",$pdcap); - readingsBulkUpdate($hash,"Availability",$camStatus); - readingsBulkUpdate($hash,"DeviceType",$deviceType); - readingsBulkUpdate($hash,"LastUpdateTime",$update_time); - readingsBulkUpdate($hash,"Record",$recStatus); - readingsBulkUpdate($hash,"UsedSpaceMB",$data->{'data'}{'cameras'}[0]{'volume_space'}); - readingsBulkUpdate($hash,"VideoFolder",AttrVal($name, "videofolderMap", $data->{'data'}{'cameras'}[0]{'folder'})); - readingsBulkUpdate($hash,"Errorcode","none"); - readingsBulkUpdate($hash,"Error","none"); + readingsBulkUpdate($hash, "CamAudioType", $camaudiotype); + readingsBulkUpdate($hash, "CamFirmware", $fw) if($fw); + readingsBulkUpdate($hash, "CamLiveMode", $camLiveMode); + readingsBulkUpdate($hash, "CamLiveFps", $data->{'data'}->{'cameras'}->[0]->{'detailInfo'}{'camLiveFps'}); + readingsBulkUpdate($hash, "CamLiveResolution", $data->{'data'}->{'cameras'}->[0]->{'detailInfo'}{'camLiveResolution'}); + readingsBulkUpdate($hash, "CamLiveQuality", $data->{'data'}->{'cameras'}->[0]->{'detailInfo'}{'camLiveQuality'}); + readingsBulkUpdate($hash, "CamLiveStreamNo", $clstrmno); + readingsBulkUpdate($hash, "CamExposureMode", $exposuremode); + readingsBulkUpdate($hash, "CamExposureControl", $exposurecontrol); + readingsBulkUpdate($hash, "CamModel", $data->{'data'}->{'cameras'}->[0]->{'detailInfo'}{'camModel'}); + readingsBulkUpdate($hash, "CamRecShare", $data->{'data'}->{'cameras'}->[0]->{'camRecShare'}); + readingsBulkUpdate($hash, "CamRecVolume", $data->{'data'}->{'cameras'}->[0]->{'camRecVolume'}); + readingsBulkUpdate($hash, "CamIP", $data->{'data'}->{'cameras'}->[0]->{'host'}); + readingsBulkUpdate($hash, "CamNTPServer", $data->{'data'}->{'cameras'}->[0]->{'time_server'}) if($data->{'data'}->{'cameras'}->[0]->{'time_server'}); + readingsBulkUpdate($hash, "CamVendor", $data->{'data'}->{'cameras'}->[0]->{'detailInfo'}{'camVendor'}); + readingsBulkUpdate($hash, "CamVideoType", $data->{'data'}->{'cameras'}->[0]->{'camVideoType'}); + readingsBulkUpdate($hash, "CamPreRecTime", $data->{'data'}->{'cameras'}->[0]->{'detailInfo'}{'camPreRecTime'}); + readingsBulkUpdate($hash, "CamPort", $data->{'data'}->{'cameras'}->[0]->{'port'}); + readingsBulkUpdate($hash, "CamPtSpeed", $data->{'data'}->{'cameras'}->[0]->{'ptSpeed'}) if($deviceType =~ /PTZ/x); + readingsBulkUpdate($hash, "CamblPresetSpeed", $data->{'data'}->{'cameras'}->[0]->{'blPresetSpeed'}); + readingsBulkUpdate($hash, "CamVideoMirror", $data->{'data'}->{'cameras'}->[0]->{'video_mirror'}); + readingsBulkUpdate($hash, "CamVideoFlip", $data->{'data'}->{'cameras'}->[0]->{'video_flip'}); + readingsBulkUpdate($hash, "CamVideoRotate", $rotate); + readingsBulkUpdate($hash, "CapPIR", $pdcap); + readingsBulkUpdate($hash, "Availability", $camStatus); + readingsBulkUpdate($hash, "DeviceType", $deviceType); + readingsBulkUpdate($hash, "LastUpdateTime", $update_time); + readingsBulkUpdate($hash, "Record", $recStatus); + readingsBulkUpdate($hash, "UsedSpaceMB", $data->{'data'}{'cameras'}[0]{'volume_space'}); + readingsBulkUpdate($hash, "VideoFolder", AttrVal($name, "videofolderMap", $data->{'data'}{'cameras'}[0]{'folder'})); + readingsBulkUpdate($hash, "Errorcode", "none"); + readingsBulkUpdate($hash, "Error", "none"); readingsEndUpdate($hash, 1); $hash->{MODEL} = ReadingsVal($name,"CamVendor","")." - ".ReadingsVal($name,"CamModel","CAM") if(IsModelCam($hash)); @@ -6919,7 +7057,7 @@ sub camOp_Parse { readingsBulkUpdate ($hash,"Error", $error ); readingsEndUpdate ($hash, 1); - if ($errorcode =~ /105/) { + if ($errorcode =~ /105/x) { Log3($name, 2, "$name - ERROR - $errorcode - $error in operation $OpMode -> try new login"); undef $data; undef $myjson; @@ -7256,7 +7394,7 @@ sub evaljson { if( ($hash->{HELPER}{RUNVIEW} && $hash->{HELPER}{RUNVIEW} =~ m/^live_.*hls$/) || $OpMode =~ m/^.*_hls$/ ) { # HLS aktivate/deaktivate bringt kein JSON wenn bereits aktiviert/deaktiviert Log3($name, 5, "$name - HLS-activation data return: $myjson"); - if ($myjson =~ m/{"success":true}/) { + if ($myjson =~ m/{"success":true}/x) { $success = 1; $myjson = '{"success":true}'; } @@ -7494,9 +7632,9 @@ return ($slim,$ssize); sub extlogargs { my ($hash,$a) = @_; - $hash->{HELPER}{LISTLOGSEVERITY} = (split("severity:",$a))[1] if(lc($a) =~ m/^severity:.*/); - $hash->{HELPER}{LISTLOGLIMIT} = (split("limit:",$a))[1] if(lc($a) =~ m/^limit:.*/); - $hash->{HELPER}{LISTLOGMATCH} = (split("match:",$a))[1] if(lc($a) =~ m/^match:.*/); + $hash->{HELPER}{LISTLOGSEVERITY} = (split("severity:",$a))[1] if(lc($a) =~ m/^severity:/x); + $hash->{HELPER}{LISTLOGLIMIT} = (split("limit:",$a))[1] if(lc($a) =~ m/^limit:/x); + $hash->{HELPER}{LISTLOGMATCH} = (split("match:",$a))[1] if(lc($a) =~ m/^match:/x); return; } @@ -7507,10 +7645,10 @@ return; sub extoptpar { my ($hash,$a,$cpcl) = @_; - $hash->{HELPER}{MIRROR} = (split("mirror:",$a))[1] if(lc($a) =~ m/^mirror:.*/); - $hash->{HELPER}{FLIP} = (split("flip:",$a))[1] if(lc($a) =~ m/^flip:.*/); - $hash->{HELPER}{ROTATE} = (split("rotate:",$a))[1] if(lc($a) =~ m/^rotate:.*/); - $hash->{HELPER}{NTPSERV} = (split("ntp:",$a))[1] if(lc($a) =~ m/^ntp:.*/); + $hash->{HELPER}{MIRROR} = (split("mirror:",$a))[1] if(lc($a) =~ m/^mirror:/x); + $hash->{HELPER}{FLIP} = (split("flip:",$a))[1] if(lc($a) =~ m/^flip:/x); + $hash->{HELPER}{ROTATE} = (split("rotate:",$a))[1] if(lc($a) =~ m/^rotate:/x); + $hash->{HELPER}{NTPSERV} = (split("ntp:",$a))[1] if(lc($a) =~ m/^ntp:/x); $hash->{HELPER}{CHKLIST} = ($hash->{HELPER}{NTPSERV}?$cpcl->{ntp}:0)+ ($hash->{HELPER}{MIRROR}?$cpcl->{mirror}:0)+ @@ -7599,6 +7737,12 @@ sub ptzPanel { ### PTZ-Elemente ######################### $ptz_ret .= '
'; + $ptz_ret .= ""; + $ptz_ret .= ""; + $ptz_ret .= ""; + $ptz_ret .= ""; + $ptz_ret .= ""; + $ptz_ret .= ""; for my $rownr (0..9) { $rownr = sprintf("%2.2d",$rownr); @@ -7622,7 +7766,7 @@ sub ptzPanel { $img = $btn[$btnnr]; } - if ($img =~ m/\.svg/) { # Verwendung für SVG's + if ($img =~ m/\.svg/x) { # Verwendung für SVG's $img = FW_makeImage($img, $cmd, "rc-button"); } else { # $FW_ME = URL-Pfad unter dem der FHEMWEB-Server via HTTP erreichbar ist, z.B. /fhem @@ -7646,15 +7790,13 @@ sub ptzPanel { } $ptz_ret .= "\n"; } - $ptz_ret .= "
PTZ Control

"; ### Zoom ############################### - if(IsCapZoom($hash)) { # wenn Zoom Eigenschaft + if(IsCapZoom($hash)) { # wenn Zoom Eigenschaft - $ptz_ret .= ''; $ptz_ret .= ""; - $ptz_ret .= ""; + $ptz_ret .= ""; $ptz_ret .= ""; $ptz_ret .= ""; @@ -7692,9 +7834,10 @@ sub ptzPanel { } $ptz_ret .= ""; - $ptz_ret .= "
Zoom
"; } + $ptz_ret .= ""; + ### add Preset / Patrols ############################### if(!$ftui) { @@ -7923,9 +8066,9 @@ sub streamDev { my $hau = AttrVal($strmdev, "hideAudio", 0); # Audio Steuerblock im Footer ausblenden ? my $pws = AttrVal($strmdev, "popupWindowSize", ""); # Größe eines Popups - $pws =~ s/"//g if($pws); + $pws =~ s/"//gx if($pws); - $show = $defs{$streamHash->{PARENT}}->{HELPER}{ACTSTRM} if($streamHash->{MODEL} =~ /switched/); + $show = $defs{$streamHash->{PARENT}}->{HELPER}{ACTSTRM} if($streamHash->{MODEL} =~ /switched/x); $show = $show ? "($show)" : ""; my $alias = AttrVal($strmdev, "alias", $strmdev); # Linktext als Aliasname oder Devicename setzen @@ -7939,32 +8082,32 @@ sub streamDev { my $ttjs = "/fhem/pgm2/sscam_tooltip.js"; my ($ttrefresh, $ttrecstart, $ttrecstop, $ttsnap, $ttcmdstop, $tthlsreact, $ttmjpegrun, $tthlsrun, $ttlrrun, $tth264run, $ttlmjpegrun, $ttlsnaprun); - if(AttrVal("global","language","EN") =~ /EN/) { - $ttrefresh = $ttips_en{"ttrefresh"}; $ttrefresh =~ s/§NAME§/$calias/g; - $ttrecstart = $ttips_en{"ttrecstart"}; $ttrecstart =~ s/§NAME§/$calias/g; - $ttrecstop = $ttips_en{"ttrecstop"}; $ttrecstop =~ s/§NAME§/$calias/g; - $ttsnap = $ttips_en{"ttsnap"}; $ttsnap =~ s/§NAME§/$calias/g; - $ttcmdstop = $ttips_en{"ttcmdstop"}; $ttcmdstop =~ s/§NAME§/$calias/g; - $tthlsreact = $ttips_en{"tthlsreact"}; $tthlsreact =~ s/§NAME§/$calias/g; - $ttmjpegrun = $ttips_en{"ttmjpegrun"}; $ttmjpegrun =~ s/§NAME§/$calias/g; - $tthlsrun = $ttips_en{"tthlsrun"}; $tthlsrun =~ s/§NAME§/$calias/g; - $ttlrrun = $ttips_en{"ttlrrun"}; $ttlrrun =~ s/§NAME§/$calias/g; - $tth264run = $ttips_en{"tth264run"}; $tth264run =~ s/§NAME§/$calias/g; - $ttlmjpegrun= $ttips_en{"ttlmjpegrun"}; $ttlmjpegrun =~ s/§NAME§/$calias/g; - $ttlsnaprun = $ttips_en{"ttlsnaprun"}; $ttlsnaprun =~ s/§NAME§/$calias/g; + if(AttrVal("global","language","EN") =~ /EN/x) { + $ttrefresh = $ttips_en{"ttrefresh"}; $ttrefresh =~ s/§NAME§/$calias/gx; + $ttrecstart = $ttips_en{"ttrecstart"}; $ttrecstart =~ s/§NAME§/$calias/gx; + $ttrecstop = $ttips_en{"ttrecstop"}; $ttrecstop =~ s/§NAME§/$calias/gx; + $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; + $ttmjpegrun = $ttips_en{"ttmjpegrun"}; $ttmjpegrun =~ s/§NAME§/$calias/gx; + $tthlsrun = $ttips_en{"tthlsrun"}; $tthlsrun =~ s/§NAME§/$calias/gx; + $ttlrrun = $ttips_en{"ttlrrun"}; $ttlrrun =~ s/§NAME§/$calias/gx; + $tth264run = $ttips_en{"tth264run"}; $tth264run =~ s/§NAME§/$calias/gx; + $ttlmjpegrun= $ttips_en{"ttlmjpegrun"}; $ttlmjpegrun =~ s/§NAME§/$calias/gx; + $ttlsnaprun = $ttips_en{"ttlsnaprun"}; $ttlsnaprun =~ s/§NAME§/$calias/gx; } else { - $ttrefresh = $ttips_de{"ttrefresh"}; $ttrefresh =~ s/§NAME§/$calias/g; - $ttrecstart = $ttips_de{"ttrecstart"}; $ttrecstart =~ s/§NAME§/$calias/g; - $ttrecstop = $ttips_de{"ttrecstop"}; $ttrecstop =~ s/§NAME§/$calias/g; - $ttsnap = $ttips_de{"ttsnap"}; $ttsnap =~ s/§NAME§/$calias/g; - $ttcmdstop = $ttips_de{"ttcmdstop"}; $ttcmdstop =~ s/§NAME§/$calias/g; - $tthlsreact = $ttips_de{"tthlsreact"}; $tthlsreact =~ s/§NAME§/$calias/g; - $ttmjpegrun = $ttips_de{"ttmjpegrun"}; $ttmjpegrun =~ s/§NAME§/$calias/g; - $tthlsrun = $ttips_de{"tthlsrun"}; $tthlsrun =~ s/§NAME§/$calias/g; - $ttlrrun = $ttips_de{"ttlrrun"}; $ttlrrun =~ s/§NAME§/$calias/g; - $tth264run = $ttips_de{"tth264run"}; $tth264run =~ s/§NAME§/$calias/g; - $ttlmjpegrun= $ttips_de{"ttlmjpegrun"}; $ttlmjpegrun =~ s/§NAME§/$calias/g; - $ttlsnaprun = $ttips_de{"ttlsnaprun"}; $ttlsnaprun =~ s/§NAME§/$calias/g; + $ttrefresh = $ttips_de{"ttrefresh"}; $ttrefresh =~ s/§NAME§/$calias/gx; + $ttrecstart = $ttips_de{"ttrecstart"}; $ttrecstart =~ s/§NAME§/$calias/gx; + $ttrecstop = $ttips_de{"ttrecstop"}; $ttrecstop =~ s/§NAME§/$calias/gx; + $ttsnap = $ttips_de{"ttsnap"}; $ttsnap =~ s/§NAME§/$calias/gx; + $ttcmdstop = $ttips_de{"ttcmdstop"}; $ttcmdstop =~ s/§NAME§/$calias/gx; + $tthlsreact = $ttips_de{"tthlsreact"}; $tthlsreact =~ s/§NAME§/$calias/gx; + $ttmjpegrun = $ttips_de{"ttmjpegrun"}; $ttmjpegrun =~ s/§NAME§/$calias/gx; + $tthlsrun = $ttips_de{"tthlsrun"}; $tthlsrun =~ s/§NAME§/$calias/gx; + $ttlrrun = $ttips_de{"ttlrrun"}; $ttlrrun =~ s/§NAME§/$calias/gx; + $tth264run = $ttips_de{"tth264run"}; $tth264run =~ s/§NAME§/$calias/gx; + $ttlmjpegrun= $ttips_de{"ttlmjpegrun"}; $ttlmjpegrun =~ s/§NAME§/$calias/gx; + $ttlsnaprun = $ttips_de{"ttlsnaprun"}; $ttlsnaprun =~ s/§NAME§/$calias/gx; } $ret = ""; @@ -7991,7 +8134,7 @@ sub streamDev { return $ret; } - if ($fmt =~ /mjpeg/) { + if ($fmt =~ /mjpeg/x) { if(ReadingsVal($camname, "SVSversion", "8.2.3-5828") eq "8.2.3-5828" && ReadingsVal($camname, "CamVideoType", "") !~ /MJPEG/) { $ret .= "
Because SVS version 8.2.3-5828 is running you cannot see the MJPEG-Stream. Please upgrade to a higher SVS version !

"; } else { @@ -8038,7 +8181,7 @@ sub streamDev { $ret .= "" if(AttrVal($camname,"ptzPanel_use",0)); } - } elsif ($fmt =~ /lastsnap/) { + } elsif ($fmt =~ /lastsnap/x) { # $link = $hash->{HELPER}{".LASTSNAP"}; my $cache = cache($camname, "c_init"); # Cache initialisieren Log3($camname, 1, "$camname - Fall back to internal Cache due to preceding failure.") if(!$cache); @@ -8063,16 +8206,16 @@ sub streamDev { $streamHash->{HELPER}{STREAMACTIVE} = 1 if($link); # Statusbit wenn ein Stream aktiviert ist } else { $cause = "no snapshot available to display"; - $cause = "kein Schnappschuss zur Anzeige vorhanden" if(AttrVal("global","language","EN") =~ /DE/i); + $cause = "kein Schnappschuss zur Anzeige vorhanden" if(AttrVal("global","language","EN") =~ /DE/ix); $ret .= "
$cause

"; } - } elsif ($fmt =~ /generic/) { + } elsif ($fmt =~ /generic/x) { my $htag = AttrVal($strmdev,"genericStrmHtmlTag",AttrVal($camname,"genericStrmHtmlTag","")); if( $htag =~ m/^\s*(.*)\s*$/s ) { $htag = $1; - $htag =~ s/\$NAME/$camname/g; + $htag =~ s/\$NAME/$camname/xg; $htag =~ s/\$HTMLATTR/$ha/g; $htag =~ s/\$PWS/$pws/g; } @@ -8093,8 +8236,8 @@ sub streamDev { $ptag =~ m/^(\s+)?(?<)(\s+)?(?.*)(\s+)?(?onClick=.*)(\s+)?(?>)(\s+)?$/s; $ptag = $+{heart}?$+{b}.$+{heart}.$+{e}:$ptag; $streamHash->{HELPER}{STREAM} = "$ptag"; # Stream für "set popupStream" speichern - $streamHash->{HELPER}{STREAM} =~ s/["']//g; - $streamHash->{HELPER}{STREAM} =~ s/\s+/ /g; + $streamHash->{HELPER}{STREAM} =~ s/["']//gx; + $streamHash->{HELPER}{STREAM} =~ s/\s+/ /gx; $streamHash->{HELPER}{STREAMACTIVE} = 1; # Statusbit wenn ein Stream aktiviert ist } $ret .= "
"; @@ -8119,17 +8262,17 @@ sub streamDev { } } - } elsif ($fmt =~ /hls/) { + } elsif ($fmt =~ /hls/x) { # es ist ein .m3u8-File bzw. ein Link dorthin zu übergeben my $cam = AttrVal($camname, "alias", $camname); my $m3u8 = AttrVal($camname, "hlsStrmObject", ""); if( $m3u8 =~ m/^\s*(.*)\s*$/s ) { $m3u8 = $1; - $m3u8 =~ s/\$NAME/$camname/g; + $m3u8 =~ s/\$NAME/$camname/gx; } my $d = $camname; - $d =~ s/\./_/; # Namensableitung zur javascript Codeanpassung + $d =~ s/\./_/x; # Namensableitung zur javascript Codeanpassung if(!$m3u8) { $cause = "You have to specify attribute \"hlsStrmObject\" in Camera $cam !"; @@ -8166,12 +8309,12 @@ sub streamDev { } } - } elsif ($fmt =~ /switched/) { + } elsif ($fmt =~ /switched/x) { my $wltype = $hash->{HELPER}{WLTYPE}; $link = $hash->{HELPER}{LINK}; - if($link && $wltype =~ /image|iframe|video|base64img|embed|hls/) { - if($wltype =~ /image/) { + if($link && $wltype =~ /image|iframe|video|base64img|embed|hls/x) { + if($wltype =~ /image/x) { if(ReadingsVal($camname, "SVSversion", "8.2.3-5828") eq "8.2.3-5828" && ReadingsVal($camname, "CamVideoType", "") !~ /MJPEG/) { $ret .= "
Because SVS version 8.2.3-5828 is running you cannot see the MJPEG-Stream. Please upgrade to a higher SVS version !

"; } else { @@ -8185,7 +8328,7 @@ sub streamDev { } $ret .= "$imgstop "; $ret .= $imgblank; - if($hash->{HELPER}{RUNVIEW} =~ /live_fw/) { + if($hash->{HELPER}{RUNVIEW} =~ /live_fw/x) { if(ReadingsVal($camname, "Record", "Stop") eq "Stop") { # Aufnahmebutton endlos Start $ret .= "$imgrecendless "; @@ -8196,7 +8339,7 @@ sub streamDev { $ret .= "$imgdosnap "; } $ret .= ""; - if(AttrVal($camname,"ptzPanel_use",1) && $hash->{HELPER}{RUNVIEW} =~ /live_fw/) { + if(AttrVal($camname,"ptzPanel_use",1) && $hash->{HELPER}{RUNVIEW} =~ /live_fw/x) { my $ptz_ret = ptzPanel($camname,$strmdev,'',$ftui); if($ptz_ret) { $ret .= "$ptz_ret"; @@ -8212,7 +8355,7 @@ sub streamDev { $ret .= "" if(AttrVal($camname,"ptzPanel_use",0)); } - } elsif ($wltype =~ /iframe/) { + } elsif ($wltype =~ /iframe/x) { if(!$ftui) { $ret .= "