diff --git a/fhem/FHEM/lib/AttrTemplate/mqtt2.template b/fhem/FHEM/lib/AttrTemplate/mqtt2.template index 5206e246b..1e5a438d2 100644 --- a/fhem/FHEM/lib/AttrTemplate/mqtt2.template +++ b/fhem/FHEM/lib/AttrTemplate/mqtt2.template @@ -131,9 +131,82 @@ attr DEVICE_CH2 setList \ on:noArg COMMAND/POWER2 1\ toggle:noArg COMMAND/POWER2 2 +# WemosD1 flashed with tasmota +name:tasmota_WemosD1 +filter:TYPE=MQTT2_DEVICE +attr DEVICE readingList \ + tele/DEVICE/LWT:.* LWT\ + tele/DEVICE/STATE:.* { json2nameValue($EVENT) }\ + tele/DEVICE/SENSOR:.* { json2nameValue($EVENT) }\ + stat/DEVICE/RESULT:.* { json2nameValue($EVENT) } +deleteReading DEVICE .* + +# basic tasmota device with unprefixed readings +name:tasmota_noprefix_pure_base +filter:TYPE=MQTT2_DEVICE +attr DEVICE readingList \ + tele/DEVICE/LWT:.* LWT\ + tele/DEVICE/STATE:.* { json2nameValue($EVENT) }\ + tele/DEVICE/SENSOR:.* { json2nameValue($EVENT) }\ + tele/DEVICE/INFO1:.* { json2nameValue($EVENT) }\ + tele/DEVICE/INFO2:.* { json2nameValue($EVENT) }\ + tele/DEVICE/INFO3:.* { json2nameValue($EVENT) }\ + stat/DEVICE/RESULT:.* { json2nameValue($EVENT) } +deleteReading DEVICE .* +attr DEVICE autocreate 0 + +# tasmota 4ch as one FHEM device. +name:tasmota_noprefix_sonoff_4ch +filter:TYPE=MQTT2_DEVICE +attr DEVICE readingList \ + tele/DEVICE/LWT:.* LWT\ + tele/DEVICE/STATE:.* { json2nameValue($EVENT) }\ + tele/DEVICE/SENSOR:.* { json2nameValue($EVENT) }\ + tele/DEVICE/INFO1:.* { json2nameValue($EVENT) }\ + tele/DEVICE/INFO2:.* { json2nameValue($EVENT) }\ + tele/DEVICE/INFO3:.* { json2nameValue($EVENT) }\ + stat/DEVICE/RESULT:.* { json2nameValue($EVENT) } +attr DEVICE setList \ + p1on:noArg cmnd/DEVICE/POWER1 on\ + p1off:noArg cmnd/DEVICE/POWER1 off\ + p2on:noArg cmnd/DEVICE/POWER2 on\ + p2off:noArg cmnd/DEVICE/POWER2 off\ + p3on:noArg cmnd/DEVICE/POWER3 on\ + p3off:noArg cmnd/DEVICE/POWER3 off\ + p4on:noArg cmnd/DEVICE/POWER4 on\ + p4off:noArg cmnd/DEVICE/POWER4 off +attr DEVICE webCmd p1on:p1off:p2on:p2off:p3on:p3off:p4on:p4off +attr DEVICE stateFormat {\ + "