mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-04 11:26:55 +00:00
10_EnOcean:
# SenderID/DestinationID (DEF, subDef), Manufacturer ID (manufID) are normalized to uppercase characters # subType raw: reading state corrected # commandref: further explanations added git-svn-id: https://svn.fhem.de/fhem/trunk@5158 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
a07d4c0e7d
commit
83df11e9e7
@ -297,7 +297,7 @@ EnOcean_Define($$)
|
|||||||
my @a = split("[ \t][ \t]*", $def);
|
my @a = split("[ \t][ \t]*", $def);
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
return "wrong syntax: define <name> EnOcean 8-digit-hex-code"
|
return "wrong syntax: define <name> EnOcean 8-digit-hex-code"
|
||||||
if(int(@a) < 3 || int(@a) > 4 || $a[2] !~ m/^[A-F0-9]{8}$/i);
|
if(int(@a) < 3 || int(@a) > 4 || $a[2] !~ m/^[A-Fa-f0-9]{8}$/i);
|
||||||
$modules{EnOcean}{defptr}{uc($a[2])} = $hash;
|
$modules{EnOcean}{defptr}{uc($a[2])} = $hash;
|
||||||
AssignIoPort($hash);
|
AssignIoPort($hash);
|
||||||
# Help FHEMWEB split up devices
|
# Help FHEMWEB split up devices
|
||||||
@ -327,14 +327,15 @@ EnOcean_Get ($@)
|
|||||||
} elsif ($destinationID !~ m/^[\dA-F]{8}$/) {
|
} elsif ($destinationID !~ m/^[\dA-F]{8}$/) {
|
||||||
return "DestinationID $destinationID wrong, choose <8-digit-hex-code>.";
|
return "DestinationID $destinationID wrong, choose <8-digit-hex-code>.";
|
||||||
}
|
}
|
||||||
my $manufID = AttrVal($name, "manufID", "");
|
$destinationID = uc($destinationID);
|
||||||
|
my $manufID = uc(AttrVal($name, "manufID", ""));
|
||||||
my $model = AttrVal($name, "model", "");
|
my $model = AttrVal($name, "model", "");
|
||||||
my $rorg;
|
my $rorg;
|
||||||
my $status = "00";
|
my $status = "00";
|
||||||
my $st = AttrVal($name, "subType", "");
|
my $st = AttrVal($name, "subType", "");
|
||||||
my $stSet = AttrVal($name, "subTypeSet", undef);
|
my $stSet = AttrVal($name, "subTypeSet", undef);
|
||||||
if (defined $stSet) {$st = $stSet;}
|
if (defined $stSet) {$st = $stSet;}
|
||||||
my $subDef = AttrVal($name, "subDef", $hash->{DEF});
|
my $subDef = uc(AttrVal($name, "subDef", $hash->{DEF}));
|
||||||
if ($subDef !~ m/^[\dA-F]{8}$/) {return "SenderID $subDef wrong, choose <8-digit-hex-code>.";}
|
if ($subDef !~ m/^[\dA-F]{8}$/) {return "SenderID $subDef wrong, choose <8-digit-hex-code>.";}
|
||||||
my $tn = TimeNow();
|
my $tn = TimeNow();
|
||||||
shift @a;
|
shift @a;
|
||||||
@ -404,10 +405,11 @@ EnOcean_Set($@)
|
|||||||
$destinationID = "FFFFFFFF";
|
$destinationID = "FFFFFFFF";
|
||||||
} elsif ($destinationID eq "unicast") {
|
} elsif ($destinationID eq "unicast") {
|
||||||
$destinationID = $hash->{DEF};
|
$destinationID = $hash->{DEF};
|
||||||
} elsif ($destinationID !~ m/^[\dA-F]{8}$/) {
|
} elsif ($destinationID !~ m/^[\dA-Fa-f]{8}$/) {
|
||||||
return "DestinationID $destinationID wrong, choose <8-digit-hex-code>.";
|
return "DestinationID $destinationID wrong, choose <8-digit-hex-code>.";
|
||||||
}
|
}
|
||||||
my $manufID = AttrVal($name, "manufID", "");
|
$destinationID = uc($destinationID);
|
||||||
|
my $manufID = uc(AttrVal($name, "manufID", ""));
|
||||||
my $model = AttrVal($name, "model", "");
|
my $model = AttrVal($name, "model", "");
|
||||||
my $rorg;
|
my $rorg;
|
||||||
my $sendCmd = "yes";
|
my $sendCmd = "yes";
|
||||||
@ -415,7 +417,7 @@ EnOcean_Set($@)
|
|||||||
my $st = AttrVal($name, "subType", "");
|
my $st = AttrVal($name, "subType", "");
|
||||||
my $stSet = AttrVal($name, "subTypeSet", undef);
|
my $stSet = AttrVal($name, "subTypeSet", undef);
|
||||||
if (defined $stSet) {$st = $stSet;}
|
if (defined $stSet) {$st = $stSet;}
|
||||||
my $subDef = AttrVal($name, "subDef", $hash->{DEF});
|
my $subDef = uc(AttrVal($name, "subDef", $hash->{DEF}));
|
||||||
if ($subDef !~ m/^[\dA-F]{8}$/) {return "SenderID $subDef wrong, choose <8-digit-hex-code>.";}
|
if ($subDef !~ m/^[\dA-F]{8}$/) {return "SenderID $subDef wrong, choose <8-digit-hex-code>.";}
|
||||||
my $switchMode = AttrVal($name, "switchMode", "switch");
|
my $switchMode = AttrVal($name, "switchMode", "switch");
|
||||||
my $tn = TimeNow();
|
my $tn = TimeNow();
|
||||||
@ -1922,40 +1924,40 @@ EnOcean_Set($@)
|
|||||||
# sent raw data
|
# sent raw data
|
||||||
if ($cmd eq "4BS"){
|
if ($cmd eq "4BS"){
|
||||||
# 4BS Telegram
|
# 4BS Telegram
|
||||||
if ($a[1] && $a[1] =~ m/^[\dA-F]{8}$/) {
|
if ($a[1] && $a[1] =~ m/^[\dA-Fa-f]{8}$/) {
|
||||||
$data = $a[1];
|
$data = uc($a[1]);
|
||||||
$rorg = "A5";
|
$rorg = "A5";
|
||||||
} else {
|
} else {
|
||||||
return "Wrong parameter, choose 4BS <data 4 Byte hex> [status 1 Byte hex]";
|
return "Wrong parameter, choose 4BS <data 4 Byte hex> [status 1 Byte hex]";
|
||||||
}
|
}
|
||||||
} elsif ($cmd eq "1BS") {
|
} elsif ($cmd eq "1BS") {
|
||||||
# 1BS Telegram
|
# 1BS Telegram
|
||||||
if ($a[1] && $a[1] =~ m/^[\dA-F]{2}$/) {
|
if ($a[1] && $a[1] =~ m/^[\dA-Fa-f]{2}$/) {
|
||||||
$data = $a[1];
|
$data = uc($a[1]);
|
||||||
$rorg = "D5";
|
$rorg = "D5";
|
||||||
} else {
|
} else {
|
||||||
return "Wrong parameter, choose 1BS <data 1 Byte hex> [status 1 Byte hex]";
|
return "Wrong parameter, choose 1BS <data 1 Byte hex> [status 1 Byte hex]";
|
||||||
}
|
}
|
||||||
} elsif ($cmd eq "RPS") {
|
} elsif ($cmd eq "RPS") {
|
||||||
# RPS Telegram
|
# RPS Telegram
|
||||||
if ($a[1] && $a[1] =~ m/^[\dA-F]{2}$/) {
|
if ($a[1] && $a[1] =~ m/^[\dA-Fa-f]{2}$/) {
|
||||||
$data = $a[1];
|
$data = uc($a[1]);
|
||||||
$rorg = "F6";
|
$rorg = "F6";
|
||||||
} else {
|
} else {
|
||||||
return "Wrong parameter, choose RPS <data 1 Byte hex> [status 1 Byte hex]";
|
return "Wrong parameter, choose RPS <data 1 Byte hex> [status 1 Byte hex]";
|
||||||
}
|
}
|
||||||
} elsif ($cmd eq "MSC") {
|
} elsif ($cmd eq "MSC") {
|
||||||
# MSC Telegram
|
# MSC Telegram
|
||||||
if ($a[1] && $a[1] =~ m/^[\dA-F]{2,28}$/ && !(length($a[1]) % 2)) {
|
if ($a[1] && $a[1] =~ m/^[\dA-Fa-f]{2,28}$/ && !(length($a[1]) % 2)) {
|
||||||
$data = $a[1];
|
$data = uc($a[1]);
|
||||||
$rorg = "D1";
|
$rorg = "D1";
|
||||||
} else {
|
} else {
|
||||||
return "Wrong parameter, choose MSC <data 1 ... 14 Byte hex> [status 1 Byte hex]";
|
return "Wrong parameter, choose MSC <data 1 ... 14 Byte hex> [status 1 Byte hex]";
|
||||||
}
|
}
|
||||||
} elsif ($cmd eq "UTE") {
|
} elsif ($cmd eq "UTE") {
|
||||||
# UTE Telegram
|
# UTE Telegram
|
||||||
if ($a[1] && $a[1] =~ m/^[\dA-F]{14}$/) {
|
if ($a[1] && $a[1] =~ m/^[\dA-Fa-f]{14}$/) {
|
||||||
$data = $a[1];
|
$data = uc($a[1]);
|
||||||
$rorg = "D4";
|
$rorg = "D4";
|
||||||
} else {
|
} else {
|
||||||
return "Wrong parameter, choose UTE <data 7 Byte hex> [status 1 Byte hex]";
|
return "Wrong parameter, choose UTE <data 7 Byte hex> [status 1 Byte hex]";
|
||||||
@ -1963,8 +1965,8 @@ EnOcean_Set($@)
|
|||||||
|
|
||||||
} elsif ($cmd eq "VLD") {
|
} elsif ($cmd eq "VLD") {
|
||||||
# VLD Telegram
|
# VLD Telegram
|
||||||
if ($a[1] && $a[1] =~ m/^[\dA-F]{2,28}$/ && !(length($a[1]) % 2)) {
|
if ($a[1] && $a[1] =~ m/^[\dA-Fa-f]{2,28}$/ && !(length($a[1]) % 2)) {
|
||||||
$data = $a[1];
|
$data = uc($a[1]);
|
||||||
$rorg = "D2";
|
$rorg = "D2";
|
||||||
} else {
|
} else {
|
||||||
return "Wrong parameter, choose VLD <data 1 ... 14 Byte hex> [status 1 Byte hex]";
|
return "Wrong parameter, choose VLD <data 1 ... 14 Byte hex> [status 1 Byte hex]";
|
||||||
@ -1974,11 +1976,11 @@ EnOcean_Set($@)
|
|||||||
return "Unknown argument $cmd, choose one of 1BS 4BS MSC RPS UTE VLD test";
|
return "Unknown argument $cmd, choose one of 1BS 4BS MSC RPS UTE VLD test";
|
||||||
}
|
}
|
||||||
if ($a[2]) {
|
if ($a[2]) {
|
||||||
if ($a[2] !~ m/^[\dA-F]{2}$/) {
|
if ($a[2] !~ m/^[\dA-Fa-f]{2}$/) {
|
||||||
return "Wrong status parameter, choose $cmd $a[1] [status 1 Byte hex]";
|
return "Wrong status parameter, choose $cmd $a[1] [status 1 Byte hex]";
|
||||||
}
|
}
|
||||||
$status = $a[2];
|
$status = uc($a[2]);
|
||||||
shift(@a);
|
splice(@a,2,1);
|
||||||
}
|
}
|
||||||
$updateState = 0;
|
$updateState = 0;
|
||||||
readingsSingleUpdate($hash, "RORG", $cmd, 1);
|
readingsSingleUpdate($hash, "RORG", $cmd, 1);
|
||||||
@ -2131,7 +2133,7 @@ EnOcean_Parse($$)
|
|||||||
}
|
}
|
||||||
my @event;
|
my @event;
|
||||||
my $model = AttrVal($name, "model", "");
|
my $model = AttrVal($name, "model", "");
|
||||||
my $manufID = AttrVal($name, "manufID", "");
|
my $manufID = uc(AttrVal($name, "manufID", ""));
|
||||||
my $st = AttrVal($name, "subType", "");
|
my $st = AttrVal($name, "subType", "");
|
||||||
Log3 $name, 5, "EnOcean $name PacketType:$packetType RORG:$rorg DATA:$data ID:$id STATUS:$status";
|
Log3 $name, 5, "EnOcean $name PacketType:$packetType RORG:$rorg DATA:$data ID:$id STATUS:$status";
|
||||||
|
|
||||||
@ -4938,7 +4940,7 @@ EnOcean_Undef($$)
|
|||||||
|
|
||||||
<li>Single Input Contact, Door/Window Contact<br>
|
<li>Single Input Contact, Door/Window Contact<br>
|
||||||
1BS Telegram (EEP D5-00-01)<br>
|
1BS Telegram (EEP D5-00-01)<br>
|
||||||
[Eltako FTK, Peha D 450 FU, STM-250, BSC ?]
|
[EnOcean STM 320, STM 329, STM 250, Eltako FTK, Peha D 450 FU, STM-250, BSC ?]
|
||||||
<ul>
|
<ul>
|
||||||
<li>closed</li>
|
<li>closed</li>
|
||||||
<li>open</li>
|
<li>open</li>
|
||||||
@ -4949,7 +4951,7 @@ EnOcean_Undef($$)
|
|||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<li>Temperature Sensors with with different ranges (EEP A5-02-01 ... A5-02-30)<br>
|
<li>Temperature Sensors with with different ranges (EEP A5-02-01 ... A5-02-30)<br>
|
||||||
[Eltako FTF55, Thermokon SR65 ...]<br>
|
[EnOcean STM 330, Eltako FTF55, Thermokon SR65 ...]<br>
|
||||||
<ul>
|
<ul>
|
||||||
<li>t/°C</li>
|
<li>t/°C</li>
|
||||||
<li>temperature: t/°C (Sensor Range: t = <t min> °C ... <t max> °C)</li>
|
<li>temperature: t/°C (Sensor Range: t = <t min> °C ... <t max> °C)</li>
|
||||||
@ -5020,7 +5022,7 @@ EnOcean_Undef($$)
|
|||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<li>Occupancy Sensor (EEP A5-07-01, A5-07-02)<br>
|
<li>Occupancy Sensor (EEP A5-07-01, A5-07-02)<br>
|
||||||
[untested]<br>
|
[EnOcean EOSW, untested]<br>
|
||||||
<ul>
|
<ul>
|
||||||
<li>on|off</li>
|
<li>on|off</li>
|
||||||
<li>errorCode: 251 ... 255</li>
|
<li>errorCode: 251 ... 255</li>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user