From 89a262dc63e040435171623a763aa85337cbeaeb Mon Sep 17 00:00:00 2001 From: Beta-User <> Date: Tue, 15 Feb 2022 06:42:20 +0000 Subject: [PATCH] mqtt2.template:small changes to tasmota venetian blind git-svn-id: https://svn.fhem.de/fhem/trunk@25681 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/lib/AttrTemplate/mqtt2.template | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/lib/AttrTemplate/mqtt2.template b/fhem/FHEM/lib/AttrTemplate/mqtt2.template index 6cc83cd00..3b80c38c9 100644 --- a/fhem/FHEM/lib/AttrTemplate/mqtt2.template +++ b/fhem/FHEM/lib/AttrTemplate/mqtt2.template @@ -1618,25 +1618,25 @@ attr DEVICE readingList \ TELETOPIC/INFO.:.* { $EVENT =~ m,^..Info[1-3]..(.+).$, ? json2nameValue($1,'',$JSONMAP) : json2nameValue($EVENT,'',$JSONMAP) }\ STATTOPIC/RESULT:.* { json2nameValue($EVENT,'',$JSONMAP) }\ STATTOPIC/POWER1:.* {{'state' => 'opening'} if $EVENT eq 'on'}\ - STATTOPIC/POWER2:.* {{'state' => 'closing'} if $EVENT eq 'on'} -attr DEVICE devStateIcon {my $onl = ReadingsVal($name,'LWT','Offline') eq 'Offline' ? 'rot' : 'gruen'; $onl = FW_makeImage("10px-kreis-$onl"); my $ip = ReadingsVal($name,'IPAddress','none'); my $pct = int((109 - ReadingsNum($name,'pct',0))/10)*10; my $open = ReadingsVal($name,'state',''); my $lvicon = $open eq 'opening' ? 'fts_shutter_up@red' : $open eq 'closing' ? 'fts_shutter_down@red' : "fts_shutter_$pct"; $lvicon = FW_makeImage($lvicon); my $lvcmd = ($open eq 'opening' || $open eq 'closing') ? 'stop' : $pct > 50 ? 'close' : 'open'; my $slt = ReadingsNum($name,'tiltSlat',90); my $slticon = 'fts_blade_arc_close_'; $slticon .= $slt > 0 ? '00' : $slt > -45 ? '50' : '100'; $slticon = FW_makeImage($slticon); my $sltcmd = $slt > 0 ? 'closeSlat' : $slt > -45 ? 'openSlat' : 'halfSlat'; qq($onl
$lvicon
$slticon $slt) } + STATTOPIC/POWER2:.* {{'state' => 'closing'} if $EVENT eq 'on'}\ + STATTOPIC/SHUTTER1:.* state +attr DEVICE devStateIcon {my $onl = ReadingsVal($name,'LWT','Offline') eq 'Offline' ? 'rot' : 'gruen'; $onl = FW_makeImage("10px-kreis-$onl"); my $ip = ReadingsVal($name,'IPAddress','none'); my $pct = maxNum(int((109 - ReadingsNum($name,'pct',0))/10)*10, 1); my $open = ReadingsVal($name,'state',''); my $lvicon = $open eq 'opening' ? 'fts_shutter_up@red' : $open eq 'closing' ? 'fts_shutter_down@red' : "fts_shutter_$pct"; $lvicon = FW_makeImage($lvicon); my $lvcmd = ($open eq 'opening' || $open eq 'closing') ? 'stop' : $pct > 50 ? 'open' : 'close'; my $slt = ReadingsNum($name,'tiltSlat',90); my $slticon = 'fts_blade_arc_close_'; $slticon .= $slt > 0 ? '00' : $slt > -45 ? '50' : '100'; $slticon = FW_makeImage($slticon); my $sltcmd = $slt > 0 ? 'closeSlat' : $slt > -45 ? 'openSlat' : 'halfSlat'; qq($onl
$lvicon
$slticon $slt) } attr DEVICE cmdIcon open:fts_shutter_up close:fts_shutter_down stop:fts_shutter_manual half:fts_shutter_50 attr DEVICE webCmd pct:tiltSlat #attr DEVICE eventMap open:opens close:closes deleteattr DEVICE eventMap attr DEVICE jsonMap POWER1:0 POWER2:0 Shutter1_Tilt:tiltSlat Shutter1_Target:pct ANALOG_Temperature:temperature -attr DEVICE userReadings state:pct:.* {ReadingsNum($name,'pct',0)} attr DEVICE stateFormat LWT level: state slat: tiltSlat deletereading -q DEVICE (?!associatedWith|IODev).* attr DEVICE setStateList open close half stop pct openSlat closeSlat halfSlat -attr DEVICE widgetOverride pct:knob,min:-90,max:90,angleArc:180,width:40,height:40,fgColor:#CCCCCC,bgColor:#FF9900,step:5,lineCap:round,rotation:anticlockwise,displayPrevious:1 +attr DEVICE widgetOverride pct:knob,min:-90,max:90,angleArc:180,width:40,height:40,fgColor:#CCCCCC,bgColor:#FF9900,step:5,lineCap:round,rotation:anticlockwise,displayPrevious:1 pct:colorpicker,BRI,0,1,100 attr DEVICE comment After applying the template set "ShutterOpenDuration1", "ShutterCloseDuration1" and "shuttertiltconfig1" first.\ Use the "set x_configuration" Option. Example: "set x_configuration ShutterOpenDuration1 35".\ This is for a tilt range from -90 to 90 degrees, if you have different tilt options, adopt range manually\ For calibration, tilt range settings, use of more than one shutter device and further information on the available commands see Tasmota wiki. attr DEVICE model tasmota_2ch_shutter_venetian_invert_0 -setreading DEVICE attrTemplateVersion 20220201 +setreading DEVICE attrTemplateVersion 20220214 option:{ CALLSPEECHRECOGN } set DEVICE attrTemplate speechcontrol_type_blind