diff --git a/fhem/FHEM/lib/AttrTemplate/mqtt2.template b/fhem/FHEM/lib/AttrTemplate/mqtt2.template
index 778978811..d54c00b54 100644
--- a/fhem/FHEM/lib/AttrTemplate/mqtt2.template
+++ b/fhem/FHEM/lib/AttrTemplate/mqtt2.template
@@ -98,7 +98,8 @@ filter:TYPE=MQTT2_DEVICE:FILTER=CID=zigbee.*
order:L_02a
par:BASE_TOPIC;base topic set in configuration.yaml of the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[\b]?([^/:]+)[/].*:, ? $1 : undef }
par:DEV_ID;name of the device in the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
-attr DEVICE icon light_control
+par:ICON;ICON as set, defaults to light_control;{ AttrVal("DEVICE","icon","light_control") }
+attr DEVICE icon ICON
attr DEVICE devStateIcon {zigbee2mqtt_devStateIcon255($name)}
attr DEVICE webCmd toggle:on:off:brightness
attr DEVICE readingList BASE_TOPIC/DEV_ID:.* { json2nameValue($EVENT) }
@@ -116,7 +117,8 @@ desc: A dimmable light with color temperature via zigbee2mqtt
order:L_02b
par:BASE_TOPIC;base topic set in configuration.yaml of the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[\b]?([^/:]+)[/].*:, ? $1 : undef }
par:DEV_ID;name of the device in the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
-attr DEVICE icon light_control
+par:ICON;ICON as set, defaults to light_control;{ AttrVal("DEVICE","icon","light_control") }
+attr DEVICE icon ICON
attr DEVICE webCmd toggle:on:off:brightness:color_temp
attr DEVICE readingList BASE_TOPIC/DEV_ID:.* { json2nameValue($EVENT) }
attr DEVICE setList \
@@ -133,7 +135,8 @@ desc: A dimmable rgb light connected via zigbee2mqtt
rgb value is encoded as
order:L_02c
par:BASE_TOPIC;base topic set in configuration.yaml of the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[\b]?([^/:]+)[/].*:, ? $1 : undef }
par:DEV_ID;name of the device in the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
-attr DEVICE icon hue_filled_white_and_color_e27_b22
+par:ICON;ICON as set, defaults to hue_filled_white_and_color_e27_b22;{ AttrVal("DEVICE","icon","hue_filled_white_and_color_e27_b22") }
+attr DEVICE icon ICON
attr DEVICE stateFormat {lc ReadingsVal($name,"state",0)}
attr DEVICE devStateIcon {zigbee2mqtt_devStateIcon255($name)}
attr DEVICE webCmd toggle:on:off:brightness:hex
@@ -152,7 +155,8 @@ desc: A dimmable rgb light connected via zigbee2mqtt
rgb values will be sent
order:L_02c
par:BASE_TOPIC;base topic set in configuration.yaml of the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[\b]?([^/:]+)[/].*:, ? $1 : undef }
par:DEV_ID;name of the device in the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
-attr DEVICE icon hue_filled_white_and_color_e27_b22
+par:ICON;ICON as set, defaults to hue_filled_white_and_color_e27_b22;{ AttrVal("DEVICE","icon","hue_filled_white_and_color_e27_b22") }
+attr DEVICE icon ICON
attr DEVICE stateFormat {lc ReadingsVal($name,"state",0)}
attr DEVICE devStateIcon {zigbee2mqtt_devStateIcon255($name)}
attr DEVICE webCmd toggle:on:off:brightness:color
@@ -171,7 +175,8 @@ desc: A dimmable rgbw light connected via zigbee2mqtt
rgb value is encoded a
order:L_02d
par:BASE_TOPIC;base topic set in configuration.yaml of the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[\b]?([^/:]+)[/].*:, ? $1 : undef }
par:DEV_ID;name of the device in the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
-attr DEVICE icon hue_filled_white_and_color_e27_b22
+par:ICON;ICON as set, defaults to hue_filled_white_and_color_e27_b22;{ AttrVal("DEVICE","icon","hue_filled_white_and_color_e27_b22") }
+attr DEVICE icon ICON
attr DEVICE stateFormat {lc ReadingsVal($name,"state",0)}
attr DEVICE devStateIcon {zigbee2mqtt_devStateIcon255($name)}
attr DEVICE webCmd toggle:on:off:brightness:color_temp:warm:white:hex
@@ -194,7 +199,8 @@ order:L_02d1
desc: A dimmable rgbw light connected via zigbee2mqtt
rgb values will be sent as individual values r,g and b
Experimental, still untested
par:BASE_TOPIC;base topic set in configuration.yaml of the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[\b]?([^/:]+)[/].*:, ? $1 : undef }
par:DEV_ID;name of the device in the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
-attr DEVICE icon hue_filled_white_and_color_e27_b22
+par:ICON;ICON as set, defaults to hue_filled_white_and_color_e27_b22;{ AttrVal("DEVICE","icon","hue_filled_white_and_color_e27_b22") }
+attr DEVICE icon ICON
attr DEVICE stateFormat {lc ReadingsVal($name,"state",0)}
attr DEVICE devStateIcon {zigbee2mqtt_devStateIcon255($name)}
attr DEVICE webCmd toggle:on:off:brightness:color:white
@@ -214,7 +220,8 @@ filter:TYPE=MQTT2_DEVICE:FILTER=CID=zigbee.*
order:L_02e
par:BASE_TOPIC;base topic set in configuration.yaml of the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[\b]?([^/:]+)[/].*:, ? $1 : undef }
par:DEV_ID;name of the device in the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
-attr DEVICE icon hue_filled_white_and_color_e27_b22
+par:ICON;ICON as set, defaults to hue_filled_white_and_color_e27_b22;{ AttrVal("DEVICE","icon","hue_filled_white_and_color_e27_b22") }
+attr DEVICE icon ICON
attr DEVICE stateFormat {lc ReadingsVal($name,"state",0)}
attr DEVICE devStateIcon {zigbee2mqtt_devStateIcon255($name)}
attr DEVICE webCmd toggle:on:off:brightness:color_temp:hex
@@ -234,7 +241,8 @@ order:L_02e1
desc: A dimmable rgb-cct light connected via zigbee2mqtt
rgb values will be sent as individual values r,g and b
Tested with: RGB-CCT GL-C-008
par:BASE_TOPIC;base topic set in configuration.yaml of the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[\b]?([^/:]+)[/].*:, ? $1 : undef }
par:DEV_ID;name of the device in the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
-attr DEVICE icon hue_filled_white_and_color_e27_b22
+par:ICON;ICON as set, defaults to hue_filled_white_and_color_e27_b22;{ AttrVal("DEVICE","icon","hue_filled_white_and_color_e27_b22") }
+attr DEVICE icon ICON
attr DEVICE stateFormat {lc ReadingsVal($name,"state",0)}
attr DEVICE devStateIcon {zigbee2mqtt_devStateIcon255($name)}
attr DEVICE webCmd toggle:on:off:brightness:color_temp:color
@@ -252,8 +260,9 @@ filter:TYPE=MQTT2_DEVICE:FILTER=CID=zigbee.*
order:L_03
par:BASE_TOPIC;base topic set in configuration.yaml of the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[\b]?([^/:]+)[/].*:, ? $1 : undef }
par:DEV_ID;name of the device in the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
+par:ICON;ICON as set, defaults to secur_smoke_detector;{ AttrVal("DEVICE","icon","secur_smoke_detector") }
+attr DEVICE icon ICON
attr DEVICE readingList BASE_TOPIC/DEV_ID:.* { json2nameValue($EVENT) }
-attr DEVICE icon secur_smoke_detector
attr DEVICE stateFormat smoke
attr DEVICE model zigbee2mqtt_smokeDetector
@@ -311,6 +320,8 @@ filter:TYPE=MQTT2_DEVICE:FILTER=CID=zigbee.*
order:L_07
par:BASE_TOPIC;base topic set in configuration.yaml of the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[\b]?([^/:]+)[/].*:, ? $1 : undef }
par:DEV_ID;name of the device in the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
+par:ICON;ICON as set, defaults to temperature_humidity;{ AttrVal("DEVICE","icon","temperature_humidity") }
+attr DEVICE icon ICON
attr DEVICE stateFormat {sprintf ("Temperature: %.1f°C Humidity: %.1f%% Pressure: %.1fhpa", ReadingsVal($name,"temperature",0), ReadingsVal($name,"humidity",0), ReadingsVal($name,"pressure",0)) }
attr DEVICE readingList BASE_TOPIC/DEV_ID:.* { json2nameValue($EVENT) }
deletereading -q DEVICE (?!associatedWith).*
@@ -323,7 +334,9 @@ filter:TYPE=MQTT2_DEVICE:FILTER=CID=zigbee.*
order:L_07a
par:BASE_TOPIC;base topic set in configuration.yaml of the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[\b]?([^/:]+)[/].*:, ? $1 : undef }
par:DEV_ID;name of the device in the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
-attr DEVICE stateFormat T: temperature H: humidity
+par:ICON;ICON as set, defaults to temperature_humidity;{ AttrVal("DEVICE","icon","temperature_humidity") }
+attr DEVICE icon ICON
+attr DEVICE stateFormat {sprintf ("Temperature: %.1f°C Humidity: %.1f%%", ReadingsVal($name,"temperature",0), ReadingsVal($name,"humidity",0)) }
attr DEVICE readingList BASE_TOPIC/DEV_ID:.* { json2nameValue($EVENT) }
deletereading -q DEVICE (?!associatedWith).*
attr DEVICE model zigbee2mqtt_TempHumSensor
@@ -423,6 +436,19 @@ attr DEVICE readingList BASE_TOPIC/DEV_ID:.* { json2nameValue($EVENT) }
deletereading -q DEVICE (?!associatedWith).*
attr DEVICE model zigbee2mqtt_aqara_cube
+#source post: https://forum.fhem.de/index.php/topic,94494.msg983905.html#msg983905
+name:zigbee2mqtt_AlarmSensor
+desc: Alarm sensor via zigbee2mqtt
Can report actions drop, tilt or vibration as well as x,y,z coordinates of its movement.
Sensitivity can be set to low, medium or high.
Tested with: Xiaomi DJT11LM Vibration Sensor
+filter:TYPE=MQTT2_DEVICE:FILTER=CID=zigbee.*
+order:L_15
+par:BASE_TOPIC;base topic set in configuration.yaml of the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[\b]?([^/:]+)[/].*:, ? $1 : undef }
+par:DEV_ID;name of the device in the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
+attr DEVICE setList \
+ sensitivity:low,medium,high BASE_TOPIC/DEV_ID/set {"sensitivity":"$EVTPART1"}
+attr DEVICE stateFormat Action: action X: angle_X Y: angle_Y Z: angle_Z
+attr DEVICE readingList BASE_TOPIC/DEV_ID:.* { json2nameValue($EVENT) }
+deletereading -q DEVICE (?!associatedWith).*
+attr DEVICE model zigbee2mqtt_AlarmSensor
###########################################
@@ -557,6 +583,8 @@ par:POWERCMD;needed command to be sent like in example dec '{"protocol":"NEC","b
par:VOLUMEUPCMD;needed command to be sent like in example raw '0,926,844,958,832,1798,868,902,848,900,870,900,852,908,918,958,794,934,874,928,1738,934,856,1764' (without '');{ undef }
par:MULTIPLE1CMD;needed command to be sent like in example hex '{"Protocol":"NEC","Bits":32,"Data":0x8166817E}' (without '');{ undef }
par:MULTIPLE2CMD;needed command to be sent like in example hex '{"Protocol":"NEC","Bits":32,"Data":0x8166817E}' (without '');{ undef }
+par:ICON;ICON as set, defaults to IR;{ AttrVal("DEVICE","icon","IR") }
+attr DEVICE icon ICON
attr DEVICE setList \
power:noArg CMNDTOPIC/IRsend POWERCMD\
volumeup:noArg CMNDTOPIC/IRsend VOLUMEUPCMD\
@@ -569,7 +597,6 @@ attr DEVICE stateFormat state\
\
IPAddress
attr DEVICE event-on-change-reading .*
-attr DEVICE icon IR
attr DEVICE model tasmota_ir
#tasmota device with rf-circuit
@@ -829,6 +856,8 @@ 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 }
par:TELETOPIC;info topic prefix, without trailing /;{ AttrVal("DEVICE","readingList","") =~ m,([^:]*)\b(tele|cmnd|stat)(/.*)?/LWT:, ? "${1}tele$3" : undef }
par:STATTOPIC;ack topic prefix, without trailing /;{ AttrVal("DEVICE","readingList","") =~ m,([^:]*)\b(tele|cmnd|stat)(/.*)?/LWT:, ? "${1}stat$3" : undef }
+par:ICON;ICON as set, defaults to light_control;{ AttrVal("DEVICE","icon","light_control") }
+attr DEVICE icon ICON
attr DEVICE setList\
off:noArg CMNDTOPIC/POWER1 0\
on:noArg CMNDTOPIC/POWER1 1\
@@ -845,7 +874,6 @@ attr DEVICE readingList \
deletereading -q DEVICE (?!associatedWith).*
attr DEVICE autocreate 0
attr DEVICE devStateIcon {Color::devStateIcon($name,"rgb","Color","Dimmer","POWER1")}
-attr DEVICE icon light_control
attr DEVICE stateFormat POWER1
attr DEVICE webCmd Color:Color ff0000:Color 00ff00:Color 0000ff:toggle:on:off
attr DEVICE model tasmota_rgb_led_controller
@@ -1243,6 +1271,8 @@ filter:TYPE=MQTT2_DEVICE:FILTER=readingList=.*shellies.*
desc:shellybulb using original firmware
Tested with 1.49
order:A_15
par:DEVNAME;name of this shelly;{ AttrVal("DEVICE","readingList","") =~ m,shellies/([^/]+)/, ? $1 : undef }
+par:ICON;ICON as set, defaults to light_control;{ AttrVal("DEVICE","icon","light_control") }
+attr DEVICE icon ICON
attr DEVICE setList\
off:noArg shellies/DEVNAME/color/0/command off\
on:noArg shellies/DEVNAME/color/0/command on\
@@ -1259,7 +1289,6 @@ attr DEVICE readingList shellies/DEVNAME/color/0/status:.* {json2nameValue($EVEN
attr DEVICE userReadings ct:temp.* {ReadingsVal($name,"temp",3000)}, rgb:red.* {if(ReadingsVal($name,"mode","") eq "color"){sprintf("%02X%02X%02X", ReadingsVal($name,"red",99), ReadingsVal($name,"green",99), ReadingsVal($name,"blue",99))}else{my $a=sprintf("%02X",ReadingsVal($name,"brightness",0)*2.555);"$a$a$a"}}
attr DEVICE webCmd on:off:pct:ct:rgb
attr DEVICE genericDeviceType light
-attr DEVICE icon light_control
attr DEVICE model shellybulb
# shellyht using original firmware
@@ -1267,10 +1296,11 @@ name:shellyht
filter:TYPE=MQTT2_DEVICE:FILTER=readingList=.*shellies.*
desc:shellyht using original firmware
Just adds stateFormat and icon
order:A_16
+par:ICON;ICON as set, defaults to temperature_humidity;{ AttrVal("DEVICE","icon","temperature_humidity") }
+attr DEVICE icon ICON
attr DEVICE setList \
x_update:noArg shellies/DEVNAME/command update_fw\
x_mqttcom shellies/DEVNAME/command $EVTPART1
-attr DEVICE icon temperature_humidity
attr DEVICE stateFormat T: temperature °C H: humidity % B: battery %
attr DEVICE model shellyht
@@ -1282,6 +1312,8 @@ filter:TYPE=MQTT2_DEVICE:FILTER=readingList=.*shellies.*
desc:shellyrgbw2 color mode
Tested with 1.5.0-rgbw2-hotfix1
order:A_17
par:DEVNAME;name of this shelly;{ AttrVal("DEVICE","readingList","") =~ m,shellies/([^/]+)/, ? $1 : undef }
+par:ICON;ICON as set, defaults to light_control;{ AttrVal("DEVICE","icon","light_control") }
+attr DEVICE icon ICON
attr DEVICE setList\
off:noArg shellies/DEVNAME/color/0/command off\
on:noArg shellies/DEVNAME/color/0/command on\
@@ -1301,7 +1333,6 @@ attr DEVICE readingList \
attr DEVICE userReadings rgb:red.* {if(ReadingsVal($name,"mode","") eq "color"){sprintf("%02X%02X%02X", ReadingsVal($name,"red",99), ReadingsVal($name,"green",99), ReadingsVal($name,"blue",99))}else{my $a=sprintf("%02X",ReadingsVal($name,"brightness",0)*2.555);"$a$a$a"}}
attr DEVICE webCmd on:off:white:gain:rgb:effect
attr DEVICE setStateList on off
-attr DEVICE icon light_control
attr DEVICE devStateIcon {my $onl = ReadingsVal($name,"online","false") eq "true"?"10px-kreis-gruen":"10px-kreis-rot";; my $light = ReadingsVal($name,"state","off");; my $cons = ReadingsVal($name,"power","unknown");; "".FW_makeImage($onl)." ".FW_makeImage($light)."