From 441c3aca2b742e7b955ea2036891fe61c0c51533 Mon Sep 17 00:00:00 2001 From: Beta-User <> Date: Tue, 8 Dec 2020 21:35:35 +0000 Subject: [PATCH] mqtt2.template: z2t contact - small changes git-svn-id: https://svn.fhem.de/fhem/trunk@23319 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/lib/AttrTemplate/mqtt2.template | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fhem/FHEM/lib/AttrTemplate/mqtt2.template b/fhem/FHEM/lib/AttrTemplate/mqtt2.template index 1559df631..56d1b7524 100644 --- a/fhem/FHEM/lib/AttrTemplate/mqtt2.template +++ b/fhem/FHEM/lib/AttrTemplate/mqtt2.template @@ -2027,17 +2027,18 @@ desc:This template is meant to configure a window contact, e.g. like Xiaomi MCCG order:A_01u04b par:TELETOPIC;info topic prefix, without trailing /;{ AttrVal("DEVICE","readingList","") =~ m,([^:]*)\b(tele|cmnd|stat)(/.*/[^/]+/SENSOR)?:, ? "${1}tele$3" : undef } par:DEV_ID;ZigBee short ID, hex value without leading 0x;{ AttrVal("DEVICE","readingList","") =~ m,([^:]*)\b(tele|cmnd|stat)/.*/([^/]+)/SENSOR?:, ? "$3" : undef } -par:ICON;ICON as set, defaults to light_control;{ AttrVal("DEVICE","icon","light_control") } +par:ICON;ICON as set, defaults to tuer_fenster_kontakt;{ AttrVal("DEVICE","icon","tuer_fenster_kontakt") } par:CALLSPEECHRECOGN;Set this to 0 to not set any speech recogn. related attributes;{ 1 } attr DEVICE icon ICON attr DEVICE readingList \ -TELETOPIC:.* { $EVENT =~ s/"Power":1/"state":"open"/g; $EVENT =~ s/"Power":0/"state":"closed"/g; $EVENT =~ m,^.*(..Device.+)..$, ? json2nameValue($1,'',$JSONMAP) : $EVENT =~ m,0xDEV_ID.:(.*).., ? json2nameValue($1,'',$JSONMAP) : undef } +TELETOPIC:.* { $EVENT =~ s/"(Power|Contact)":1/"state":"open"/g; $EVENT =~ s/"(Power|Contact)":0/"state":"closed"/g; $EVENT =~ m,^.*(..Device.+)..$, ? json2nameValue($1,'',$JSONMAP) : $EVENT =~ m,0xDEV_ID.:(.*).., ? json2nameValue($1,'',$JSONMAP) : undef } attr DEVICE jsonMap Device:0 Battery:0 BatteryPercentage:batteryPercent BatteryVoltage:batteryVoltage deletereading -q DEVICE (?!associatedWith).* option:{ CALLSPEECHRECOGN } set DEVICE attrTemplate speechcontrol_gdt_and_mapping GENERICDEVTYPE=contact HOMEBRIDGEMAPPING="ContactSensorState=state,values=closed:CONTACT_DETECTED;;open:CONTACT_NOT_DETECTED" +option:global attr DEVICE model tasmota_zigbee2tasmota_window_contact -setreading DEVICE attrTemplateVersion 20201202 +setreading DEVICE attrTemplateVersion 20201208 name:tasmota_zigbee2tasmota_motion_sensor @@ -2085,6 +2086,7 @@ attr DEVICE setStateList on off attr DEVICE jsonMap Battery:0 Device:0 BatteryPercentage:batteryPercent LocalTemperature:measured-temp OccupiedHeatingSetpoint:dayTemp UnoccupiedHeatingSetpoint:nightTemp CurrentTemperatureSetPoint:desired-temp PIHeatingDemand:valve option:{ CALLSPEECHRECOGN } set DEVICE attrTemplate speechcontrol_type_thermostat +option:global setreading DEVICE attrTemplateVersion 20201202 ###########################################