2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-13 17:26:34 +00:00

10_EnOcean: subType switch changed

git-svn-id: https://svn.fhem.de/fhem/trunk@5543 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
klaus-schauer 2014-04-17 12:44:21 +00:00
parent f0c7aa2fc0
commit 2f1c193fee

View File

@ -1,5 +1,13 @@
############################################## ##############################################
# $Id$ # $Id$
# 2014-04-16 klaus.schauer
# Added new EEP 2.1 profiles:
# Added new EEP 2.5 profiles:
# Added new EEP 2.6 profiles:
# EnOcean_Notify():
# EnOcean_Attr():
# subType switch: parse logic improved
# commandref: further explanations added
package main; package main;
@ -2254,58 +2262,46 @@ EnOcean_Parse($$)
# Theoretically there can be a released event with some of the A0, BI # Theoretically there can be a released event with some of the A0, BI
# pins set, but with the plastic cover on this wont happen. # pins set, but with the plastic cover on this wont happen.
$msg = $EnO_ptm200btn[($db[0] & 0xE0) >> 5]; $msg = $EnO_ptm200btn[($db[0] & 0xE0) >> 5];
$msg .= "," . $EnO_ptm200btn[($db[0] & 0x0E) >> 1] if ($db[0] & 1); $msg .= " " . $EnO_ptm200btn[($db[0] & 0x0E) >> 1] if ($db[0] & 1);
$msg .= " released" if (!($db[0] & 0x10)); $msg .= " released" if (!($db[0] & 0x10));
push @event, "3:buttons:" . ($db[0] & 0x10 ? "pressed" : "released"); push @event, "3:buttons:" . ($db[0] & 0x10 ? "pressed" : "released");
if ($msg =~ m/A0$/) { if ($msg =~ m/A0/) {push @event, "3:channelA:A0";}
push @event, "3:channelA:A0"; if ($msg =~ m/AI/) {push @event, "3:channelA:AI";}
} elsif ($msg =~ m/AI$/) { if ($msg =~ m/B0/) {push @event, "3:channelB:B0";}
push @event, "3:channelA:AI"; if ($msg =~ m/BI/) {push @event, "3:channelB:BI";}
} elsif ($msg =~ m/B0$/) { if ($msg =~ m/C0/) {push @event, "3:channelC:C0";}
push @event, "3:channelB:B0"; if ($msg =~ m/CI/) {push @event, "3:channelC:CI";}
} elsif ($msg =~ m/BI$/) { if ($msg =~ m/D0/) {push @event, "3:channelD:D0";}
push @event, "3:channelB:BI"; if ($msg =~ m/DI/) {push @event, "3:channelD:DI";}
} elsif ($msg =~ m/C0$/) {
push @event, "3:channelC:C0";
} elsif ($msg =~ m/CI$/) {
push @event, "3:channelC:CI";
} elsif ($msg =~ m/D0$/) {
push @event, "3:channelD:D0";
} elsif ($msg =~ m/DI$/) {
push @event, "3:channelD:DI";
}
} else { } else {
if ($db[0] == 112) { if ($db[0] == 112) {
# Key Card, not tested # Key Card, not tested
$msg = "keycard_inserted"; $msg = "keycard_inserted";
} elsif ($db[0] & 0xC0) { } elsif ($db[0] & 0xC0) {
# Only a Mechanical Handle is setting these bits when nu=0 # Only a Mechanical Handle is setting these bits when NU = 0
$msg = "closed" if ($db[0] == 0xF0); $msg = "closed" if ($db[0] == 0xF0);
$msg = "open" if ($db[0] == 0xE0); $msg = "open" if ($db[0] == 0xE0);
$msg = "tilted" if ($db[0] == 0xD0); $msg = "tilted" if ($db[0] == 0xD0);
$msg = "open_from_tilted" if ($db[0] == 0xC0); $msg = "open_from_tilted" if ($db[0] == 0xC0);
} elsif ($st eq "keycard") {
} else {
if($st eq "keycard") {
$msg = "keycard_removed"; $msg = "keycard_removed";
} } else {
else {
$msg = (($db[0] & 0x10) ? "pressed" : "released"); $msg = (($db[0] & 0x10) ? "pressed" : "released");
push @event, "3:buttons:" . ($db[0] & 0x10 ? "pressed" : "released");
} }
} }
}
# released events are disturbing when using a remote, since it overwrites # released events are disturbing when using a remote, since it overwrites
# the "real" state immediately. In the case of an Eltako FSB14, FSB61 ... # the "real" state immediately. In the case of an Eltako FSB14, FSB61 ...
# the state should remain released. (by Thomas) # the state should remain released. (by Thomas)
$event = "buttons" if ($msg =~ m/released$/ && if ($msg =~ m/released$/ &&
AttrVal($name, "sensorMode", "switch") ne "pushbutton" &&
$model ne "FT55" && $model ne "FSB14" && $model ne "FT55" && $model ne "FSB14" &&
$model ne "FSB61" && $model ne "FSB70" && $model ne "FSB61" && $model ne "FSB70" &&
$model ne "FSM12" && $model ne "FSM61" && $model ne "FSM12" && $model ne "FSM61" &&
$model ne "FTS12" && $model ne "FTS12") {
AttrVal($name, "sensorMode", "switch") ne "pushbutton"); $event = "buttons";
$msg = "released";
}
} }
push @event, "3:$event:$msg"; push @event, "3:$event:$msg";
@ -4951,10 +4947,10 @@ EnOcean_Undef($$)
<li>CI</li> <li>CI</li>
<li>D0</li> <li>D0</li>
<li>DI</li> <li>DI</li>
<li>&lt;BtnX,BtnY&gt; First and second action where BtnX and BtnY is <li>&lt;BtnX BtnY&gt; First and second action where BtnX and BtnY is
one of the above, e.g. A0,BI or D0,CI</li> one of the above, e.g. A0 BI or D0 CI</li>
<li>buttons: pressed|released</li> <li>buttons: pressed|released</li>
<li>state: &lt;BtnX&gt; released</li> <li>state: &lt;BtnX&gt; [&lt;BtnY&gt;]</li>
</ul><br> </ul><br>
Switches (remote controls) or actors with more than one Switches (remote controls) or actors with more than one
(pair) keys may have multiple channels e. g. B0/BI, A0/AI with one (pair) keys may have multiple channels e. g. B0/BI, A0/AI with one
@ -4969,13 +4965,19 @@ EnOcean_Undef($$)
<li>AI</li> <li>AI</li>
<li>B0</li> <li>B0</li>
<li>BI</li> <li>BI</li>
<li>C0</li>
<li>CI</li>
<li>D0</li>
<li>DI</li>
<li>&lt;BtnX BtnY&gt; First and second action where BtnX and BtnY is
one of the above, e.g. A0 BI or D0 CI</li>
<li>released</li> <li>released</li>
<li>buttons: pressed|released</li> <li>buttons: pressed|released</li>
<li>state: A0|AI|B0|BI|released</li> <li>state: &lt;BtnX&gt; [&lt;BtnY&gt;] [released]</li>
</ul><br> </ul><br>
The status of the device may become "released", this The status of the device may become "released", this
is not the case for a normal switch.<br> is not the case for a normal switch.<br>
Set attr model to FT55|FSM12|FSM61|FTS12 manually. Set attr model to FT55|FSM12|FSM61|FTS12 or attr sensorMode to pushbutton manually.
</li> </li>
<br><br> <br><br>