diff --git a/fhem/FHEM/lib/AttrTemplate/mqtt2.template b/fhem/FHEM/lib/AttrTemplate/mqtt2.template
index fde1660b3..e2799975b 100644
--- a/fhem/FHEM/lib/AttrTemplate/mqtt2.template
+++ b/fhem/FHEM/lib/AttrTemplate/mqtt2.template
@@ -3420,7 +3420,7 @@ set DEVICE getKnown
attr DEVICE comment NOTE: additional templates and code have been downloaded from svn (contrib).
Pls. inform the maintainer, if the bridgeRegexp doesn't fit to all of your devices connected to the bus.
farewell:template has been applied successfully.
NOTE: additional templates and code have been downloaded from svn (contrib).
To configure further parts of your ebus ecosystem, have a look at these templates and the Wiki, to see more info about the provided code, issue help attrTmqtt2_ebus_Utils.
attr DEVICE model eBus_daemon_splitter
-setreading DEVICE attrTemplateVersion 20210720
+setreading DEVICE attrTemplateVersion 20210715
name:ebus_update_files_from_svn
filter:TYPE=MQTT2_DEVICE
diff --git a/fhem/contrib/AttrTemplate/99_attrTmqtt2_ebus_Utils.pm b/fhem/contrib/AttrTemplate/99_attrTmqtt2_ebus_Utils.pm
index 8c244e4fe..ce8d518dd 100644
--- a/fhem/contrib/AttrTemplate/99_attrTmqtt2_ebus_Utils.pm
+++ b/fhem/contrib/AttrTemplate/99_attrTmqtt2_ebus_Utils.pm
@@ -28,7 +28,7 @@ BEGIN {
CommandAttr
CommandDefine
CommandDeleteReading
- CommandVersion
+ FileRead
FmtDateTime
readingsSingleUpdate
readingsBulkUpdate
@@ -40,6 +40,7 @@ BEGIN {
json2nameValue
addToDevAttrList
defs
+ attr
Log3
trim
)
@@ -221,7 +222,7 @@ sub analyzeReadingList {
my $cid = $defs{$name}{CID};
my $dt = $defs{$name}{DEVICETOPIC};
- my $revsn = (split q{\n}, CommandVersion(undef, 'attrTmqtt2_ebus_Utils noheader'))[0] // 'unknown';
+ my $revsn = _getVersion();
$revsn = FmtDateTime(time) . " $revsn";
my $attrTemplt = q{ebus_analyzeReadingList};
@@ -363,6 +364,7 @@ sub analyzeReadingList {
$func = q<{ FHEM::aTm2u_ebus::j2singleReading( > . qq{'$short', }. q<$EVENT, '', $JSONMAP ) }>;
$newline = qq{$newtop $func};
$rList_new .= $rList_new ? qq{\n$newline} : qq{$newline};
+ CommandDeleteReading(undef, "$name ${short}_.*");
next;
}
@@ -446,6 +448,23 @@ sub createBarView {
return $stylestring;
}
+sub _getVersion {
+ my $modpath = (exists($attr{global}{modpath}) ? $attr{global}{modpath} : "");
+ my $fn = "$modpath.FHEM/99_attrTmqtt2_ebus_Utils.pm"; # configDB
+ my ($ret, @content) = FileRead($fn);
+ if ($ret) {
+ Log3(undef, 1, "Error reading file $fn!") ;
+ return 'unknown';
+ }
+ for (@content) {
+ chomp;
+ if(m{#.*\$Id\:[^\$\n\r].+\$}xm) {
+ return $_;
+ }
+ }
+ return 'unknown';
+}
+
1;
__END__
@@ -462,10 +481,18 @@ __END__
FHEM::aTm2u_ebus::j2nv($,$$$)
This is just a wrapper to fhem.pl json2nameValue() to prevent the "_value" postfix. It will first clean the first argument by applying $EVENT=~ s,[{]"value":\s("?[^"}]+"?)[}],$1,g
.
+
FHEM::aTm2u_ebus::j2singleReading($$,$$$)
FHEM::aTm2u_ebus::upd_day_profile($$$,$)
FHEM::aTm2u_ebus::($)
FHEM::aTm2u_ebus::send_weekprofile($$$,$$)
help attrTmqtt2_ebus_Utils
.
order:E_01a02
{ FHEM::aTm2u_ebus::analyzeReadingList("DEVICE") }
-
+farewell:Please check results now (additional devices may have been created!help attrTmqtt2_ebus_Utils
.
name:eBus_bai_jsonMap_Status01
filter:TYPE=MQTT2_DEVICE