From 9b7f569ec8bba37afe5b47e0e6a8c973932aa3fc Mon Sep 17 00:00:00 2001
From: Beta-User <>
Date: Tue, 17 Dec 2019 07:01:01 +0000
Subject: [PATCH] mqtt2.template: change shelly washer example and tasmota rgbw
plug
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@20771 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
FHEM/lib/AttrTemplate/mqtt2.template | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/FHEM/lib/AttrTemplate/mqtt2.template b/FHEM/lib/AttrTemplate/mqtt2.template
index 513cc1d74..29a33ab7b 100644
--- a/FHEM/lib/AttrTemplate/mqtt2.template
+++ b/FHEM/lib/AttrTemplate/mqtt2.template
@@ -671,9 +671,9 @@ attr DEVICE model tasmota_POW_USB_split
attr DEVICE_CH2 model tasmota_POW_USB_split
# plug with LED flashed with Tasmota.
-name:tasmota_plug_with_rgb_split
+name:tasmota_plug_with_rgbw_split
filter:TYPE=MQTT2_DEVICE:FILTER=readingList=.*(tele|cmnd|stat).*
-desc:plug with seperate RGB LED flashed with Tasmota.
NOTE: a second device will be created for the rgb device.
Tested with Tasmota V. 7.1.2 and Maxcio YX-DE02 Plug using template: {"NAME":"Maxcio YX-DE04","GPIO":[255,17,255,21,56,40,0,0,37,38,39,255,255],"FLAG":1,"BASE":18}
+desc:plug with seperate RGBW LED flashed with Tasmota.
NOTE: a second device will be created for the rgb device.
Tested with Tasmota V. 7.1.2 and Maxcio YX-DE02 Plug using template: {"NAME":"Maxcio YX-DE04","GPIO":[255,17,255,21,56,40,0,0,37,38,39,255,255],"FLAG":1,"BASE":18}
order:A_01c1a
set DEVICE attrTemplate tasmota_basic_state_power1
par:CMNDTOPIC;Command topic prefix, without trailing /;{ AttrVal("DEVICE","readingList","") =~ m,([^:]*)\b(tele|cmnd|stat)(/.*)?/LWT:, ? "${1}cmnd$3" : undef }
@@ -706,7 +706,8 @@ attr DEVICE_CH2 setList \
on:noArg CMNDTOPIC/POWER2 1\
toggle:noArg CMNDTOPIC/POWER2 2\
Color:colorpicker,RGB CMNDTOPIC/COLOR\
- pct:colorpicker,BRI,0,5,100 CMNDTOPIC/DIMMER
+ pct:colorpicker,BRI,0,5,100 CMNDTOPIC/DIMMER\
+ white:colorpicker,BRI,0,5,100 { "CMNDTOPIC/COLOR ". sprintf("000000%02X",$EVTPART1*2.55) }
attr DEVICE_CH2 readingList \
TELETOPIC/LWT:.* LWT\
TELETOPIC/STATE:.* { json2nameValue($EVENT,'',$JSONMAP) }\
@@ -715,13 +716,16 @@ attr DEVICE_CH2 readingList \
TELETOPIC/UPTIME:.* { json2nameValue($EVENT,'',$JSONMAP) }\
STATTOPIC/RESULT:.* { json2nameValue($EVENT,'',$JSONMAP) }\
STATTOPIC/POWER2:.* state
-attr DEVICE_CH2 jsonMap POWER2:state Dimmer:pct Channel_1:0 Channel_2:0 Channel_3:0 HSBColor:0 POWER1:0 Heap:0 LedTable:0 LoadAvg:0 MqttCount:0 SaveData:0 Scheme:0 SetOption26:0 Sleep:0 SleepMode:0 Speed:0 StateText1:0 StateText2:0 StateText3:0 StateText4:0 Time:0 Uptime:0 UptimeSec:0 Wifi_SSId:0 Wifi_RSSI:0 Wifi_LinkCount:0 Wifi_Downtime:0 Wifi_Channel:0 Wifi_BSSId:0 Wifi_AP:0 ANALOG_A0:0
-attr DEVICE_CH2 webCmd pct:Color:Color ff0000:Color 00ff00:Color 0000ff:toggle:on:off
+attr DEVICE_CH2 jsonMap POWER2:state Dimmer:pct Channel_4:white Channel_1:0 Channel_2:0 Channel_3:0 HSBColor:0 POWER1:0 Heap:0 LedTable:0 LoadAvg:0 MqttCount:0 SaveData:0 Scheme:0 SetOption26:0 Sleep:0 SleepMode:0 Speed:0 StateText1:0 StateText2:0 StateText3:0 StateText4:0 Time:0 Uptime:0 UptimeSec:0 Wifi_SSId:0 Wifi_RSSI:0 Wifi_LinkCount:0 Wifi_Downtime:0 Wifi_Channel:0 Wifi_BSSId:0 Wifi_AP:0 ANALOG_A0:0 SetOption26:0 Sleep:0 SleepMode:0 Speed:0 StateText1:0 StateText2:0 StateText3:0 StateText4:0 Time:0 Uptime:0 UptimeSec:0 Wifi_SSId:0 Wifi_RSSI:0 Wifi_LinkCount:0 Wifi_Downtime:0 Wifi_Channel:0 Wifi_BSSId:0 Wifi_AP:0 ANALOG_A0:0
+attr DEVICE_CH2 webCmd pct:white:Color
+attr DEVICE_CH2 webCmdLabel Helligkeit\
+:Weiss\
+:Farbe:
attr DEVICE_CH2 devStateIcon {Color::devStateIcon($name,"rgb","Color","pct","state")}
attr DEVICE_CH2 setStateList on off toggle
deletereading -q DEVICE_CH2 (?!associatedWith).*
-attr DEVICE model tasmota_plug_with_rgb_split
-attr DEVICE_CH2 model tasmota_plug_with_rgb_split
+attr DEVICE model tasmota_plug_with_rgbw_split
+attr DEVICE_CH2 model tasmota_plug_with_rgbw_split
#tasmota device with Infrared-circuit
name:tasmota_ir
@@ -1101,7 +1105,6 @@ par:IO_DEV;Currently used IO;{ AttrVal("DEVICE","IODev",undef)}
set IO_DEV publish CMNDTOPIC/SetOption26 0
attr DEVICE userReadings state:POWER:.* { lc(ReadingsVal($name,"POWER","")) }
-
###########################################
# SHELLY
#
@@ -1189,7 +1192,7 @@ order:A_10b1
desc:Example how to configure a single relay Shelly device offering energy meassuring like Shelly 1PM or Shelly Plug S to visualise state of a machine behind the plug. Icons will not allow to turn the machine off.
par:DEVNAME;Shelly1 name in the topic;{ AttrVal("DEVICE","readingList","") =~ m,shellies/([^/]*)/, ? $1 : undef }
set DEVICE attrTemplate shelly1_w_energy_meassuring
-attr DEVICE devStateIcon { my $amp = ReadingsVal($name,"online","false") eq "false" ? "rot" : ReadingsVal($name,"new_fw","false") eq "true" ? "gelb" : "gruen";; my $pic = ReadingsVal($name,"loadState","") eq "on"?'scene_laundry_room_fem@green':'scene_laundry_room_fem';; my $text = ReadingsVal($name,"loadState","") eq "on"?"Waschmaschine läuft - Aktuell: ".ReadingsVal($name,"relay_0_power","")." W":'Standby';; my $show = "$amp" eq "gelb" ? "".FW_makeImage("10px-kreis-".$amp)."" : "".FW_makeImage("10px-kreis-".$amp)."";; "