Ich glaube die Lösung gefunden zu haben.
Ich habe 2 verschiedene Thermostate. Der erste ist ein Avatto ME81AH und mit folgendem Attr-template versehen:
# Thermostat Avatto ME81AH Wifi
name:WThermostatME81AH
filter:TYPE=MQTT2_DEVICE
desc: First version for <a href="https://github.com/AlbertWeterings/WThermostatBeca">WThermostat ME81AH</a>. <br>Not yet tested... <br> see <a href="https://forum.fhem.de/index.php/topic,123212.0.html">Forum Thread</a>. Might also be ok for original firmware from https://github.com/klausahrenberg/WThermostatBeca
order:E_05c
par:ICON;ICON as set, defaults to hm-tc-it-wm-w-eu;{ AttrVal("DEVICE","icon","hm-tc-it-wm-w-eu") }
par:WPNAME;weekprofile attr value, defaults to device name;{ AttrVal('DEVICE','weekprofile','DEVICE') }
{ Svn_GetFile("contrib/AttrTemplate/99_attrT_z2m_thermostat_Utils.pm", "FHEM/99_attrT_z2m_thermostat_Utils.pm", sub(){ CommandReload(undef, "99_attrT_z2m_thermostat_Utils.pm") }) }
attr DEVICE icon ICON
attr DEVICE userattr weekprofile
attr DEVICE weekprofile WPNAME
attr DEVICE devStateIcon <a href="http://ip" target="_blank">\
LWT\
</a>\
state
attr DEVICE setStateList on off weekprofile
attr DEVICE readingList DEVICE/thermostat/properties/deviceOn:.* LWT\
devices/(clock|thermostat):.* {}\
DEVICE/clock/properties:.* { json2nameValue($EVENT,'clock_',$JSONMAP) }\
DEVICE/thermostat/properties:.* { $EVENT =~ s/true/"on"/g;; $EVENT =~ s/false/"off"/g;; json2nameValue($EVENT,'',$JSONMAP) }\
DEVICE/thermostat/properties/systemMode:.* {{state => $EVENT eq 'heat' ? 'on' : 'off'}}\
DEVICE/thermostat/properties/Temperature:.* temperature\
DEVICE/thermostat/properties/TargetTemperature:.* desired-temp
attr DEVICE setList on:noArg DEVICE/thermostat/set/deviceOn true\
off:noArg DEVICE/thermostat/set/deviceOn false\
desired-temp:slider,5.0,1.0,35.0,1 DEVICE/thermostat/set/TargetTemperature $EVTPART1\
schedulesMode:auto,off DEVICE/thermostat/set/schedulesMode $EVTPART1\
systemMode:heat,cool,fan_only DEVICE/thermostat/set/systemMode $EVTPART1\
sensorSelection:internal,floor,both DEVICE/thermostat/set/sensorSelection $EVTPART1
weekprofile { FHEM::attrT_z2m_thermostat_Utils::z2t_send_Beca_weekprofile($NAME, $EVTPART1, $EVTPART2, 'DEVICE/thermostat/set/schedules') }\
attr DEVICE getList desired-temp:noArg desired-temp DEVICE/thermostat/properties/TargetTemperature
attr DEVICE jsonMap TargetTemperature:0 Temperature:0
attr DEVICE webCmd schedulesMode:desired-temp
attr DEVICE userReadings temp_mean:temperature:.* {ReadingsVal($name,"temperature",0)},state:systemMode:.* {ReadingsVal($name,"systemMode",0)}
attr DEVICE event-aggregator temp_mean:300:linear:mean
deletereading -q DEVICE (?!associatedWith|IODev).*
attr DEVICE model WThermostatME81AH
setreading DEVICE attrTemplateVersion 20221115
Der zweite Thermostat ist ein Moes BHT-002 GALW und fast identisch zu dem vom thread Eröffner und das template sehr ähnlich zum schon vorhandenen WThermostatBeca template:
# Thermostat Moes BHT-002 GALW Wifi
name:WThermostatBHT002
filter:TYPE=MQTT2_DEVICE
desc: First version for <a href="https://github.com/fashberg/WThermostatBeca">WThermostat BHT-002 GALW</a>. <br>Not yet tested... <br> see <a href="https://forum.fhem.de/index.php/topic,123212.0.html">Forum Thread</a>. Might also be ok for original firmware from https://github.com/klausahrenberg/WThermostatBeca
order:E_05b
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 hm-tc-it-wm-w-eu;{ AttrVal("DEVICE","icon","hm-tc-it-wm-w-eu") }
par:WPNAME;weekprofile attr value, defaults to device name;{ AttrVal('DEVICE','weekprofile','DEVICE') }
{ Svn_GetFile("contrib/AttrTemplate/99_attrT_z2m_thermostat_Utils.pm", "FHEM/99_attrT_z2m_thermostat_Utils.pm", sub(){ CommandReload(undef, "99_attrT_z2m_thermostat_Utils.pm") }) }
attr DEVICE icon ICON
attr DEVICE userattr weekprofile
attr DEVICE weekprofile WPNAME
attr DEVICE devStateIcon <a href="http://ip" target="_blank">\
LWT\
</a>\
state
attr DEVICE setStateList on off weekprofile
attr DEVICE readingList TELETOPIC/LWT:.* LWT\
devices/(network|clock|thermostat|logging):.* {}\
STATTOPIC/things/network/properties:.* { json2nameValue($EVENT,'net_',$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) }\
STATTOPIC/things/thermostat/targetTemperature:.* desired-temp\
STATTOPIC/things/thermostat/properties/state:.* {{state => $EVENT eq 'heating' ? 'on' : 'off'}}
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,off 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/targetTemperature
attr DEVICE jsonMap targetTemperature:0
attr DEVICE webCmd mode:desired-temp
attr DEVICE userReadings temp_mean:temperature:.* {ReadingsVal($name,"temperature",0)}
attr DEVICE event-on-change-reading .*
attr DEVICE event-min-interval .*:300
deletereading -q DEVICE (?!associatedWith|IODev).*
attr DEVICE model WThermostatBHT002
setreading DEVICE attrTemplateVersion 20220108
Die Bedienung habe ich bei Beiden gerinfügig verändert, so daß man zwischen Manuell und Schedule Automatik umschalten kann. Das loggen wurde durch das userreading beschränkt, ist aber vielleicht noch verbesserungswürdig.
Das getList im WThermostatBeca hat nicht funktioniert, und musste so gemacht werden wie oben angezeigt.
Das Testen war sehr umständlich, weil das Ablegen der Einzelfiles im lib Verzeichnis nicht funktioniert, trotz Attr_Initialize() und anders mehr. Nur Einfügen in den große tempalte File hat funktioniert.