mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-03 19:49:02 +00:00
mqtt2.ebus.template: update (+ utils)
git-svn-id: https://svn.fhem.de/fhem/trunk@24785 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
9540b34c81
commit
86f944274f
@ -9,6 +9,7 @@ use warnings;
|
||||
|
||||
use JSON qw(decode_json);
|
||||
use Scalar::Util qw(looks_like_number);
|
||||
use List::Util 1.45 qw(uniq);
|
||||
|
||||
use GPUtils qw(GP_Import);
|
||||
|
||||
@ -24,6 +25,11 @@ BEGIN {
|
||||
InternalVal
|
||||
CommandGet
|
||||
CommandSet
|
||||
CommandAttr
|
||||
CommandDefine
|
||||
CommandDeleteReading
|
||||
CommandVersion
|
||||
FmtDateTime
|
||||
readingsSingleUpdate
|
||||
readingsBulkUpdate
|
||||
readingsBeginUpdate
|
||||
@ -32,8 +38,10 @@ BEGIN {
|
||||
ReadingsNum
|
||||
ReadingsAge
|
||||
json2nameValue
|
||||
addToDevAttrList
|
||||
defs
|
||||
Log3
|
||||
trim
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -59,6 +67,23 @@ sub j2nv {
|
||||
return json2nameValue($EVENT, $pre, $filt, $not);
|
||||
}
|
||||
|
||||
sub j2singleReading {
|
||||
my $rName = shift // return;
|
||||
my $EVENT = shift // return;
|
||||
my $pre = shift;
|
||||
my $filt = shift;
|
||||
my $not = shift;
|
||||
|
||||
return if !length $EVENT;
|
||||
$EVENT=~ s,[{]"value":\s("?[^"}]+"?)[}],$1,g;
|
||||
my $values = json2nameValue($EVENT, $pre, $filt, $not);
|
||||
my @all;
|
||||
for my $item ( sort keys %{$values} ) {
|
||||
push @all, qq{$item: $values->{$item}};
|
||||
}
|
||||
return { $rName => join q{ - }, @all };
|
||||
}
|
||||
|
||||
sub send_weekprofile {
|
||||
my $name = shift // return;
|
||||
my $wp_name = shift // return;
|
||||
@ -159,11 +184,12 @@ sub send_weekprofile {
|
||||
CommandSet($defs{$name},"$name $Dl[$i] $payload") if ReadingsVal($name,$Dl[$i],'') ne $payload;
|
||||
} elsif ($i == 1) {
|
||||
$payload .= defined $models[0] && $models[0] == 3 ? 'Mo-So' : defined $models[1] && $models[1] ? 'Mo-Fr' : 'selected';
|
||||
CommandSet($defs{$name},"$name $Dl[$i] $payload") if defined $models[0] && $models[0] == 3 ||defined $models[1] && $models[1];
|
||||
CommandSet($defs{$name},"$name $Dl[$i] $payload") if ReadingsVal($name,$Dl[$i],'') ne $payload;
|
||||
} elsif ($i == 0 || $i == 6 ) {
|
||||
my $united = defined $models[0] && $models[0] == 2;
|
||||
$payload .= $united ? 'Sa-So' : 'selected';
|
||||
CommandSet($defs{$name},"$name $Dl[$united ? 6 : $i] $payload") if ReadingsVal($name,$Dl[$united ? 6 : $i],'') ne $payload;
|
||||
CommandSet($defs{$name},"$name $Dl[$united ? 6 : $i] $payload") if ReadingsVal($name,$Dl[$united ? 6 : $i],'') ne $payload || $united;
|
||||
} else {
|
||||
$payload .= 'selected';
|
||||
CommandSet($defs{$name},"$name $Dl[$i] $payload") if ReadingsVal($name,$Dl[$i],'') ne $payload;
|
||||
@ -187,6 +213,179 @@ sub _compareOnOff {
|
||||
return;
|
||||
}
|
||||
|
||||
sub analyzeReadingList {
|
||||
my $name = shift // return;
|
||||
my $setpre = shift // 0;
|
||||
|
||||
my $hash = $defs{$name} // return;
|
||||
|
||||
my $cid = $defs{$name}{CID};
|
||||
my $dt = $defs{$name}{DEVICETOPIC};
|
||||
my $revsn = (split q{\n}, CommandVersion(undef, 'attrTmqtt2_ebus_Utils noheader'))[0] // 'unknown';
|
||||
$revsn = FmtDateTime(time) . " $revsn";
|
||||
my $attrTemplt = q{ebus_analyzeReadingList};
|
||||
|
||||
my $rList_old = AttrVal( $name, 'readingList', '');
|
||||
my $rList_new = q{};
|
||||
my $firstprofile = 0;
|
||||
my $dylist = 0;
|
||||
|
||||
my @need_prefix;
|
||||
my @readings = keys %{$defs{$name}->{READINGS}};
|
||||
for my $m (@readings){
|
||||
if ($m =~ m{\A([^_]+_)_}){
|
||||
push @need_prefix, $1;
|
||||
}
|
||||
}
|
||||
@need_prefix = uniq @need_prefix;
|
||||
my $needs_prefix = join q{|}, @need_prefix;
|
||||
#Log3(undef,3,"präfix regex: $needs_prefix");
|
||||
|
||||
my $newline;
|
||||
for my $line ( split q{\n}, $rList_old ) {
|
||||
$line = trim($line);
|
||||
next if $line eq '';
|
||||
my $func;
|
||||
my $prefix;
|
||||
|
||||
if ( $line =~ m{FHEM::aTm2u_ebus::}xm ) {
|
||||
$rList_new .= $rList_new ? qq{\n$line} : $line;
|
||||
next;
|
||||
}
|
||||
my ($re,$code) = split q{ }, $line, 2;
|
||||
if ( !defined $code ) {
|
||||
Log3($name, 3, "ERROR: deleted empty code in existing readingList line >$line< for $name");
|
||||
next;
|
||||
}
|
||||
|
||||
$re =~ s{\$DEVICETOPIC}{$dt}g;
|
||||
$re =~ s{\A$cid:}{}g;
|
||||
$code = trim($code);
|
||||
|
||||
#not Perl?
|
||||
if($code !~ m{\A[{].*[}]\z}s) {
|
||||
$rList_new .= $rList_new ? qq{\n$re $code} : qq{$re $code};
|
||||
next;
|
||||
}
|
||||
|
||||
my $newtop;
|
||||
my $short;
|
||||
|
||||
#weekprofile type rL element?
|
||||
if ( $re =~ m{(?<start>.+[/])(?<short>[^/:.]+)(?:[.]|\\x2e)(?<dy>[^.]+)(?:[.]|\\x2e)[1-3]:}xm ) {
|
||||
$newtop = qq{$+{start}$+{short}.*:.*};
|
||||
my $sLtop = qq{$+{start}$+{short}};
|
||||
$short = $+{short};
|
||||
my $dy = $+{dy};
|
||||
next if $firstprofile eq $short;
|
||||
my @Dl = ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
|
||||
my @dylists = qw(Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday Sonntag|Montag|Dienstag|Mittwoch|Donnerstag|Freitag|Samstag Sun|Mon|Tue|Wed|Thu|Fri|Sat Son|Mon|Die|Mit|Don|Fre|Sam Su|Mo|Tu|We|Th|Fr|Sa So|Mo|Di|Mi|Do|Fr|Sa);
|
||||
|
||||
for my $daylist (@dylists) {
|
||||
if ( $dylist) {
|
||||
$func = "{ FHEM::aTm2u_ebus::upd_day_profile( \$NAME, \$TOPIC, \$EVENT, '" . $dylist . "' ) }";
|
||||
} elsif ( $dy =~ m{$daylist}xms ) {
|
||||
$func = "{ FHEM::aTm2u_ebus::upd_day_profile( \$NAME, \$TOPIC, \$EVENT, '" . $daylist . "' ) }";
|
||||
$dylist = $daylist;
|
||||
}
|
||||
}
|
||||
if ( !defined $func ) {
|
||||
Log3(undef, 1, "error evaluating daylist, day is $dy");
|
||||
next;
|
||||
}
|
||||
$newline = qq{$newtop $func};
|
||||
#Log3(undef, 3, "topic: $newtop, function $func");
|
||||
|
||||
my @shD = split m{\|}xms, $dylist;
|
||||
if ( !$firstprofile ) {
|
||||
$rList_new .= $rList_new ? qq{\n$newline} : qq{$newline};
|
||||
$firstprofile = $short;
|
||||
my $sList_old = AttrVal( $name, 'setList', '');
|
||||
my $sList_new = $sList_old;
|
||||
for my $i (0..6) {
|
||||
my $sLline = qq{$Dl[$i] $sLtop.$shD[$i]/set};
|
||||
if ( index ($sList_new, $sLline) == -1 ) {
|
||||
$sList_new .= $sList_new ? qq{\n$sLline} : $sLline;
|
||||
}
|
||||
}
|
||||
CommandAttr(undef, "$name setList $sList_new") if $sList_new ne $sList_old;
|
||||
addToDevAttrList($name, 'weekprofile', 'weekprofile');
|
||||
CommandAttr(undef, "$name weekprofile $name") if !defined AttrVal($name, 'weekprofile', undef);
|
||||
next;
|
||||
}
|
||||
my $newdev = qq{${name}_${short}};
|
||||
if ( !defined $defs{$newdev} ) {
|
||||
CommandDefine( $defs{$name}, "$newdev MQTT2_DEVICE" );
|
||||
readingsBeginUpdate($defs{$newdev});
|
||||
readingsBulkUpdate($defs{$newdev}, 'associatedWith', $name);
|
||||
readingsBulkUpdate($defs{$newdev}, 'IODev', InternalVal($name, 'IODev',undef)->{NAME});
|
||||
readingsBulkUpdate($defs{$newdev}, 'attrTemplateVersion', $revsn);
|
||||
readingsEndUpdate($defs{$newdev}, 0);
|
||||
my $nroom = AttrVal($name, 'room','MQTT2_DEVICE');
|
||||
CommandAttr(undef, "$newdev room $nroom");
|
||||
my $sList;
|
||||
for my $i (0..6) {
|
||||
my $sLlin = qq{$Dl[$i] $sLtop.$shD[$i]/set};
|
||||
$sList .= $sList ? qq{\n$sLlin} : $sLlin;
|
||||
}
|
||||
CommandAttr(undef, "$newdev setList $sList");
|
||||
CommandAttr(undef, "$newdev model $attrTemplt");
|
||||
addToDevAttrList($newdev, 'weekprofile', 'weekprofile');
|
||||
CommandAttr(undef, "$newdev weekprofile $newdev");
|
||||
my $ac = ReadingsVal($name, 'associatedWith','');
|
||||
$ac .= $ac ? qq{,$newdev} : $newdev;
|
||||
readingsSingleUpdate($defs{$name}, 'associatedWith', $ac, 0);
|
||||
|
||||
}
|
||||
my $rl2 = AttrVal($newdev, 'readingList', "");
|
||||
$rl2 .= q{\n} if $rl2;
|
||||
CommandAttr(undef, "$newdev readingList $rl2$newline") if index($rl2, $newtop) == -1;
|
||||
next;
|
||||
}
|
||||
|
||||
my $prefix ;
|
||||
|
||||
#json2nameValue type rL element with dot?
|
||||
if ( $re =~ m{(?<start>.+[/])(?<short>[^/:]+)(?:[.]|\\x2e)(?<item>[^.:123]+):}xm ) {
|
||||
$newtop = qq{$+{start}$+{short}.$+{item}:.*};
|
||||
$prefix = qq{$+{short}_$+{item}_};
|
||||
|
||||
$func = '{ FHEM::aTm2u_ebus::j2nv( $EVENT, ' . qq{'$prefix', } . '$JSONMAP ) }';
|
||||
$newline = qq{$newtop $func};
|
||||
$rList_new .= $rList_new ? qq{\n$newline} : qq{$newline};
|
||||
next;
|
||||
}
|
||||
|
||||
#json2nameValue type rL element with Error content? ebusd/sc/ErrorHistory
|
||||
if ( $re =~ m{(?<start>.+[/])(?<short>ErrorHistory):}xm ) {
|
||||
$newtop = $re;
|
||||
$short = $+{short};
|
||||
$func = q<{ FHEM::aTm2u_ebus::j2singleReading( > . qq{'$short', }. q<$EVENT, '', $JSONMAP ) }>;
|
||||
$newline = qq{$newtop $func};
|
||||
$rList_new .= $rList_new ? qq{\n$newline} : qq{$newline};
|
||||
next;
|
||||
}
|
||||
|
||||
#json2nameValue type rL element w/o dot?
|
||||
if ( $code =~ m{\A[{]\s+json2nameValue.*[}]\z}s) {
|
||||
$func = q<{ FHEM::aTm2u_ebus::j2nv( $EVENT, '>;
|
||||
my $funcb = q<', $JSONMAP ) }>;
|
||||
my $mid = q{};
|
||||
$re =~ m{(?<start>.+[/])(?<pre>[^/:]+):}xm;
|
||||
my $mid2 = qq{$+{pre}_};
|
||||
$mid = $mid2 if $setpre || $mid2 =~ m{$needs_prefix}xms;
|
||||
$newline = qq{$re $func${mid}${funcb}};
|
||||
$rList_new .= $rList_new ? qq{\n$newline} : qq{$newline};
|
||||
next;
|
||||
}
|
||||
}
|
||||
#Log3(undef,3,"readingList new: $rList_new");
|
||||
CommandAttr(undef, "$name readingList $rList_new") if index($rList_old, $rList_new) == -1;
|
||||
CommandAttr(undef, "$name model $attrTemplt") if AttrVal($name, 'model', '') ne $attrTemplt;
|
||||
CommandDeleteReading(undef, "$name .*_value");
|
||||
readingsSingleUpdate($defs{$name}, 'attrTemplateVersion', $revsn,0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
#ebusd/hc1/HP1.Mo.1:.* { json2nameValue($EVENT) }
|
||||
@ -259,20 +458,20 @@ __END__
|
||||
<b>Functions to support attrTemplates for ebusd</b><br>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><b>aTm2u_ebus::j2nv</b><br>
|
||||
<code>aTm2u_ebus::j2nv($,$$$)</code><br>
|
||||
<li><b>FHEM::aTm2u_ebus::j2nv</b><br>
|
||||
<code>FHEM::aTm2u_ebus::j2nv($,$$$)</code><br>
|
||||
This is just a wrapper to fhem.pl json2nameValue() to prevent the "_value" postfix. It will first clean the first argument by applying <code>$EVENT=~ s,[{]"value":\s("?[^"}]+"?)[}],$1,g</code>.
|
||||
</li>
|
||||
<li><b>aTm2u_ebus::upd_day_profile</b><br>
|
||||
<code>aTm2u_ebus::upd_day_profile($$$,$)</code><br>
|
||||
<li><b>FHEM::aTm2u_ebus::upd_day_profile</b><br>
|
||||
<code>FHEM::aTm2u_ebus::upd_day_profile($$$,$)</code><br>
|
||||
Helper function to collect weekprofile info received over different topics. $NAME, $TOPIC and $EVENT are obligatory to be handed over, additionally you may provide a <i>daylist</i> as 4th argument. <i>daylist</i> defaults to Su|Mo|Tu|We|Th|Fr|Sa. Generated readings will be named Sunday, Monday, ..., so make sure to use different MQTT2-devices for each topic-group, if there's more than one item attached to your ebus capable to use weekly profiles.
|
||||
</li>
|
||||
<li><b>aTm2u_ebus::send_weekprofile</b><br>
|
||||
<code>aTm2u_ebus::send_weekprofile($$$,$$)</code><br>
|
||||
<li><b>FHEM::aTm2u_ebus::send_weekprofile</b><br>
|
||||
<code>FHEM::aTm2u_ebus::send_weekprofile($$$,$$)</code><br>
|
||||
Helper function that may be capable to translate a (temperature) <i>weekly profile<i> provided by a <i>weekprofile<i> TYPE device to the ebus format (max. three pairs of on/off switching times).
|
||||
</li>
|
||||
<li><b>aTm2u_ebus::createBarView</b><br>
|
||||
<code>aTm2u_ebus::createBarView($,$$)</code><br>
|
||||
<li><b>FHEM::aTm2u_ebus::createBarView</b><br>
|
||||
<code>FHEM::aTm2u_ebus::createBarView($,$$)</code><br>
|
||||
Parameters are
|
||||
<ul>
|
||||
<li>$value (required)</li>
|
||||
|
@ -16,12 +16,18 @@
|
||||
# 03.04.19 corrected Errors in jsonMap and valuesuffix
|
||||
# 18.01.20 prepare for svn distribution, see https://forum.fhem.de/index.php/topic,97989.msg1014104.html#msg1014104
|
||||
|
||||
|
||||
name:eBus_analyzeReadingList
|
||||
filter:TYPE=MQTT2_DEVICE
|
||||
desc:The JSON messages generated by ebusd are special. The code provided by 99_attrTmqtt2_ebus_Utils.pm includes some special functions to get shorter reading names (e.g. without the _value appendix). This template calls a function to analyze the readingList attribute and the available readings to find out which kind of pree-treatment seems to be appropriate for each line calling json2nameValue(). This works best if autocreate in "complex" mode had been used to fill the readingList attribute.
|
||||
order:E_01a02
|
||||
{ FHEM::aTm2u_ebus::analyzeReadingList("DEVICE") }
|
||||
|
||||
|
||||
name:eBus_bai_jsonMap_Status01
|
||||
filter:TYPE=MQTT2_DEVICE
|
||||
desc:Format ebus Statusmessages comming from broadcast
|
||||
par:DEV_ID;name of the device ebus;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
|
||||
order:E_01a1
|
||||
order:E_01ax1
|
||||
attr DEVICE readingList \
|
||||
ebusd/DEV_ID/Status01:.* { json2nameValue($EVENT, 'Status01_', $JSONMAP) }\
|
||||
ebusd/DEV_ID/Status02:.* { json2nameValue($EVENT, 'Status02_', $JSONMAP) }
|
||||
@ -30,13 +36,14 @@ attr DEVICE jsonMap Status01_0_value:_Vorlauf Status01_1_value:_Ruecklauf Status
|
||||
attr DEVICE icon sani_boiler_temp
|
||||
deletereading DEVICE Status.*
|
||||
attr DEVICE model eBus_bai_jsonmap
|
||||
setreading DEVICE attrTemplateVersion first
|
||||
|
||||
name:eBus_4xx_devStateIcon_HeatCurve_HwcTemp
|
||||
filter:TYPE=MQTT2_DEVICE
|
||||
desc:Format ebus Statusmessages comming from broadcast
|
||||
par:DEV_ID;name of the device ebus;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
|
||||
par:BASE_DEV;base topic set in config;{ AttrVal("DEVICE","readingList","") =~ m,ebusd/([^/]*)/, ? $1 : undef }
|
||||
order:E_01a2
|
||||
order:E_01ax2
|
||||
attr DEVICE setList Hc1HeatCurve_curve_value:uzsuDropDown,0.20,0.70,0.90,1.00,1.10,1.20,1.30,1.40,1.50,1.60,1.70 ebusd/BASE_DEV/Hc1HeatCurve/set $EVTPART1\
|
||||
HwcTempDesired_temp1_value:uzsuDropDown,50.0,51.0,52.0,53.0,54.0,55.0,56.0,57.0,58.0,59.0,60.0 ebusd/BASE_DEV/HwcTempDesired/set $EVTPART1
|
||||
attr DEVICE getList Hc1HeatCurve:noArg Hc1HeatCurve_curve_value ebusd/BASE_DEV/Hc1HeatCurve/get \
|
||||
@ -45,17 +52,18 @@ attr DEVICE devStateIcon {my $vC = ReadingsVal($name, "Hc1HeatCurve_curve_value"
|
||||
attr DEVICE webCmd Hc1HeatCurve_curve_value:HwcTempDesired_temp1_value
|
||||
attr DEVICE webCmdLabel Heizkurve \
|
||||
:Warmwasser
|
||||
attr DEVICE room MQTT2_\DEVICE
|
||||
#attr DEVICE room MQTT2_\DEVICE
|
||||
attr DEVICE group eBus_Hcurve
|
||||
attr DEVICE icon message_tendency_steady
|
||||
attr DEVICE model eBus_4xx_HeatCurve_HwcTemp
|
||||
setreading DEVICE attrTemplateVersion 20210722
|
||||
|
||||
name:eBus_430_devStateIcon_Pump_Fan_HeatCurve_HwcTemp
|
||||
filter:TYPE=MQTT2_DEVICE
|
||||
desc:Format ebus Statusmessages comming from broadcast
|
||||
par:DEV_ID;name of the device ebus;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
|
||||
par:BASE_DEV;base topic set in config;{ AttrVal("DEVICE","readingList","") =~ m,ebusd/([^/]*)/, ? $1 : undef }
|
||||
order:E_01a3
|
||||
order:E_01ax3
|
||||
attr DEVICE devStateIcon {my $vC = ReadingsVal($name, "Hc1HeatCurve_curve_value", "10")*10; my $colCur = substr(Color::pahColor(5,10,15,$vC,0),0,6); my $iconCur = 'time_graph@'.$colCur; my $vH = ReadingsVal($name, "HwcTempDesired_temp1_value", "30"); my $colHot = substr(Color::pahColor(0,30,60,$vH,0),0,6); my $iconHot = 'sani_water_hot@'.$colHot; ; "<div style=\"text-align:right\" > " . FW_makeImage("$iconCur",'file_unknown@grey') . "<br> " . FW_makeImage("$iconHot",'sani_water_hot@red') . "</div>"}
|
||||
attr DEVICE setList Hc1HeatCurve_curve_value:uzsuDropDown,0.20,0.70,0.90,1.00,1.10,1.20,1.30,1.40,1.50,1.60,1.70 ebusd/430/Hc1HeatCurve/set $EVTPART1\
|
||||
HwcTempDesired_temp1_value:uzsuDropDown,50.0,51.0,52.0,53.0,54.0,55.0,56.0,57.0,58.0,59.0,60.0 ebusd/430/HwcTempDesired/set $EVTPART1
|
||||
@ -64,17 +72,18 @@ HwcTempDesired:noArg HwcTempDesired_temp1_value ebusd/430/HwcTempDesired/get
|
||||
attr DEVICE webCmd Hc1HeatCurve_curve_value:HwcTempDesired_temp1_value
|
||||
attr DEVICE webCmdLabel Heizkurve \
|
||||
:Warmwasser
|
||||
attr DEVICE room MQTT2_\DEVICE
|
||||
#attr DEVICE room MQTT2_\DEVICE
|
||||
attr DEVICE group eBus_Hcurve
|
||||
attr DEVICE icon message_tendency_steady
|
||||
attr DEVICE model eBus_430_Pump_Fan_HeatCurve_HwcTemp
|
||||
setreading DEVICE attrTemplateVersion 20210722
|
||||
|
||||
name:eBus_bai_devStateIcon_Fan_Pump
|
||||
filter:TYPE=MQTT2_DEVICE
|
||||
desc:Format ebus Statusmessages comming from broadcast
|
||||
par:DEV_ID;name of the device ebus;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
|
||||
par:IODEVROOM;Room of the IOdevice; {AttrVal(AttrVal("DEVICE","IODev",""),"room","" ) ? AttrVal(AttrVal("DEVICE","IODev",""),"room","" ) : undef }
|
||||
order:E_01a4
|
||||
order:E_01ax4
|
||||
# create in a new Reading
|
||||
defmod MQTT2_ebusd_pump MQTT2_\DEVICE ebusd_pump
|
||||
attr MQTT2_ebusd_pump IODev ebusMQTT
|
||||
@ -83,12 +92,13 @@ attr MQTT2_ebusd_pump icon Ventilator_fett
|
||||
attr MQTT2_ebusd_pump room MQTT2_\DEVICE
|
||||
attr MQTT2_ebusd_pump group eBus_Pumpe
|
||||
attr MQTT2_ebusd_pump model eBus_bai_Fan_Pump
|
||||
setreading DEVICE attrTemplateVersion first
|
||||
|
||||
name:eBus_bai_devStateIcon_Flow_Return_Hotwater_Temp
|
||||
filter:TYPE=MQTT2_DEVICE
|
||||
desc:Format ebus Statusmessages comming from broadcast
|
||||
par:DEV_ID;name of the device ebus;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
|
||||
order:E_01a5
|
||||
order:E_01ax5
|
||||
# create in a new Reading
|
||||
defmod MQTT2_ebusd_status MQTT2_\DEVICE ebusd_status
|
||||
attr MQTT2_ebusd_status IODev ebusMQTT
|
||||
@ -103,47 +113,51 @@ attr MQTT2_ebusd_status icon sani_boiler_temp
|
||||
attr MQTT2_ebusd_status room MQTT2_\DEVICE
|
||||
attr MQTT2_ebusd_status group eBus_Temperatur
|
||||
attr MQTT2_ebusd_status model eBus_bai_Flow_Return
|
||||
setreading MQTT2_ebusd_status attrTemplateVersion first
|
||||
|
||||
name:eBus_bai_devStateIcon_Waterpressure
|
||||
filter:TYPE=MQTT2_DEVICE
|
||||
desc:Format ebus Statusmessages comming from broadcast
|
||||
order:E_01ax6
|
||||
par:DEV_ID;name of the device ebus;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
|
||||
order:E_01a6
|
||||
par:IODEVNAME;Name of the IO-Device; { InternalVal('DEVICE','LASTInputDev',AttrVal('DEVICE','IODev',InternalVal('DEVICE','IODev',undef)->{NAME})) }
|
||||
defmod MQTT2_ebusd_pressure MQTT2_\DEVICE ebusd_pressure
|
||||
attr MQTT2_ebusd_pressure IODev ebusMQTT
|
||||
attr MQTT2_ebusd_pressure IODev IODEVNAME
|
||||
attr MQTT2_ebusd_pressure devStateIcon {my $vD = ReadingsVal("MQTT2_ebusd_bai", "WaterPressure_press_value", "30"); my $colDruck = substr(Color::pahColor(0,1,2,$vD,0),0,6); my $iconDruck = 'weather_barometric_pressure@'.$colDruck; ; "<div style=\"text-align:right\" > Wasserdruck: " . FW_makeImage("$iconDruck",'file_unknown@grey') . int($vD*100)/100 . " Bar</div>"}
|
||||
attr MQTT2_ebusd_pressure icon vacuum_bold
|
||||
attr MQTT2_ebusd_pressure room MQTT2_\DEVICE
|
||||
attr MQTT2_ebusd_pressure model eBus_bai_Pressure
|
||||
|
||||
setreading MQTT2_ebusd_pressure attrTemplateVersion 20210722
|
||||
|
||||
name:eBus_bai_Status01+Status02_HWC
|
||||
filter:TYPE=MQTT2_DEVICE
|
||||
desc:Format ebus Status Messages01 + Status02 Hotwater comming from broadcast
|
||||
par:DEV_ID;name of the device ebus;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
|
||||
order:E_01a7
|
||||
order:E_01ax7
|
||||
attr DEVICE stateFormat {sprintf("Vorlauf: %.1f <br>Ruecklauf: %.1f <br>Warmwasser: %.1f <br>Aussentemp.: %.1f <br>Pumpe: %s <br>HWC-maxTemp: %.1f <br>HWC-Regler_Max: %.1f <br>HWC-CurrentTemp: %.1f <br>HWC-Mode: %s", ReadingsVal($name,"_Vorlauf",0), ReadingsVal($name,"_Ruecklauf",0), ReadingsVal($name,"_Warmwasser",0), ReadingsVal($name,"_Aussentemp",0), ReadingsVal($name,"_Pumpenstatus",0), ReadingsVal($name,"_Maximaltemperatur",0), ReadingsVal($name,"_ReglerMaxTEMP",0), ReadingsVal($name,"_ReglerCurrentTemp",0), ReadingsVal($name,"_HWCMode",0))}
|
||||
attr DEVICE icon icoTempHeizung
|
||||
attr DEVICE jsonMap Status01_0_value:_Vorlauf Status01_1_value:_Ruecklauf Status01_2_value:_Aussentemp Status01_3_value:_Warmwasser Status01_4_value:_WWSpeicher Status01_5_value:_Pumpenstatus Status02_0_value:_HWCMode Status02_1_value:_Maximaltemperatur Status02_2_value:_ReglerMaxTEMP Status02_3_value:_ReglerCurrentTemp
|
||||
attr DEVICE devStateStyle style="text-align:right"
|
||||
deletereading DEVICE Status.*
|
||||
attr DEVICE model eBus_Status
|
||||
setreading DEVICE attrTemplateVersion first
|
||||
|
||||
name:eBus_SetMode
|
||||
filter:TYPE=MQTT2_DEVICE
|
||||
desc:Format ebus setmode messages comming from broadcast
|
||||
order:E_01a8
|
||||
order:E_01ax8
|
||||
attr DEVICE stateFormat {sprintf("Flowtempdesired: %.1f <br>Hcmode: %s", ReadingsVal($name,"SetMode_flowtempdesired_value",0), ReadingsVal($name,"SetMode_hcmode_value",0))}
|
||||
attr DEVICE icon icoTempHeizung
|
||||
attr DEVICE devStateStyle style="text-align:right"
|
||||
attr DEVICE model eBus_SetMode
|
||||
setreading DEVICE attrTemplateVersion first
|
||||
|
||||
#ebus Hcurve+HwcTempDesired Messages.
|
||||
name:eBus_Hc1HeatCurve+HwcTempDesired
|
||||
filter:TYPE=MQTT2_DEVICE
|
||||
par:BASE_DEV;base topic set in config;{ AttrVal("DEVICE","readingList","") =~ m,ebusd/([^/]*)/, ? $1 : undef }
|
||||
desc:Applies settings to ebus Heatingcurve and Hotwater
|
||||
order:E_01a9
|
||||
order:E_01ax9
|
||||
attr DEVICE icon message_tendency_steady
|
||||
attr DEVICE webCmd curve_value:temp1_value
|
||||
attr DEVICE webCmdLabel Hc1HeatCurve:HwcTempDesired
|
||||
@ -151,6 +165,7 @@ attr DEVICE setList Hc1HeatCurve_curve_value:0.20,0.70,0.90,1.00,1.10,1.20,1.30,
|
||||
HwcTempDesired_temp1_value:50.0,51.0,52.0,53.0,54.0,55.0,56.0,57.0,58.0,59.0,60.0 ebusd/BASE_DEV/HwcTempDesired/set $EVTPART1
|
||||
deletereading DEVICE .*
|
||||
attr DEVICE model eBus_Hc1HeatCurve+HwcTempDesired
|
||||
setreading DEVICE attrTemplateVersion first
|
||||
|
||||
|
||||
|
||||
@ -159,7 +174,7 @@ name:eBus_bai_readingsgroup_Status01
|
||||
filter:TYPE=MQTT2_DEVICE
|
||||
desc:Format ebus Statusmessages comming from broadcast
|
||||
par:DEV_ID;name of the device ebus;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
|
||||
order:E_01a9
|
||||
order:E_01ax91
|
||||
define eBusTemperaturen readingsGroup MQTT2_ebusd_bai:<%sani_supply_temp>,<Vorlauf>,_Vorlauf\
|
||||
MQTT2_ebusd_bai:<%sani_return_temp>,<Ruecklauf>,_Ruecklauf\
|
||||
MQTT2_ebusd_bai:<%sani_water_hot>,<Warmwasser>,_Warmwasser\
|
||||
@ -185,7 +200,7 @@ name:eBus_bai_readingsgroup_Status01_Balken
|
||||
filter:TYPE=MQTT2_DEVICE
|
||||
desc:Format ebus Statusmessages comming from broadcast
|
||||
par:DEV_ID;name of the device ebus;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
|
||||
order:E_01a10
|
||||
order:E_01ax10
|
||||
define eBusTemperaturBalken readingsGroup MQTT2_ebusd_bai:<%sani_supply_temp>,<Vorlauf>,_Vorlauf\
|
||||
MQTT2_ebusd_bai:<%sani_return_temp>,<Ruecklauf>,_Ruecklauf\
|
||||
MQTT2_ebusd_bai:<%sani_water_hot>,<Warmwasser>,_Warmwasser\
|
||||
@ -203,7 +218,7 @@ name:eBus_bai_readingsgroup_Status02
|
||||
filter:TYPE=MQTT2_DEVICE
|
||||
desc:Format ebus Statusmessages comming from broadcast
|
||||
par:DEV_ID;name of the device ebus;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
|
||||
order:E_01a11
|
||||
order:E_01ax11
|
||||
define eBusWarmwasser readingsGroup MQTT2_ebusd_bai:<%time_automatic>,<HWCMode>,_HWCMode\
|
||||
MQTT2_ebusd_bai:<%temp_temperature_max>,<Maximaltemperatur>,Maximaltemperatur\
|
||||
MQTT2_ebusd_bai:<%sani_earth_source_heat_pump>,<ReglerMaxTEMP>,_ReglerMaxTEMP\
|
||||
@ -226,7 +241,7 @@ name:eBus_bai_readingsgroup_Status02_Balken
|
||||
filter:TYPE=MQTT2_DEVICE
|
||||
desc:Format ebus Statusmessages comming from broadcast
|
||||
par:DEV_ID;name of the device ebus;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
|
||||
order:E_01a12
|
||||
order:E_01ax12
|
||||
define eBusWarmwasserBalken readingsGroup MQTT2_ebusd_bai:<%time_automatic>,<HWCMode>,_HWCMode\
|
||||
MQTT2_ebusd_bai:<%temp_temperature_max>,<Maximaltemperatur>,_Maximaltemperatur\
|
||||
MQTT2_ebusd_bai:<%sani_earth_source_heat_pump>,<ReglerMaxTEMP>,_ReglerMaxTEMP\
|
||||
@ -242,7 +257,7 @@ name:eBus_Calormatic_readingsgroup_Set_Hcurve_Hotwater
|
||||
filter:TYPE=MQTT2_DEVICE
|
||||
desc:Format ebus Statusmessages comming from broadcast
|
||||
par:BASE_DEV;base topic set in config;{ AttrVal("DEVICE","readingList","") =~ m,ebusd/([^/]*)/, ? $1 : undef }
|
||||
order:E_01a13
|
||||
order:E_01ax13
|
||||
define eBusSet readingsGroup <>,<Name>,< Ist>,< Soll>\
|
||||
MQTT2_ebusd_BASE_DEV:<%message_tendency_steady>,<Heizkurve>,Hc1HeatCurve_curve_value,<sollcurve>\
|
||||
MQTT2_ebusd_BASE_DEV:<%sani_water_hot>,<Warmwasser>,HwcTempDesired_temp1_value,<sollwater>
|
||||
@ -259,7 +274,7 @@ name:eBus_bai_readingsgroup_eBusCounter
|
||||
filter:TYPE=MQTT2_DEVICE
|
||||
desc:Format ebus Statusmessages comming from broadcast
|
||||
par:DEV_ID;name of the device ebus;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
|
||||
order:E_01a14
|
||||
order:E_01ax14
|
||||
define eBusCounter readingsGroup <>,<Gerät>,< Zähler>\
|
||||
MQTT2_ebusd_bai:<%Ventilator_fett>,<Ventilator>,FanHours_hoursum2_value \
|
||||
MQTT2_ebusd_bai:<%sani_boiler_temp>,<Wärmetauscher>,HcHours_hoursum2_value \
|
||||
@ -278,7 +293,7 @@ name:eBus_bai_readingsgroup_eBusPumpe
|
||||
filter:TYPE=MQTT2_DEVICE
|
||||
desc:Format ebus Statusmessages comming from broadcast
|
||||
par:DEV_ID;name of the device ebus;{ AttrVal("DEVICE","readingList","") =~ m,[^/]+[/]([^/]+).*:, ? $1 : undef }
|
||||
order:E_01a15
|
||||
order:E_01ax15
|
||||
define eBusPumpe readingsGroup <>,<Vaillant>,< Leistung> MQTT2_ebusd_bai:<%measure_power>,<Heizungspumpe>,WPPWMPower_percent0_value MQTT2_ebusd_bai:<%vent_ventilation_level_automatic>,<Ventilatordrehzahl>,FanSpeed_0_value
|
||||
attr eBusPumpe cellStyle { "r:1"=>'style="font-weight:bold;;font-size:16px"'}
|
||||
attr eBusPumpe nameStyle style="color:yellow"
|
||||
@ -292,7 +307,7 @@ name:eBus_Calormatic_readingsgroup_Set_Hcurve_Hotwater
|
||||
filter:TYPE=MQTT2_DEVICE
|
||||
desc:Format ebus Statusmessages comming from broadcast
|
||||
par:BASE_DEV;base topic set in config;{ AttrVal("DEVICE","readingList","") =~ m,ebusd/([^/]*)/, ? $1 : undef }
|
||||
order:E_01a16
|
||||
order:E_01ax16
|
||||
define eBusSet readingsGroup <>,<Name>,< Ist>,< Soll>\
|
||||
MQTT2_ebusd_BASE_DEV:<%message_tendency_steady>,<Heizkurve>,Hc1HeatCurve_curve_value,<sollcurve>\
|
||||
MQTT2_ebusd_BASE_DEV:<%sani_water_hot>,<Warmwasser>,HwcTempDesired_temp1_value,<sollwater>
|
||||
@ -308,7 +323,7 @@ name:eBus_Calormatic_TimeProgramm
|
||||
filter:TYPE=MQTT2_DEVICE
|
||||
desc:Format ebus Statusmessages comming from broadcast
|
||||
par:BASE_DEV;base topic set in config;{ AttrVal("DEVICE","readingList","") =~ m,ebusd/([^/]*)/, ? $1 : undef }
|
||||
order:E_01a17
|
||||
order:E_01ax17
|
||||
define TimeMo dummy
|
||||
attr TimeMo alias 1 Montag
|
||||
attr TimeMo group Zeiteingabe
|
||||
|
Loading…
x
Reference in New Issue
Block a user