CUL_HM added
git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@751 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
1
CHANGED
1
CHANGED
@@ -7,6 +7,7 @@
|
|||||||
- bugfix: S300TH sanity check won't allow negative temperatures.
|
- bugfix: S300TH sanity check won't allow negative temperatures.
|
||||||
- feature: decode CUL uptime
|
- feature: decode CUL uptime
|
||||||
- feature: USB doc changes, FHZ initFS20_02/stopHMS parameters by Andreas.
|
- feature: USB doc changes, FHZ initFS20_02/stopHMS parameters by Andreas.
|
||||||
|
- feature: CUL_HM (experimental) for HomeMatic devices.
|
||||||
|
|
||||||
- 2010-08-15 (5.0)
|
- 2010-08-15 (5.0)
|
||||||
- **NOTE*: The default installation path is changed to satisfy lintian
|
- **NOTE*: The default installation path is changed to satisfy lintian
|
||||||
|
|||||||
@@ -5,15 +5,15 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use Time::HiRes qw(gettimeofday);
|
use Time::HiRes qw(gettimeofday);
|
||||||
|
|
||||||
|
sub CUL_Attr(@);
|
||||||
sub CUL_Clear($);
|
sub CUL_Clear($);
|
||||||
sub CUL_Write($$$);
|
|
||||||
sub CUL_Read($);
|
|
||||||
sub CUL_ReadAnswer($$$$);
|
|
||||||
sub CUL_Ready($);
|
|
||||||
sub CUL_HandleCurRequest($$);
|
sub CUL_HandleCurRequest($$);
|
||||||
sub CUL_HandleWriteQueue($);
|
sub CUL_HandleWriteQueue($);
|
||||||
sub CUL_Parse($$$$$);
|
sub CUL_Parse($$$$$);
|
||||||
|
sub CUL_Read($);
|
||||||
|
sub CUL_ReadAnswer($$$$);
|
||||||
|
sub CUL_Ready($);
|
||||||
|
sub CUL_Write($$$);
|
||||||
|
|
||||||
sub CUL_OpenDev($$);
|
sub CUL_OpenDev($$);
|
||||||
sub CUL_CloseDev($);
|
sub CUL_CloseDev($);
|
||||||
@@ -38,7 +38,6 @@ my %sets = (
|
|||||||
"bWidth" => "",
|
"bWidth" => "",
|
||||||
"rAmpl" => "",
|
"rAmpl" => "",
|
||||||
"sens" => "",
|
"sens" => "",
|
||||||
"verbose" => "X",
|
|
||||||
"led" => "l",
|
"led" => "l",
|
||||||
"patable" => "x",
|
"patable" => "x",
|
||||||
"file" => "",
|
"file" => "",
|
||||||
@@ -47,18 +46,11 @@ my %sets = (
|
|||||||
|
|
||||||
my @ampllist = (24, 27, 30, 33, 36, 38, 40, 42); # rAmpl(dB)
|
my @ampllist = (24, 27, 30, 33, 36, 38, 40, 42); # rAmpl(dB)
|
||||||
|
|
||||||
sub
|
my $clientsSlowRF = ":FS20:FHT:FHT8V:KS300:USF1000:BS:HMS" .
|
||||||
CUL_Initialize($)
|
":CUL_EM:CUL_WS:CUL_FHTTK:CUL_RFR:CUL_HOERMANN:";
|
||||||
{
|
my $clientsHomeMatic = ":CUL_HM:";
|
||||||
my ($hash) = @_;
|
|
||||||
|
|
||||||
# Provider
|
my %matchListSlowRF = (
|
||||||
$hash->{ReadFn} = "CUL_Read";
|
|
||||||
$hash->{WriteFn} = "CUL_Write";
|
|
||||||
$hash->{Clients} =
|
|
||||||
":FS20:FHT:KS300:CUL_EM:CUL_WS:USF1000:BS:HMS:CUL_FHTTK:CUL_RFR:FHT8V".
|
|
||||||
":CUL_HOERMANN:";
|
|
||||||
my %mc = (
|
|
||||||
"1:USF1000" => "^81..(04|0c)..0101a001a5ceaa00....",
|
"1:USF1000" => "^81..(04|0c)..0101a001a5ceaa00....",
|
||||||
"2:BS" => "^81..(04|0c)..0101a001a5cf",
|
"2:BS" => "^81..(04|0c)..0101a001a5cf",
|
||||||
"3:FS20" => "^81..(04|0c)..0101a001",
|
"3:FS20" => "^81..(04|0c)..0101a001",
|
||||||
@@ -70,8 +62,23 @@ CUL_Initialize($)
|
|||||||
"9:CUL_FHTTK" => "^T........",
|
"9:CUL_FHTTK" => "^T........",
|
||||||
"A:CUL_RFR" => "^[0-9A-F]{4}U.",
|
"A:CUL_RFR" => "^[0-9A-F]{4}U.",
|
||||||
"B:CUL_HOERMANN"=> "^R..........",
|
"B:CUL_HOERMANN"=> "^R..........",
|
||||||
);
|
);
|
||||||
$hash->{MatchList} = \%mc;
|
my %matchListHomeMatic = (
|
||||||
|
"1:CUL_HM" => "^A......................",
|
||||||
|
);
|
||||||
|
|
||||||
|
sub
|
||||||
|
CUL_Initialize($)
|
||||||
|
{
|
||||||
|
my ($hash) = @_;
|
||||||
|
|
||||||
|
# Provider
|
||||||
|
$hash->{ReadFn} = "CUL_Read";
|
||||||
|
$hash->{WriteFn} = "CUL_Write";
|
||||||
|
$hash->{Clients} = $clientsSlowRF;
|
||||||
|
$hash->{MatchList} = \%matchListSlowRF;
|
||||||
|
$hash->{HomeMaticClients} = $clientsHomeMatic;
|
||||||
|
$hash->{HomeMaticMatchList} = \%matchListHomeMatic;
|
||||||
$hash->{ReadyFn} = "CUL_Ready";
|
$hash->{ReadyFn} = "CUL_Ready";
|
||||||
|
|
||||||
# Normal devices
|
# Normal devices
|
||||||
@@ -80,9 +87,11 @@ CUL_Initialize($)
|
|||||||
$hash->{GetFn} = "CUL_Get";
|
$hash->{GetFn} = "CUL_Get";
|
||||||
$hash->{SetFn} = "CUL_Set";
|
$hash->{SetFn} = "CUL_Set";
|
||||||
$hash->{StateFn} = "CUL_SetState";
|
$hash->{StateFn} = "CUL_SetState";
|
||||||
|
$hash->{AttrFn} = "CUL_Attr";
|
||||||
$hash->{AttrList}= "do_not_notify:1,0 dummy:1,0 " .
|
$hash->{AttrList}= "do_not_notify:1,0 dummy:1,0 " .
|
||||||
"showtime:1,0 model:CUL,CUN,CUR loglevel:0,1,2,3,4,5,6 " .
|
"showtime:1,0 model:CUL,CUN,CUR loglevel:0,1,2,3,4,5,6 " .
|
||||||
"fhtsoftbuffer:1,0 sendpool addvaltrigger";
|
"fhtsoftbuffer:1,0 sendpool addvaltrigger " .
|
||||||
|
"rfmode:SlowRF,HomeMatic hm_autopair";
|
||||||
$hash->{ShutdownFn} = "CUL_Shutdown";
|
$hash->{ShutdownFn} = "CUL_Shutdown";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,7 +291,6 @@ WRITEEND:
|
|||||||
|
|
||||||
return "Expecting a 0-padded hex number"
|
return "Expecting a 0-padded hex number"
|
||||||
if((length($arg)&1) == 1 && $type ne "raw");
|
if((length($arg)&1) == 1 && $type ne "raw");
|
||||||
$initstr = "X$arg" if($type eq "verbose");
|
|
||||||
Log $ll, "set $name $type $arg";
|
Log $ll, "set $name $type $arg";
|
||||||
CUL_SimpleWrite($hash, $sets{$type} . $arg);
|
CUL_SimpleWrite($hash, $sets{$type} . $arg);
|
||||||
|
|
||||||
@@ -456,6 +464,7 @@ CUL_DoInit($)
|
|||||||
Log 1, $msg;
|
Log 1, $msg;
|
||||||
return $msg;
|
return $msg;
|
||||||
}
|
}
|
||||||
|
$ver =~ s/[\r\n]//g;
|
||||||
$hash->{VERSION} = $ver;
|
$hash->{VERSION} = $ver;
|
||||||
|
|
||||||
if($ver =~ m/CUR/) {
|
if($ver =~ m/CUR/) {
|
||||||
@@ -757,7 +766,7 @@ CUL_Parse($$$$$)
|
|||||||
my $rssi;
|
my $rssi;
|
||||||
|
|
||||||
my $dmsg = $rmsg;
|
my $dmsg = $rmsg;
|
||||||
if($initstr =~ m/X2/ && $dmsg =~ m/^[FTKEHR]([A-F0-9][A-F0-9])+$/) { # RSSI
|
if($dmsg =~ m/^[AFTKEHR]([A-F0-9][A-F0-9])+$/) { # RSSI
|
||||||
my $l = length($dmsg);
|
my $l = length($dmsg);
|
||||||
$rssi = hex(substr($dmsg, $l-2, 2));
|
$rssi = hex(substr($dmsg, $l-2, 2));
|
||||||
$dmsg = substr($dmsg, 0, $l-2);
|
$dmsg = substr($dmsg, 0, $l-2);
|
||||||
@@ -829,6 +838,8 @@ CUL_Parse($$$$$)
|
|||||||
;
|
;
|
||||||
} elsif($fn eq "R" && $len >= 11) { # CUL_EM / Native
|
} elsif($fn eq "R" && $len >= 11) { # CUL_EM / Native
|
||||||
;
|
;
|
||||||
|
} elsif($fn eq "A" && $len >= 21) { # AskSin/BidCos/HomeMatic
|
||||||
|
;
|
||||||
} else {
|
} else {
|
||||||
Log GetLogLevel($name,2), "$name: unknown message $dmsg";
|
Log GetLogLevel($name,2), "$name: unknown message $dmsg";
|
||||||
return;
|
return;
|
||||||
@@ -1069,4 +1080,36 @@ CUL_Disconnected($)
|
|||||||
DoTrigger($name, "DISCONNECTED");
|
DoTrigger($name, "DISCONNECTED");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub
|
||||||
|
CUL_Attr(@)
|
||||||
|
{
|
||||||
|
my @a = @_;
|
||||||
|
|
||||||
|
if($a[2] eq "rfmode") {
|
||||||
|
|
||||||
|
my $name = $a[1];
|
||||||
|
my $hash = $defs{$name};
|
||||||
|
|
||||||
|
if($a[3] eq "HomeMatic") {
|
||||||
|
return if($initstr eq "Ar");
|
||||||
|
$hash->{mode} = "HomeMatic";
|
||||||
|
$initstr = "Ar";
|
||||||
|
CUL_SimpleWrite($hash, $initstr);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return if($initstr eq "X21");
|
||||||
|
delete($hash->{mode});
|
||||||
|
$initstr = "X21";
|
||||||
|
CUL_SimpleWrite($hash, "Ax");
|
||||||
|
CUL_SimpleWrite($hash, $initstr);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Log 2, "Switched $name rfmode to $a[3]";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return undef;
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|||||||
@@ -172,7 +172,6 @@ autocreate_Notify($$)
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CommandSave(undef, undef) if(!$ret && $nrcreated && $attr{$me}{autosave});
|
CommandSave(undef, undef) if(!$ret && $nrcreated && $attr{$me}{autosave});
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,6 +76,7 @@
|
|||||||
<a href="#CUL">CUL</a>
|
<a href="#CUL">CUL</a>
|
||||||
<a href="#CUL_EM">CUL_EM</a>
|
<a href="#CUL_EM">CUL_EM</a>
|
||||||
<a href="#CUL_FHTTK">CUL_FHTTK</a>
|
<a href="#CUL_FHTTK">CUL_FHTTK</a>
|
||||||
|
<a href="#CUL_HM">CUL_HM</a>
|
||||||
<a href="#CUL_HOERMANN">CUL_HOERMANN</a>
|
<a href="#CUL_HOERMANN">CUL_HOERMANN</a>
|
||||||
<a href="#CUL_RFR">CUL_RFR</a>
|
<a href="#CUL_RFR">CUL_RFR</a>
|
||||||
<a href="#CUL_WS">CUL_WS</a>
|
<a href="#CUL_WS">CUL_WS</a>
|
||||||
@@ -790,7 +791,8 @@ A line ending with \ will be concatenated with the next one, so long lines
|
|||||||
<pre> fhem> xmllist
|
<pre> fhem> xmllist
|
||||||
<FHZINFO>
|
<FHZINFO>
|
||||||
<internal_LIST>
|
<internal_LIST>
|
||||||
<internal name="global" state="internal" sets="" attrs="room configfile logfile modpath pidfilename port statefile userattr verbose version">
|
<internal name="global" state="internal" sets=""
|
||||||
|
attrs="room configfile logfile ...">
|
||||||
<INT key="DEF" value="<no definition>"/>
|
<INT key="DEF" value="<no definition>"/>
|
||||||
<INT key="NR" value="0"/>
|
<INT key="NR" value="0"/>
|
||||||
<INT key="STATE" value="internal"/>
|
<INT key="STATE" value="internal"/>
|
||||||
@@ -1102,7 +1104,6 @@ A line ending with \ will be concatenated with the next one, so long lines
|
|||||||
|
|
||||||
<a name="fhtsoftbuffer"></a>
|
<a name="fhtsoftbuffer"></a>
|
||||||
<li>fhtsoftbuffer<br/>
|
<li>fhtsoftbuffer<br/>
|
||||||
Can be applied to FHZ devices.<br/>
|
|
||||||
As the FHZ command buffer for FHT devices is limited (see fhtbuf),
|
As the FHZ command buffer for FHT devices is limited (see fhtbuf),
|
||||||
and commands are only sent to the FHT device every 120 seconds,
|
and commands are only sent to the FHT device every 120 seconds,
|
||||||
the hardware buffer may overflow and FHT commands get lost.
|
the hardware buffer may overflow and FHT commands get lost.
|
||||||
@@ -1899,11 +1900,6 @@ A line ending with \ will be concatenated with the next one, so long lines
|
|||||||
<a name="CULset"></a>
|
<a name="CULset"></a>
|
||||||
<b>Set </b>
|
<b>Set </b>
|
||||||
<ul>
|
<ul>
|
||||||
<li>verbose<br>
|
|
||||||
Set a CUL "verbose" level. See the CUL firmware README document for
|
|
||||||
details. Note: only X00/X01/X21/X25 is supported by the fhem CUL
|
|
||||||
module, the other flags may crash fhem.
|
|
||||||
</li><br>
|
|
||||||
<li>raw<br>
|
<li>raw<br>
|
||||||
Issue a CUL firmware command. See the CUL firmware README document for
|
Issue a CUL firmware command. See the CUL firmware README document for
|
||||||
details on CUL commands.
|
details on CUL commands.
|
||||||
@@ -1973,7 +1969,7 @@ A line ending with \ will be concatenated with the next one, so long lines
|
|||||||
<li><a href="#showtime">showtime</a></li><br>
|
<li><a href="#showtime">showtime</a></li><br>
|
||||||
<li><a href="#loglevel">loglevel</a></li><br>
|
<li><a href="#loglevel">loglevel</a></li><br>
|
||||||
<li><a href="#model">model</a> (CUL,CUN,CUR)</li><br>
|
<li><a href="#model">model</a> (CUL,CUN,CUR)</li><br>
|
||||||
<li><a href="#sendpool">sendpool</a><br>
|
<li><a name="sendpool">sendpool</a><br>
|
||||||
If using more than one CUL/CUN for covering a large area, sending
|
If using more than one CUL/CUN for covering a large area, sending
|
||||||
different events by the different CUL's might disturb each other. This
|
different events by the different CUL's might disturb each other. This
|
||||||
phenomenon is also known as the Palm-Beach-Resort effect.
|
phenomenon is also known as the Palm-Beach-Resort effect.
|
||||||
@@ -1984,17 +1980,28 @@ A line ending with \ will be concatenated with the next one, so long lines
|
|||||||
attr CUN2 sendpool CUN1,CUN2,CUN3<br>
|
attr CUN2 sendpool CUN1,CUN2,CUN3<br>
|
||||||
attr CUN3 sendpool CUN1,CUN2,CUN3<br>
|
attr CUN3 sendpool CUN1,CUN2,CUN3<br>
|
||||||
</li><br>
|
</li><br>
|
||||||
<li><a name="culfhtsoftbuffer">fhtsoftbuffer</a><br/>
|
<li><a name="addvaltrigger">addvaltrigger</a><br>
|
||||||
As the CUL command buffer for FHT devices is limited (see fhtbuf),
|
|
||||||
and commands are only sent to the FHT device every 120 seconds,
|
|
||||||
the hardware buffer may overflow and FHT commands get lost or errors
|
|
||||||
may occur.
|
|
||||||
Setting this attribute implements an "unlimited" software buffer.<br>
|
|
||||||
Default is disabled (i.e. not set or set to 0).</li><br>
|
|
||||||
<li><a href="#addvaltrigger">addvaltrigger</a><br>
|
|
||||||
Create triggers for additional device values. Right now these are RSSI
|
Create triggers for additional device values. Right now these are RSSI
|
||||||
and RAWMSG for the CUL family and RAWMSG for the FHZ.
|
and RAWMSG for the CUL family and RAWMSG for the FHZ.
|
||||||
</li><br>
|
</li><br>
|
||||||
|
<li><a name="rfmode">rfmode</a><br>
|
||||||
|
Configure the RF Transceiver of the CUL (the CC1101). Available
|
||||||
|
arguments are:
|
||||||
|
<ul>
|
||||||
|
<li>SlowRF<br>
|
||||||
|
To communicate with FS20/FHT/HMS/EM1010/S300/Hoermann devices @1kHz
|
||||||
|
datarate. This is the default.
|
||||||
|
|
||||||
|
<li>HomeMatic<br>
|
||||||
|
To communicate with HomeMatic type of devices @20kHz datarate
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</li><br>
|
||||||
|
|
||||||
|
<li><a name="rfmode">hm_autopair</a><br>
|
||||||
|
Only useful in HomeMatic mode, see rfmode above. The CUL_HM Module will
|
||||||
|
try to pair any device requesting a pairing.
|
||||||
|
</li><br>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -2103,6 +2110,62 @@ A line ending with \ will be concatenated with the next one, so long lines
|
|||||||
<br>
|
<br>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<a name="CUL_HM"></a>
|
||||||
|
<h3>CUL_HM</h3>
|
||||||
|
<ul>
|
||||||
|
Support for eQ-3 HomeMatic devices via the CUL. Note: The <a
|
||||||
|
href="#rfmode">rfmode </a> attribute of at least one attache CUL/CUN device
|
||||||
|
must be set to HomeMatic. Note: The protocoll used by HomeMatic devices
|
||||||
|
(BidCos, known as AskSin in the culfw) must be enabled in the culfw firmware.
|
||||||
|
This is the default for all CUN and for newer CUL (i.e. V3.0 and greater)
|
||||||
|
devices. <b>Note: This module is experimental!</b>
|
||||||
|
<br><br>
|
||||||
|
|
||||||
|
<a name="CUL_HMdefine"></a>
|
||||||
|
<b>Define</b>
|
||||||
|
<ul>
|
||||||
|
<code>define <name> CUL_HM <6-digit-hex-code></code>
|
||||||
|
<br><br>
|
||||||
|
Best to avoid this command with the <a href="#autocreate">autocreate</a>
|
||||||
|
module enabled, and the <a href="#hm_autopair">hm_autopair</a> attribute
|
||||||
|
set for the corresponding CUL device. Now set the physical device in
|
||||||
|
pairing mode (Anlernmodus), the rest should happen automatically.
|
||||||
|
</ul><br>
|
||||||
|
|
||||||
|
<a name="CUL_HMset"></a>
|
||||||
|
<b>Set</b>
|
||||||
|
<ul>
|
||||||
|
Depends on the subType of the device.
|
||||||
|
<li>switch
|
||||||
|
<ul>
|
||||||
|
<li>on - set the switch on</li>
|
||||||
|
<li>off - set the switch off</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul><br>
|
||||||
|
|
||||||
|
<a name="CUL_HMget"></a>
|
||||||
|
<b>Get</b> <ul>N/A</ul><br>
|
||||||
|
|
||||||
|
<a name="CUL_HMattr"></a>
|
||||||
|
<b>Attributes</b>
|
||||||
|
<ul>
|
||||||
|
<li><a href="#do_not_notify">do_not_notify</a></li>
|
||||||
|
<li><a href="#ignore">ignore</a></li>
|
||||||
|
<li><a href="#showtime">showtime</a></li>
|
||||||
|
<li><a href="#loglevel">loglevel</a></li>
|
||||||
|
<li><a name="#model">name</a><br>
|
||||||
|
This attribute is set automatically after a successful pairing.
|
||||||
|
It is not supposed to be set by hand.</li>
|
||||||
|
<li><a name="#subType">subType</a><br>
|
||||||
|
This attribute is set automatically after a successful pairing.
|
||||||
|
It is not supposed to be set by hand. It is necessary to be set
|
||||||
|
in order to use the set command.</li>
|
||||||
|
</ul>
|
||||||
|
<br>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
<a name="CUL_HOERMANN"></a>
|
<a name="CUL_HOERMANN"></a>
|
||||||
<h3>CUL_HOERMANN</h3>
|
<h3>CUL_HOERMANN</h3>
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
24
fhem.pl
24
fhem.pl
@@ -162,7 +162,7 @@ my $nextat; # Time when next timer will be triggered.
|
|||||||
my $intAtCnt=0;
|
my $intAtCnt=0;
|
||||||
my %duplicate; # Pool of received msg for multi-fhz/cul setups
|
my %duplicate; # Pool of received msg for multi-fhz/cul setups
|
||||||
my $duplidx=0; # helper for the above pool
|
my $duplidx=0; # helper for the above pool
|
||||||
my $cvsid = '$Id: fhem.pl,v 1.115 2010-10-27 16:51:32 rudolfkoenig Exp $';
|
my $cvsid = '$Id: fhem.pl,v 1.116 2010-11-06 19:31:38 rudolfkoenig Exp $';
|
||||||
my $namedef =
|
my $namedef =
|
||||||
"where <name> is either:\n" .
|
"where <name> is either:\n" .
|
||||||
"- a single device name\n" .
|
"- a single device name\n" .
|
||||||
@@ -1169,8 +1169,9 @@ AssignIoPort($)
|
|||||||
|
|
||||||
# Set the I/O device, search for the last compatible one.
|
# Set the I/O device, search for the last compatible one.
|
||||||
for my $p (sort { $defs{$b}{NR} <=> $defs{$a}{NR} } keys %defs) {
|
for my $p (sort { $defs{$b}{NR} <=> $defs{$a}{NR} } keys %defs) {
|
||||||
my $cl = $modules{$defs{$p}{TYPE}}{Clients};
|
my $mode = ($defs{$p}{mode} ? $defs{$p}{mode} : "");
|
||||||
my $re = $modules{$defs{$p}{TYPE}}{regexpClients};
|
my $cl = $modules{$defs{$p}{TYPE}}{"${mode}Clients"};
|
||||||
|
my $re = $modules{$defs{$p}{TYPE}}{"${mode}regexpClients"};
|
||||||
if(((defined($cl) && $cl =~ m/:$hash->{TYPE}:/) ||
|
if(((defined($cl) && $cl =~ m/:$hash->{TYPE}:/) ||
|
||||||
(defined($re) && $hash->{TYPE} =~ m/$re/)) &&
|
(defined($re) && $hash->{TYPE} =~ m/$re/)) &&
|
||||||
$defs{$p}{NAME} ne $hash->{NAME}) { # e.g. RFR
|
$defs{$p}{NAME} ne $hash->{NAME}) { # e.g. RFR
|
||||||
@@ -2157,11 +2158,12 @@ Dispatch($$$)
|
|||||||
}
|
}
|
||||||
|
|
||||||
my @found;
|
my @found;
|
||||||
|
my $mode = ($hash->{mode} ? $hash->{mode} : "");
|
||||||
foreach my $m (sort { $modules{$a}{ORDER} cmp $modules{$b}{ORDER} }
|
foreach my $m (sort { $modules{$a}{ORDER} cmp $modules{$b}{ORDER} }
|
||||||
grep {defined($modules{$_}{ORDER})} keys %modules) {
|
grep {defined($modules{$_}{ORDER})} keys %modules) {
|
||||||
|
|
||||||
my $cl = $iohash->{Clients};
|
my $cl = $iohash->{"${mode}Clients"};
|
||||||
my $re = $iohash->{regexpClients};
|
my $re = $iohash->{"${mode}regexpClients"};
|
||||||
next if(!(defined($cl) && $cl =~ m/:$m:/) ||
|
next if(!(defined($cl) && $cl =~ m/:$m:/) ||
|
||||||
(defined($re) && $m =~ m/$re/));
|
(defined($re) && $m =~ m/$re/));
|
||||||
|
|
||||||
@@ -2175,10 +2177,9 @@ Dispatch($$$)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!int(@found)) {
|
if(!int(@found)) {
|
||||||
my $h = $iohash->{MatchList};
|
my $h = $iohash->{"${mode}MatchList"};
|
||||||
if(defined($h)) {
|
if(defined($h)) {
|
||||||
foreach my $m (sort keys %{$h}) {
|
foreach my $m (sort keys %{$h}) {
|
||||||
|
|
||||||
if($dmsg =~ m/$h->{$m}/) {
|
if($dmsg =~ m/$h->{$m}/) {
|
||||||
my ($order, $mname) = split(":", $m);
|
my ($order, $mname) = split(":", $m);
|
||||||
|
|
||||||
@@ -2318,6 +2319,14 @@ ReadingsVal($$$)
|
|||||||
return $default;
|
return $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub
|
||||||
|
AttrVal($$$)
|
||||||
|
{
|
||||||
|
my ($d,$n,$default) = @_;
|
||||||
|
return $attr{$d}{$n} if(defined($attr{$d}) && defined($attr{$d}{$n}));
|
||||||
|
return $default;
|
||||||
|
}
|
||||||
|
|
||||||
sub
|
sub
|
||||||
addToAttrList($)
|
addToAttrList($)
|
||||||
{
|
{
|
||||||
@@ -2333,4 +2342,3 @@ addToAttrList($)
|
|||||||
$hash{$arg} = 1;
|
$hash{$arg} = 1;
|
||||||
$attr{global}{userattr} = join(" ", sort keys %hash);
|
$attr{global}{userattr} = join(" ", sort keys %hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user