mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-09 20:57:11 +00:00
mqtt2.template:small changes to tasmota venetian blind
git-svn-id: https://svn.fhem.de/fhem/trunk@25681 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
fbc5423a99
commit
89a262dc63
@ -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(<a href="http://$ip" target="_blank">$onl</a> <div><a href="/fhem?cmd.dummy=set $name $lvcmd&XHR=1">$lvicon</a></div> <div><a href="/fhem?cmd.dummy=set $name $sltcmd&XHR=1">$slticon $slt</a>) }
|
||||
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(<a href="http://$ip" target="_blank">$onl</a> <div><a href="/fhem?cmd.dummy=set $name $lvcmd&XHR=1">$lvicon</a></div> <div><a href="/fhem?cmd.dummy=set $name $sltcmd&XHR=1">$slticon $slt</a>) }
|
||||
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 <a href="https://tasmota.github.io/docs/Blinds-and-Shutters/</a>.
|
||||
farewell:template has been applied successfully. Now it's recommended to set shutter's open and close duration and shuttertiltconfig1, see short instruction in comment attribute or the <br><a href="https://tasmota.github.io/docs/Blinds-and-Shutters/">Tasmota wiki</a>.
|
||||
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user