######################################################################################################################## # $Id: $ ######################################################################################################################### # 60_Watches.pm # # (c) 2018-2020 by Heiko Maaz # e-mail: Heiko dot Maaz at t-online dot de # # This script is part of fhem. # # Fhem is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # Fhem is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with fhem. If not, see . # # The script is based on sources from following sites: # # modern clock: https://www.w3schools.com/graphics/canvas_clock_start.asp # # station clock: http://www.3quarks.com/de/Bahnhofsuhr/ # # digital clock: http://www.3quarks.com/de/Segmentanzeige/index.html # ######################################################################################################################### package FHEM::Watches; ## no critic 'package' use strict; use warnings; use Time::HiRes qw(time gettimeofday tv_interval); use GPUtils qw(GP_Import GP_Export); # wird für den Import der FHEM Funktionen aus der fhem.pl benötigt # use POSIX; eval "use FHEM::Meta;1" or my $modMetaAbsent = 1; ## no critic 'eval' # Run before module compilation BEGIN { # Import from main:: GP_Import( qw( AttrVal defs IsDisabled Log3 modules ReadingsVal readingsDelete readingsBeginUpdate readingsBulkUpdate readingsEndUpdate readingsSingleUpdate sortTopicNum ) ); # Export to main context with different name # my $pkg = caller(0); # my $main = $pkg; # $main =~ s/^(?:.+::)?([^:]+)$/main::$1\_/gx; # foreach (@_) { # *{ $main . $_ } = *{ $pkg . '::' . $_ }; # } GP_Export( qw( Initialize ) ); } # Versions History intern my %vNotesIntern = ( "0.16.0" => "04.05.2020 delete attr 'digitalDisplayText', new setter 'displayText', 'displayTextDel' ", "0.15.1" => "04.05.2020 fix permanently events when no alarmTime is set in countdownwatch and countdown is finished ", "0.15.0" => "04.05.2020 new attribute 'digitalSegmentType' for different segement count, also new attributes ". "'digitalDigitAngle', 'digitalDigitDistance', 'digitalDigitHeight', 'digitalDigitWidth', 'digitalSegmentDistance' ". "'digitalSegmentWidth', stopwatches don't stop when alarm is triggered (use notify to do it) ", "0.14.0" => "03.05.2020 switch to packages, use setVersionInfo, support of Meta.pm ", "0.13.0" => "03.05.2020 set resume for countdownwatch, set 'continue' removed ", "0.12.0" => "03.05.2020 set resume for stopwatch, new 'alarmHMSdel' command for stop watches, alarmHMS renamed to 'alarmHMSdelset' ", "0.11.0" => "02.05.2020 alarm event stabilized, reset command for 'countdownwatch', event alarmed contains alarm time ", "0.10.0" => "02.05.2020 renamed 'countDownDone' to 'alarmed', bug fix ", "0.9.0" => "02.05.2020 new attribute 'timeSource' for selection of client/server time ", "0.8.0" => "01.05.2020 new values 'countdownwatch' for attribute digitalDisplayPattern, switch all watches to server time ", "0.7.0" => "30.04.2020 new set 'continue' for stopwatch ", "0.6.0" => "29.04.2020 new set 'reset' for stopwatch, read 'state' and 'starttime' from readings, add csrf token support ", "0.5.0" => "28.04.2020 new values 'stopwatch', 'staticwatch' for attribute digitalDisplayPattern ", "0.4.0" => "20.11.2018 text display ", "0.3.0" => "19.11.2018 digital clock added ", "0.2.0" => "14.11.2018 station clock added ", "0.1.0" => "13.11.2018 initial Version with modern analog clock" ); ############################################################################## # Initialize Funktion ############################################################################## sub Initialize { my ($hash) = @_; $hash->{DefFn} = \&Define; $hash->{SetFn} = \&Set; $hash->{FW_summaryFn} = \&FWebFn; $hash->{FW_detailFn} = \&FWebFn; $hash->{AttrFn} = \&Attr; $hash->{AttrList} = "digitalColorBackground:colorpicker ". "digitalColorDigits:colorpicker ". "digitalDisplayPattern:countdownwatch,staticwatch,stopwatch,text,watch ". "digitalDigitAngle:slider,-30,0.5,30,1 ". "digitalDigitDistance:slider,0.5,0.1,10,1 ". "digitalDigitHeight:slider,5,0.1,50,1 ". "digitalDigitWidth:slider,5,0.1,50,1 ". "digitalSegmentDistance:slider,0,0.1,5,1 ". "digitalSegmentType:7,14,16 ". "digitalSegmentWidth:slider,0.3,0.1,3.5,1 ". "disable:1,0 ". "hideDisplayName:1,0 ". "htmlattr ". "modernColorBackground:colorpicker ". "modernColorHand:colorpicker ". "modernColorFigure:colorpicker ". "modernColorFace:colorpicker ". "modernColorRing:colorpicker ". "modernColorRingEdge:colorpicker ". "stationSecondHand:Bar,HoleShaped,NewHoleShaped,No ". "stationSecondHandBehavoir:Bouncing,Overhasty,Creeping,ElasticBouncing ". "stationMinuteHandBehavoir:Bouncing,Creeping,ElasticBouncing ". "stationBoss:Red,Black,Vienna,No ". "stationMinuteHand:Bar,Pointed,Swiss,Vienna ". "stationHourHand:Bar,Pointed,Swiss,Vienna ". "stationStrokeDial:GermanHour,German,Austria,Swiss,Vienna,No ". "stationBody:Round,SmallWhite,RoundGreen,Square,Vienna,No ". "timeSource:client,server ". ""; $hash->{FW_hideDisplayName} = 1; # Forum 88667 # $hash->{FW_addDetailToSummary} = 1; $hash->{FW_atPageEnd} = 1; # wenn 1 -> kein Longpoll ohne informid in HTML-Tag eval { FHEM::Meta::InitMod( __FILE__, $hash ) }; ## no critic 'eval' # für Meta.pm (https://forum.fhem.de/index.php/topic,97589.0.html) return; } ############################################################################## # Define Funktion ############################################################################## sub Define { my ($hash, $def) = @_; my $name = $hash->{NAME}; my @a = split m{\s+}, $def; if(!$a[2]) { return "You need to specify more parameters.\n". "Format: define Watches [Modern | Station | Digital]"; } $hash->{HELPER}{MODMETAABSENT} = 1 if($modMetaAbsent); # Modul Meta.pm nicht vorhanden $hash->{MODEL} = $a[2]; setVersionInfo($hash); # Versionsinformationen setzen readingsSingleUpdate($hash,"state", "initialized", 1); # Init für "state" return; } ############################################################################## # Set Funktion ############################################################################## sub Set { ## no critic 'complexity' my ($hash, @a) = @_; return "\"set X\" needs at least an argument" if ( @a < 2 ); my $name = $a[0]; my $opt = $a[1]; my $prop = $a[2]; my $prop1 = $a[3]; my $prop2 = $a[4]; my $prop3 = $a[5]; my $model = $hash->{MODEL}; my $addp = AttrVal($name, "digitalDisplayPattern", "watch"); return if(IsDisabled($name)); my $setlist = "Unknown argument $opt, choose one of "; $setlist .= "time " if($addp =~ /staticwatch/); $setlist .= "alarmHMSset alarmHMSdel:noArg reset:noArg resume:noArg start:noArg stop:noArg " if($addp =~ /stopwatch|countdownwatch/); $setlist .= "countDownInit " if($addp =~ /countdownwatch/); # $setlist .= "alarmHMSset alarmHMSdel:noArg " if($addp =~ /\bwatch\b/); $setlist .= "displayTextSet displayTextDel:noArg " if($addp eq "text"); if ($opt =~ /\bstart\b/) { return qq{Please set "countDownInit" before !} if($addp =~ /countdownwatch/ && !ReadingsVal($name, "countInitVal", "")); my $ms = int(time*1000); readingsBeginUpdate ($hash); readingsBulkUpdate ($hash, "alarmed", 0) if($addp =~ /stopwatch|countdownwatch/); readingsBulkUpdate ($hash, "starttime", $ms); readingsBulkUpdate ($hash, "state", "started"); readingsEndUpdate ($hash, 1); } elsif ($opt eq "alarmHMSset") { $prop = ($prop ne "") ? $prop : 70; # Stunden $prop1 = ($prop1 ne "") ? $prop1 : 70; # Minuten $prop2 = ($prop2 ne "") ? $prop2 : 70; # Sekunden return qq{The value for "$opt" is invalid. Use parameter "hh mm ss" like "19 45 13".} if($prop>24 || $prop1>59 || $prop2>59); my $at = sprintf("%02d",$prop).":".sprintf("%02d",$prop1).":".sprintf("%02d",$prop2); delReadings ($name, "alarmTime"); readingsBeginUpdate ($hash); readingsBulkUpdate ($hash, "alarmed", 0); readingsBulkUpdate ($hash, "alarmTime", $at); readingsEndUpdate ($hash, 1); } elsif ($opt eq "alarmHMSdel") { delReadings ($name, "alarmTime"); delReadings ($name, "alarmed"); } elsif ($opt eq "countDownInit") { $prop = ($prop ne "") ? $prop : 70; # Stunden $prop1 = ($prop1 ne "") ? $prop1 : 70; # Minuten $prop2 = ($prop2 ne "") ? $prop2 : 70; # Sekunden return qq{The value for "$opt" is invalid. Use parameter "hh mm ss" like "19 45 13".} if($prop>24 || $prop1>59 || $prop2>59); my $st = int(time*1000); # Millisekunden ! my $ct = $prop*3600 + $prop1*60 + $prop2; # Sekunden ! delReadings ($name, "countInitVal"); readingsBeginUpdate ($hash); readingsBulkUpdate ($hash, "countInitVal", $ct); readingsBulkUpdate ($hash, "state", "initialized"); readingsEndUpdate ($hash, 1); } elsif ($opt eq "resume") { return qq{Please set "countDownInit" before !} if($addp =~ /countdownwatch/ && !ReadingsVal($name, "countInitVal", "")); my $ms = int(time*1000); readingsSingleUpdate($hash, "starttime", $ms, 0); return if(ReadingsVal($name, "state", "") eq "started"); readingsSingleUpdate($hash, "state", "resumed", 1); } elsif ($opt eq "stop") { readingsSingleUpdate($hash, "state", "stopped", 1); } elsif ($opt eq "displayTextSet") { shift @a; shift @a; my $txt = join (" ", @a); readingsSingleUpdate($hash, "displayText", $txt, 0); } elsif ($opt eq "displayTextDel") { delReadings ($name, "displayText"); } elsif ($opt eq "reset") { delReadings ($name); readingsSingleUpdate($hash, "state", "initialized", 1); } elsif ($opt eq "time") { return qq{The value for "$opt" is invalid. Use parameter "hh mm ss" like "19 45 13".} if($prop>24 || $prop1>59 || $prop2>59); readingsBeginUpdate ($hash); readingsBulkUpdate ($hash, "hour", $prop); readingsBulkUpdate ($hash, "minute", $prop1); readingsBulkUpdate ($hash, "second", $prop2); readingsEndUpdate ($hash, 1); } else { return "$setlist"; } return; } ############################################################################## # Attributfunktion ############################################################################## sub Attr { my ($cmd,$name,$aName,$aVal) = @_; my $hash = $defs{$name}; my ($do,$val); # $cmd can be "del" or "set" # $name is device name # aName and aVal are Attribute name and value if ($cmd eq "set" && $hash->{MODEL} !~ /modern/i && $aName =~ /^modern.*/) { return qq{"$aName" is only valid for Watches model "Modern"}; } if ($cmd eq "set" && $hash->{MODEL} !~ /station/i && $aName =~ /^station.*/) { return qq{"$aName" is only valid for Watches model "Station"}; } if ($cmd eq "set" && $hash->{MODEL} !~ /digital/i && $aName =~ /^digital.*/) { return qq{"$aName" is only valid for Watches model "Digital"}; } if ($aName eq "disable") { if($cmd eq "set") { $do = ($aVal) ? 1 : 0; } $do = 0 if($cmd eq "del"); $val = ($do == 1 ? "disabled" : "initialized"); readingsSingleUpdate($hash, "state", $val, 1); } if ($aName eq "digitalDisplayPattern") { if($cmd eq "set") { $do = $aVal; } $do = 0 if($cmd eq "del"); delReadings ($name); readingsSingleUpdate($hash, "state", "initialized", 1); if($do =~ /\bstopwatch\b/) { my $ms = int(time*1000); readingsSingleUpdate($hash, "starttime", $ms, 0); } } return; } ############################################################################## # Webanzeige des Devices ############################################################################## sub FWebFn { my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash is set for summaryFn. my $hash = $defs{$d}; my $alias = AttrVal($d, "alias", $d); # Linktext als Aliasname oder Devicename setzen my $dlink = "$alias"; my $ret = ""; $ret .= "$dlink
" if(!AttrVal($d,"hideDisplayName",0)); if(IsDisabled($d)) { if(AttrVal($d,"hideDisplayName",0)) { $ret .= "Watch $d is disabled"; } else { $ret .= "Watch is disabled"; } } else { $ret .= modernWatch ($d) if($hash->{MODEL} =~ /modern/i); $ret .= stationWatch($d) if($hash->{MODEL} =~ /station/i); $ret .= digitalWatch($d) if($hash->{MODEL} =~ /digital/i); } return $ret; } ############################################################################## # löscht alle oder das spezifizierte Reading (außer state) ############################################################################## sub delReadings { my ($name,$reading) = @_; my $hash = $defs{$name}; if($reading) { readingsDelete($hash,$reading); return; } my @allrds = keys%{$hash->{READINGS}}; for my $key(@allrds) { next if($key =~ /\bstate\b/); readingsDelete($hash,$key); } return; } ############################################################################## # Digitale Uhr / Anzeige aus: # http://www.3quarks.com/de/Segmentanzeige/index.html # ############################################################################## sub digitalWatch { my ($d) = @_; my $hash = $defs{$d}; my $alarmdef = "00:00:00"; my $hattr = AttrVal($d, "htmlattr", "width='150' height='50'"); my $bgc = AttrVal($d, "digitalColorBackground", "C4C4C4"); my $dcd = AttrVal($d, "digitalColorDigits", "000000"); my $addp = AttrVal($d, "digitalDisplayPattern", "watch"); my $adst = AttrVal($d, "digitalSegmentType", 7); my $adsw = AttrVal($d, "digitalSegmentWidth", 1.5); my $addh = AttrVal($d, "digitalDigitHeight", 20); my $addw = AttrVal($d, "digitalDigitWidth", 12); my $addd = AttrVal($d, "digitalDigitDistance", 2); my $adsd = AttrVal($d, "digitalSegmentDistance", 0.5); my $adda = AttrVal($d, "digitalDigitAngle", 9); my $ddt = ReadingsVal($d, "displayText", "Play"); $ddt =~ s/[\r\n]//g; my $alarm = " ".ReadingsVal($d, "alarmTime", "aa:bb:cc"); my $ddp = "###:##:##"; # dummy my ($h,$m,$s) = (0,0,0); if($addp eq "watch") { $ddp = "###:##:##"; $ddt = "((hours < 10) ? ' 0' : ' ') + hours + ':' + ((minutes < 10) ? '0' : '') + minutes + ':' + ((seconds < 10) ? '0' : '') + seconds"; } elsif ($addp eq "stopwatch" || $addp eq "countdownwatch") { $alarmdef = "aa:bb:cc" if($addp eq "stopwatch"); # Stoppuhr bei Start 00:00:00 nicht Alerm auslösen $ddp = "###:##:##"; $ddt = "((hours_$d < 10) ? ' 0' : ' ') + hours_$d + ':' + ((minutes_$d < 10) ? '0' : '') + minutes_$d + ':' + ((seconds_$d < 10) ? '0' : '') + seconds_$d"; } elsif ($addp eq "staticwatch") { $ddp = "###:##:##"; $h = ReadingsVal($d, "hour" , 0); $m = ReadingsVal($d, "minute", 0); $s = ReadingsVal($d, "second", 0); $ddt = "((hours_$d < 10) ? ' 0' : ' ') + hours_$d + ':' + ((minutes_$d < 10) ? '0' : '') + minutes_$d + ':' + ((seconds_$d < 10) ? '0' : '') + seconds_$d"; } elsif ($addp eq "text") { my $txtc = length($ddt); $ddp = ""; for(my $i = 0; $i <= $txtc; $i++) { $ddp .= "#"; } $ddt = "' ".$ddt."'"; } return " "; } ############################################################################## # Bahnhofsuhr aus: # http://www.3quarks.com/de/Bahnhofsuhr # ############################################################################## sub stationWatch { my ($d) = @_; my $hash = $defs{$d}; my $ssh = AttrVal($d,"stationSecondHand","Bar")."SecondHand"; my $shb = AttrVal($d,"stationSecondHandBehavoir","Bouncing")."SecondHand"; my $smh = AttrVal($d,"stationMinuteHand","Pointed")."MinuteHand"; my $mhb = AttrVal($d,"stationMinuteHandBehavoir","Bouncing")."MinuteHand"; my $shh = AttrVal($d,"stationHourHand","Pointed")."HourHand"; my $sb = AttrVal($d,"stationBoss","Red")."Boss"; my $ssd = AttrVal($d,"stationStrokeDial","Swiss")."StrokeDial"; my $sbody = AttrVal($d,"stationBody","Round")."Body"; my $hattr = AttrVal($d,"htmlattr","width='150' height='150'"); my $tsou = AttrVal($d,"timeSource","server"); return " "; } ############################################################################## # Moderne Uhr aus: # https://www.w3schools.com/graphics/canvas_clock_start.asp # ############################################################################## sub modernWatch { my ($d) = @_; my $hash = $defs{$d}; my $facec = AttrVal($d,"modernColorFace","FFFEFA"); my $bgc = AttrVal($d,"modernColorBackground","333"); my $fc = AttrVal($d,"modernColorFigure","333"); my $hc = AttrVal($d,"modernColorHand","333"); my $fr = AttrVal($d,"modernColorRing","FFFFFF"); my $fre = AttrVal($d,"modernColorRingEdge","333"); my $hattr = AttrVal($d,"htmlattr","width='150' height='150'"); my $tsou = AttrVal($d,"timeSource","server"); return " "; } ############################################################################## # Versionierungen des Moduls setzen # Die Verwendung von Meta.pm und Packages wird berücksichtigt # ############################################################################## sub setVersionInfo { my ($hash) = @_; my $name = $hash->{NAME}; my $v = (sortTopicNum("desc",keys %vNotesIntern))[0]; my $type = $hash->{TYPE}; $hash->{HELPER}{PACKAGE} = __PACKAGE__; $hash->{HELPER}{VERSION} = $v; 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: 76_SMAPortal.pm 21740 2020-04-21 15:01:42Z DS_Starter $ im Kopf komplett! vorhanden ) $modules{$type}{META}{x_version} =~ s/1\.1\.1/$v/gx; } else { $modules{$type}{META}{x_version} = $v; } return $@ unless (FHEM::Meta::SetInternals($hash)); # FVERSION wird gesetzt ( nur gesetzt wenn $Id: 76_SMAPortal.pm 21740 2020-04-21 15:01:42Z 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 use version 0.77; our $VERSION = FHEM::Meta::Get( $hash, 'version' ); ## no critic 'VERSION' } } else { # herkömmliche Modulstruktur $hash->{VERSION} = $v; } return; } 1; =pod =item helper =item summary Clock display in different variants =item summary_DE Uhrenanzeige in verschiedenen Varianten =begin html

