2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

10_ZWave.pm: bugfix for multichannel devices, might affect device numbering

(Forum #50176)


git-svn-id: https://svn.fhem.de/fhem/trunk@12593 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2016-11-16 17:17:05 +00:00
parent 8678ed686e
commit 66a261ebbe
2 changed files with 9 additions and 6 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- bugfix: 10_ZWave: possible changes for multichannel devices (Forum #50176)
- new: 39_siri.pm: configuration of fhem/siri integration
39_alexa.pm: configuration of fhem/alexa integration
- feature: 30_pilight_contact: new module to handle pilight contact sensors

View File

@ -948,7 +948,7 @@ ZWave_Cmd($$@)
if($id =~ m/(..)(..)/) { # Multi-Channel, encapsulate
my ($baseId,$ch) = ($1, $2);
$id = $baseId;
$cmdFmt = "0d01$ch$cmdId$cmdFmt";
$cmdFmt = "0d00$ch$cmdId$cmdFmt";
$cmdId = "60"; # MULTI_CHANNEL
$baseHash = $modules{ZWave}{defptr}{"$hash->{homeId} $baseId"};
$baseClasses = AttrVal($baseHash->{NAME}, "classes", "");
@ -2129,7 +2129,7 @@ ZWave_mcCapability($$)
my $homeId = $iodev->{homeId};
my @l = grep /../, split(/(..)/, lc($caps));
my $chid = shift(@l);
my $chid = sprintf("%02x", hex(shift(@l)) & 0x7f); # Forum #50176
my $id = $hash->{nodeIdHex};
my @classes;
@ -2140,7 +2140,7 @@ ZWave_mcCapability($$)
}
return "mcCapability_$chid:no classes" if(!@classes);
if(!$modules{ZWave}{defptr}{"$homeId $id$chid"}) {
if($chid ne "00" && !$modules{ZWave}{defptr}{"$homeId $id$chid"}) {
my $lid = hex("$id$chid");
my $lcaps = substr($caps, 6);
$id = hex($id);
@ -4372,9 +4372,11 @@ ZWave_Parse($$@)
$arg = sprintf("%02x$2", length($2)/2);
}
if($arg =~ /^..600d(..)(..)(.*)/) { # MULTI_CHANNEL CMD_ENCAP, V2
$ep = ($1 ne "00" ? $1 : $2);
$baseHash = $modules{ZWave}{defptr}{"$homeId $id"};
$id = "$id$ep";
$ep = sprintf("%02x", hex($1) & 0x7f); # Forum #50176
if($ep ne "00") {
$baseHash = $modules{ZWave}{defptr}{"$homeId $id"};
$id = "$id$ep";
}
$arg = sprintf("%02x$3", length($3)/2);
}
$hash = $modules{ZWave}{defptr}{"$homeId $id"};