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

10_ZWave.pm: add routeInfo patch from krikan (Forum #120800)

git-svn-id: https://svn.fhem.de/fhem/trunk@24407 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2021-05-10 08:48:46 +00:00
parent 2c0d9c394d
commit 0c82f3084c
2 changed files with 31 additions and 3 deletions

View File

@ -2385,18 +2385,24 @@ FW_fileNameToPath($)
my $cfgFileName = $1;
if($name eq $cfgFileName) {
return $attr{global}{configfile};
} elsif($name =~ m/.*(js|css|_defs.svg)$/) {
return "$FW_cssdir/$name";
} elsif($name =~ m/.*(png|svg)$/) {
my $d="";
map { $d = $_ if(!$d && -d "$FW_icondir/$_") } @FW_iconDirs;
return "$FW_icondir/$d/$name";
} elsif($name =~ m/.*gplot$/) {
return "$FW_gplotdir/$name";
} elsif($name =~ m/.*log$/) {
return Logdir()."/$name";
} else {
return "$MW_dir/$name";
}
}
@ -2924,6 +2930,7 @@ FW_iconName($)
my $name = $oname;
$name =~ s/@.*//;
foreach my $pe (@FW_iconDirs) {
Log 1, "iconName: $pe / $name" if($pe && $FW_icons{$pe} && $FW_icons{$pe}{$name});
return $oname if($pe && $FW_icons{$pe} && $FW_icons{$pe}{$name});
}
return undef;

View File

@ -748,6 +748,7 @@ ZWave_Initialize($)
dummy:1,0
eventForRaw
extendedAlarmReadings:0,1,2
generateRouteInfoEvents:1,0
ignore:1,0
ignoreDupMsg:1,0
neighborListPos
@ -4888,7 +4889,13 @@ ZWAVE_parseRouteInfo($$$)
my $ackCh = hex(substr($arg,16,2));
my $lastCh = hex(substr($arg,18,2));
my $scheme = hex(substr($arg,20,2));
my @schemeEncoding = qw( Idle DirectTransmission ApplicationStaticRoute
LastWorkingRoute NextToLastWorkingRoute
ReturnRoutOrControllerAutoRoute DirectResort
ExplorerFrame );
my $scheme= $schemeEncoding[hex(substr($arg,20,2))];
my $homeId = $hash->{homeId};
my @list2;
@ -4907,12 +4914,26 @@ ZWAVE_parseRouteInfo($$$)
my $tries = hex(substr($arg,32,2));
my $lastfailed = hex(substr($arg,34,4));
my @list3;
for(my $off=34; $off<=38; $off+=2) {
my $dec = hex(substr($arg, $off, 2));
my $hex = sprintf("%02x", $dec);
my $h = ($hex eq $hash->{nodeIdHex} ?
$hash : $modules{ZWave}{defptr}{"$homeId $hex"});
push @list3, ($h ? $h->{NAME} : "UNKNOWN_$dec") if($dec);
}
$lastfailed=join(" ", @list3);
my $timeToCb = hex(substr($arg,0,4))/100;
my $msg = "timeToCb:$timeToCb repeaters:$repeaters $rssi ".
"ackCh:$ackCh lastCh:$lastCh scheme:$scheme ".
"rep:$routefor routeTries:$tries lastFailed:$lastfailed";
Log3 $ioName, 5, $msg;
readingsSingleUpdate($hash, "routeInfo", $msg, 1);
Log3 $ioName, 5, "$hash->{NAME}: $msg";
if(AttrVal($hash->{NAME}, "generateRouteInfoEvents", 0)) {
DoTrigger($hash->{NAME}, $msg);
}
readingsSingleUpdate($hash, "routeInfo", $msg, 0);
}