Watches

At the moment only a german commandref is available. =end html =begin html_DE

Watches


Das Modul Watches stellt eine Modern-, Bahnhofs- oder Digitalanzeige als Device zur Verfügung.
Die Uhren basieren auf Skripten dieser Seiten:
moderne Uhr, Bahnhofsuhr, Digitalanzeige

Als Zeitquelle können sowohl der Client (Browserzeit) als auch der FHEM-Server eingestellt werden (Attribut timeSource).
    Define
      define <name> Watches [Modern | Station | Digital]

      Modern : erstellt eine analoge Uhr im modernen Design
      Station : erstellt eine Bahnhofsuhr
      Digital : erstellt eine Digitalanzeige (Uhr, (CountDown)Stoppuhr, statische Zeitanzeige oder Text)


    Set
      • alarmHMSset <hh> <mm> <ss>
        Setzt die Alarmzeit im Format hh-Stunden(24), mm-Minuten und ss-Sekunden.
        Erreicht die Zeit den definierten Wert, wird ein Event des Readings "alarmed" erstellt.
        Die Stoppuhr hält an diesem Wert an.
        Wird eine CountDown-Stoppuhr mit "coninue" fortgesetzt, erfolgt ein nochmaliger alarmed-Event beim Erreichen der Zeit 00:00:00.
        (default: 0 0 0)

        Dieses Set-Kommando ist nur bei digitalen Stoppuhren vorhanden.

          Beispiel
          set <name> alarmHMSset 0 30 10


      • alarmHMSdel
        Löscht die gesetzte Alarmzeit und deren Status.
        Dieses Set-Kommando ist nur bei digitalen Stoppuhren vorhanden.

      • countDownInit <hh> <mm> <ss>
        Setzt die Startzeit einer CountDown-Stoppuhr mit hh-Stunden(24), mm-Minuten und ss-Sekunden.
        Dieses Set-Kommando ist nur bei einer digitalen CountDown-Stoppuhr vorhanden.

          Beispiel
          set <name> countDownInit 0 30 10


      • displayTextSet
        Stellt den anzuzeigenden Text ein.
        Dieses Set-Kommando ist nur bei einer digitalen Segmentanzeige mit "digitalDisplayPattern = text" vorhanden.
        (default: PLAY)

        Hinweis:
        Die darstellbaren Zeichen sind vom Attribut "digitalSegmentType" abhängig.
        Mit der (default) Siebensegmentanzeige können lediglich Ziffern, Bindestrich, Unterstrich und die Buchstaben A, b, C, d, E, F, H, L, n, o, P, r, t, U und Y angezeigt werden. Damit lassen sich außer Zahlen auch kurze Texte wie „Error“, „HELP“, „run“ oder „PLAY“ anzeigen.
        Für Textdarstellung wird empfohlen die Sechzehnsegmentanzeige mit dem Attribut "digitalSegmentType" einzustellen !

      • displayTextDel
        Löscht den Anzeigetext.
        Dieses Set-Kommando ist nur bei einer digitalen Segmentanzeige mit "digitalDisplayPattern = text" vorhanden.

      • reset
        Stoppt die Stoppuhr (falls sie läuft) und löscht alle spezifischen Readings bzw. setzt sie auf initialized zurück.
        Dieses Set-Kommando ist nur bei digitalen Stoppuhren vorhanden.

      • resume
        Setzt die Zählung einer angehaltenen Stoppuhr fort.
        Dieses Set-Kommando ist nur bei digitalen Stoppuhren vorhanden.

      • start
        Startet die Stoppuhr.
        Dieses Set-Kommando ist nur bei digitalen Stoppuhren vorhanden.

      • stop
        Stoppt die Stoppuhr. Die erreichte Zeit bleibt erhalten.
        Dieses Set-Kommando ist nur bei digitalen Stoppuhren vorhanden.

      • time <hh> <mm> <ss>
        Setzt eine statische Zeitanzeige mit hh-Stunden(24), mm-Minuten und ss-Sekunden.
        Dieses Set-Kommando ist nur bei einer Digitaluhr mit statischer Zeitanzeige vorhanden.

          Beispiel
          set <name> time 8 15 3


    Get
      N/A

    Attribute

      • disable
        Aktiviert/deaktiviert das Device.

      • hideDisplayName
        Verbirgt den Device/Alias-Namen (Link zur Detailansicht).

      • htmlattr
        Zusätzliche HTML Tags zur Größenänderung de Uhr.

          Beispiel:
          attr <name> htmlattr width="125" height="125"

      • timeSource
        Wählt die Zeitquelle aus. Es kann die lokale Clientzeit (Browser) oder die Zeit des FHEM-Servers angezeigt werden.
        Diese Einstellung ist bei (CountDown-)Stoppuhren nicht relevant.
        (default: server)

      Die nachfolgenden Attribute sind spezifisch für einen Uhrentyp zu setzen.

      Model: Modern

      • modernColorBackground
        Hintergrundfarbe der Uhr.

      • modernColorFace
        Einfärbung des Ziffernblattes.

      • modernColorFigure
        Farbe der Ziffern im Ziffernblatt und der Zeigerachsabdeckung.

      • modernColorHand
        Farbe der UhrenZeiger.

      • modernColorRing
        Farbe des Ziffernblattrahmens.

      • modernColorRingEdge
        Farbe des Außenringes vom Ziffernblattrahmen.


      Model: Station

      • stationBody
        Art des Uhrengehäuses.

      • stationBoss
        Art und Farbe der Zeigerachsabdeckung.

      • stationHourHand
        Art des Stundenzeigers.

      • stationMinuteHand
        Art des Minutenzeigers.

      • stationMinuteHandBehavoir
        Verhalten des Minutenzeigers.

      • stationSecondHand
        Art des Sekundenzeigers.

      • stationSecondHandBehavoir
        Verhalten des Sekundenzeigers.

      • stationStrokeDial
        Auswahl des Ziffernblattes.


      Model: Digital

      • digitalColorBackground
        Digitaluhr Hintergrundfarbe.

      • digitalColorDigits
        Farbe der Balkenanzeige in einer Digitaluhr.

      • digitalDigitAngle
        Stellt den Neigungswinkel der dargestellten Zeichen ein.
        (default: 9)

      • digitalDigitDistance
        Stellt den Zeichenabstand ein.
        (default: 2)

      • digitalDigitHeight
        Stellt die Zeichenhöhe ein.
        (default: 20)

      • digitalDigitWidth
        Stellt die Zeichenbreite ein.
        (default: 12)

      • digitalDisplayPattern [countdownwatch | staticwatch | stopwatch | text | watch]
        Umschaltung der Digitalanzeige zwischen einer Uhr (default), einer Stoppuhr, statischen Zeitanzeige oder Textanzeige. Der anzuzeigende Text im Modus Textanzeige kann mit set displayText definiert werden.

        Hinweis: Bei Textanzeige wird empfohlen das Attribut "digitalSegmentType" auf "16" zu stellen.

          countdownwatch : CountDown Stoppuhr
          staticwatch : statische Zeitanzeige
          stopwatch : Stoppuhr
          text : Anzeige eines definierbaren Textes
          watch : Uhr


      • digitalSegmentDistance
        Legt den Abstand zwischen den Segmenten fest.
        (default: 0.5)

      • digitalSegmentType
        Schaltet die Segmentanzahl der Digitalanzeige um.
        (default: 7)

      • digitalSegmentWidth
        Verändert die Breite der einzelnen Segmente.
        (default: 1.5)

=end html_DE =for :application/json;q=META.json 60_Watches.pm { "abstract": "Clock display in different variants", "x_lang": { "de": { "abstract": "Uhrenanzeige in verschiedenen Varianten" } }, "keywords": [ "Watch", "Modern clock", "clock", "Station clock", "Digital display" ], "version": "v1.1.1", "release_status": "testing", "author": [ "Heiko Maaz ", null ], "x_fhem_maintainer": [ "DS_Starter" ], "x_fhem_maintainer_github": [ "nasseeder1" ], "prereqs": { "runtime": { "requires": { "FHEM": 5.00918799, "perl": 5.014, "Time::HiRes": 0, "GPUtils": 0 }, "recommends": { "FHEM::Meta": 0 }, "suggests": { } } } } =end :application/json;q=META.json =cut