diff --git a/fhem/FHEM/lib/AttrTemplate/mqtt2.template b/fhem/FHEM/lib/AttrTemplate/mqtt2.template index c3d859c8a..b0a116c40 100644 --- a/fhem/FHEM/lib/AttrTemplate/mqtt2.template +++ b/fhem/FHEM/lib/AttrTemplate/mqtt2.template @@ -137,7 +137,7 @@ attr DEVICE model zigbee2mqtt_light_dimmer # A dimmable color light connected via zigbee2mqtt name:zigbee2mqtt_light_cct filter:TYPE=MQTT2_DEVICE:FILTER=CID=zigbee.* -desc: A dimmable light with color temperature via zigbee2mqtt +desc: A dimmable light with color temperature via zigbee2mqtt
Tested with: tradfri FLOALT panel WS 30x90 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 } @@ -516,7 +516,6 @@ attr DEVICE setList \ off:noArg CMNDTOPIC/POWER1 0\ on:noArg CMNDTOPIC/POWER1 1\ toggle:noArg CMNDTOPIC/POWER1 2\ - on-for-timer {my $duration = $EVTPART1 < 11.2 ? $EVTPART1*10 : $EVTPART1+100; 'CMNDTOPIC/Backlog pulseTime1 '.$duration.'; POWER1 1'}\ setOtaUrl:textField CMNDTOPIC/OtaUrl $EVTPART1\ upgrade:noArg CMNDTOPIC/upgrade 1 attr DEVICE readingList \ @@ -527,7 +526,7 @@ attr DEVICE readingList \ STATTOPIC/RESULT:.* { json2nameValue($EVENT) } deletereading -q DEVICE (?!associatedWith).* attr DEVICE setStateList on off toggle -attr DEVICE comment NOTE: on-for-timer is limited to 18h max duration! +attr DEVICE comment NOTE: For on-for-timer SetExtensions are used. You may add on-for-timer option running on the device. The following is limited to 1h max duration, but will not affect future simple "on" commands:
on-for-timer {my $duration = $EVTPART1*10; 'cmnd/CMNDTOPIC/Backlog POWER1 1; delay '.$duration.'; POWER1 0'}
See the "Praxisbeispiele" in the wiki for "pulseTime1" alternative option and it's restrictions. attr DEVICE autocreate 0 attr DEVICE model tasmota_basic_state_power1 @@ -1499,6 +1498,33 @@ attr DEVICE_CH4 setList off:noArg shellies/DEVNAME/white/3/command off\ setreading DEVICE_CH4 associatedWith DEVICE,DEVICE_CH2,DEVICE_CH3 attr DEVICE_CH4 setStateList on off +#shellydimmer +# contributed by zeppelin, https://forum.fhem.de/index.php/topic,94495.msg994764.html#msg994764 +name:shellydimmer +filter:TYPE=MQTT2_DEVICE:FILTER=readingList=.*shellies.* +desc:shellydimmer
Tested with 20191119-085746/master@e3a747f5 +order:A_18 +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/light/0/command off\ + on:noArg shellies/DEVNAME/light/0/command on\ + pct:slider,0,1,100 shellies/DEVNAME/light/0/set {"turn": "on","brightness": $EVTPART1} +deletereading -q DEVICE status_.* +attr DEVICE readingList \ + shellies/DEVNAME/light/0/status:.* {json2nameValue($EVENT)}\ + shellies/DEVNAME/temperature:.* temperature\ + shellies/DEVNAME/temperature_f:.* temperature_f\ + shellies/DEVNAME/overtemperature:.* overtemperature\ + shellies/DEVNAME/overload:.* overload\ + shellies/DEVNAME/loaderror:.* loaderror\ + shellies/announce:.* { $EVENT =~ m,..id...DEVNAME...mac.*, ? json2nameValue($EVENT) : undef } +attr DEVICE webCmd pct:on:off +attr DEVICE devStateIcon {my $lderr = ReadingsVal($name,"loaderror","true") eq "true"?"10px-kreis-rot":"10px-kreis-gruen";; my $light = ReadingsVal($name,"ison","false") eq "true"?"on":"off";; my $cons = ReadingsVal($name,"light_0_power","unknown");; FW_makeImage($lderr)."".FW_makeImage($light)."
Leistung: $cons
"} +set DEVICE x_mqttcom announce +attr DEVICE model shellydimmer + ############### #ebusd # @@ -1853,7 +1879,7 @@ name:roborock filter:TYPE=MQTT2_DEVICE:FILTER=readingList=.*valetudo[/].* desc:use this to control a rooted Xiamoni Vacuum / Roborock. For further details visit https://github.com/Hypfer/Valetudo

NOTE: Initial version, not yet fully tested, just build according to https://forum.fhem.de/index.php/topic,104804.0.html
order:X_03 -par:BASE_ID;BASE_ID typically is home;{ AttrVal("DEVICE","readingList","") =~ m,([^:]+)[/]valetudo[/].*:, ? $1 : undef } +par:BASE_ID;BASE_ID typically is valetudo;{ AttrVal("DEVICE","readingList","") =~ m,(valetudo)[/].*:, ? $1 : undef } par:DEVNAME;DEVNAME typically is rockrobo;{ AttrVal("DEVICE","readingList","") =~ m,valetudo[/]([^/]+)[/].*:, ? $1 : undef } deletereading -q DEVICE (?!associatedWith).* defmod DEVICE MQTT2_DEVICE DEVNAME