From b2c7f0f3def3dbe0f09056b9ded589f312b2c47b Mon Sep 17 00:00:00 2001 From: Beta-User Date: Wed, 6 Oct 2021 17:44:09 +0000 Subject: [PATCH] mqtt2.template: update to WThermostatBeca git-svn-id: https://svn.fhem.de/fhem/trunk@25051 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/lib/AttrTemplate/mqtt2.template | 24 ++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/fhem/FHEM/lib/AttrTemplate/mqtt2.template b/fhem/FHEM/lib/AttrTemplate/mqtt2.template index 2e7c4cc56..aac4c589e 100644 --- a/fhem/FHEM/lib/AttrTemplate/mqtt2.template +++ b/fhem/FHEM/lib/AttrTemplate/mqtt2.template @@ -2353,6 +2353,7 @@ attr DEVICE jsonMap Battery:0 Device:0 BatteryPercentage:batteryPercent LocalTem option:{ CALLSPEECHRECOGN } set DEVICE attrTemplate speechcontrol_type_thermostat option:global +attr DEVICE model tasmota_zigbee2tasmota_eurotronic_spirit setreading DEVICE attrTemplateVersion 20210811 # Thermostat Beca Wifi @@ -2376,25 +2377,26 @@ LWT\ state attr DEVICE setStateList on off weekprofile attr DEVICE readingList TELETOPIC/LWT:.* LWT\ - devices/network:.* { json2nameValue($EVENT,'d_network_',$JSONMAP) }\ - devices/clock:.* { json2nameValue($EVENT,'d_clock_',$JSONMAP) }\ - devices/thermostat:.* { json2nameValue($EVENT,'d_thermostat_',$JSONMAP) }\ - devices/logging:.* { json2nameValue($EVENT,'d_log_',$JSONMAP) }\ + devices/(network|clock|thermostat|logging):.* {}\ STATTOPIC/things/network/properties:.* { json2nameValue($EVENT,'net_',$JSONMAP) }\ - STATTOPIC/things/thermostat/properties:.* { json2nameValue($EVENT,'',$JSONMAP) }\ + STATTOPIC/things/thermostat/properties:.* { $EVENT =~ s/true/"on"/g;; $EVENT =~ s/false/"off"/g;; json2nameValue($EVENT,'',$JSONMAP) }\ STATTOPIC/things/logging/properties:.* { json2nameValue($EVENT,'log_',$JSONMAP) }\ - STATTOPIC/things/clock/properties:.* { json2nameValue($EVENT,'clock_',$JSONMAP) } -attr DEVICE setList on CMNDTOPIC/things/thermostat/properties/deviceOn true\ - off CMNDTOPIC/things/thermostat/properties/deviceOn false\ + STATTOPIC/things/clock/properties:.* { json2nameValue($EVENT,'clock_',$JSONMAP) }\ + STATTOPIC/things/thermostat/deviceOn:.* {{state => $EVENT eq 'false' ? 'off' : 'on'}}\ + STATTOPIC/things/thermostat/targetTemperature:.* desired-temp +attr DEVICE setList on:noArg CMNDTOPIC/things/thermostat/properties/deviceOn true\ + off:noArg CMNDTOPIC/things/thermostat/properties/deviceOn false\ desired-temp:slider,5.0,0.5,35.0,1 CMNDTOPIC/things/thermostat/properties/targetTemperature $EVTPART1\ - mode:heat,auto CMNDTOPIC/things/thermostat/properties/mode $EVTPART1\ + mode:heat,auto,cool CMNDTOPIC/things/thermostat/properties/mode $EVTPART1\ weekprofile { FHEM::attrT_z2m_thermostat_Utils::z2t_send_Beca_weekprofile($NAME, $EVTPART1, $EVTPART2, 'CMNDTOPIC/things/thermostat/schedules') }\ x_send_mcucommand:textField { my $payload = $EVENT;$payload =~ s/$EVTPART0 //g; qq(CMNDTOPIC/things/thermostat/mcucommand $payload)} attr DEVICE getList desired-temp:noArg desired-temp CMNDTOPIC/things/thermostat/properties -attr DEVICE jsonMap targetTemperature:desired-temp +attr DEVICE jsonMap targetTemperature:0 deviceOn:0 +attr DEVICE webCmd mode:desired-temp set DEVICE attrTemplate speechcontrol_type_thermostat deletereading -q DEVICE (?!associatedWith|IODev).* -setreading DEVICE attrTemplateVersion 20211005 +attr DEVICE model WThermostatBeca +setreading DEVICE attrTemplateVersion 20211006 ###########################################