From e19a9a189f341d76b281980d54e6bff20e39e4a8 Mon Sep 17 00:00:00 2001 From: Beta-User <> Date: Wed, 17 Jun 2020 06:06:56 +0000 Subject: [PATCH] mqtt2.template: bugfixes in shelly2/2.5; other small changes git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@22187 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/lib/AttrTemplate/general_use.template | 3 +++ FHEM/lib/AttrTemplate/mqtt2.template | 21 ++++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/FHEM/lib/AttrTemplate/general_use.template b/FHEM/lib/AttrTemplate/general_use.template index 8337baacb..232e7d239 100644 --- a/FHEM/lib/AttrTemplate/general_use.template +++ b/FHEM/lib/AttrTemplate/general_use.template @@ -124,3 +124,6 @@ setreading DEVICE_CH5 associatedWith DEVICE,DEVICE_CH1,DEVICE_CH2,DEVICE_CH3,DEV setreading DEVICE_CH6 associatedWith DEVICE,DEVICE_CH1,DEVICE_CH2,DEVICE_CH3,DEVICE_CH4,DEVICE_CH5,DEVICE_CH7,DEVICE_CH8 setreading DEVICE_CH7 associatedWith DEVICE,DEVICE_CH1,DEVICE_CH2,DEVICE_CH3,DEVICE_CH4,DEVICE_CH5,DEVICE_CH6,DEVICE_CH8 setreading DEVICE_CH8 associatedWith DEVICE,DEVICE_CH1,DEVICE_CH2,DEVICE_CH3,DEVICE_CH4,DEVICE_CH5,DEVICE_CH6,DEVICE_CH7 + +option:{1} +show DEVICE.* diff --git a/FHEM/lib/AttrTemplate/mqtt2.template b/FHEM/lib/AttrTemplate/mqtt2.template index bd3f0fb2d..bf8684be6 100644 --- a/FHEM/lib/AttrTemplate/mqtt2.template +++ b/FHEM/lib/AttrTemplate/mqtt2.template @@ -1784,7 +1784,10 @@ attr DEVICE readingList \ shellies/DEVNAME/relay/power:.* power\ shellies/DEVNAME/relay/energy:.* energy\ shellies/DEVNAME/temperature:.* temperature\ - shellies/DEVNAME/overtemperature:.* overtemperature + shellies/DEVNAME/overtemperature:.* overtemperature\ + shellies/DEVNAME/roller/0/power:.* roller_0_power\ + shellies/DEVNAME/roller/0/energy:.* roller_0_energy\ + shellies/DEVNAME/temperature_f:.* temperature_f attr DEVICE devStateIcon { my $amp = ReadingsVal($name,"online","false") eq "false" ? "rot" : ReadingsVal($name,"new_fw","false") eq "true" ? "gelb" : "gruen";; my $con = ReadingsVal($name,"state","unknown");; $con = 100 - $con if $con =~ /\d+/;; my $pic = $con eq "opening" ? 'fts_shutter_up@red' : $con eq "closing" ? 'fts_shutter_down@red' : $con eq "100" ? 'fts_shutter_100' : $con =~ /(\d)\d/ ? 'fts_shutter_'.$1.'0' : $con =~ /\b\d\b/ ? 'fts_shutter_10' : 'fts_shutter_updown';; my $show = "$amp" eq "gelb" ? "".FW_makeImage("10px-kreis-".$amp)."" : "".FW_makeImage("10px-kreis-".$amp)."";; "
"} attr DEVICE cmdIcon open:fts_shutter_up close:fts_shutter_down stop:fts_shutter_manual half:fts_shutter_50 attr DEVICE webCmd :open:close:half:stop:pct @@ -1793,7 +1796,7 @@ attr DEVICE setStateList open close half stop pct set DEVICE x_mqttcom announce set DEVICE attrTemplate speechcontrol_type_blind attr DEVICE model shelly25_roller_invert_0 -setreading DEVICE attrTemplateVersion 20200522 or prior +setreading DEVICE attrTemplateVersion 20200617 name:shelly25_roller_invert_1 filter:TYPE=MQTT2_DEVICE:FILTER=readingList=.*shellies.* @@ -1825,7 +1828,10 @@ attr DEVICE readingList \ shellies/DEVNAME/relay/power:.* power\ shellies/DEVNAME/relay/energy:.* energy\ shellies/DEVNAME/temperature:.* temperature\ - shellies/DEVNAME/overtemperature:.* overtemperature + shellies/DEVNAME/overtemperature:.* overtemperature\ + shellies/DEVNAME/roller/0/power:.* roller_0_power\ + shellies/DEVNAME/roller/0/energy:.* roller_0_energy\ + shellies/DEVNAME/temperature_f:.* temperature_f attr DEVICE devStateIcon { my $amp = ReadingsVal($name,"online","false") eq "false" ? "rot" : ReadingsVal($name,"new_fw","false") eq "true" ? "gelb" : "gruen";; my $con = ReadingsVal($name,"state","unknown");; my $pic = $con eq "opening" ? 'fts_shutter_up@red' : $con eq "closing" ? 'fts_shutter_down@red' : $con eq "100" ? 'fts_shutter_100' : $con =~ /(\d)\d/ ? 'fts_shutter_'.$1.'0' : $con =~ /\b\d\b/ ? 'fts_shutter_10' : 'fts_shutter_updown';; my $show = "$amp" eq "gelb" ? "".FW_makeImage("10px-kreis-".$amp)."" : "".FW_makeImage("10px-kreis-".$amp)."";; ""} attr DEVICE cmdIcon open:fts_shutter_up close:fts_shutter_down stop:fts_shutter_manual half:fts_shutter_50 attr DEVICE webCmd :open:close:half:stop:pct @@ -1834,7 +1840,7 @@ attr DEVICE setStateList open close half stop pct set DEVICE x_mqttcom announce #set DEVICE attrTemplate speechcontrol_type_blind attr DEVICE model shelly25_roller_invert_1 -setreading DEVICE attrTemplateVersion 20200522 or prior +setreading DEVICE attrTemplateVersion 20200617 # shelly2 using original firmware. # NOTE: a second device will be created for the second channel @@ -1844,7 +1850,7 @@ desc:shelly2 using original firmware.