2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-06 12:18:46 +00:00

30_DUOFERN: fix simultaneously events from weather sensor

git-svn-id: https://svn.fhem.de/fhem/trunk@12089 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
telekatz 2016-08-29 19:25:14 +00:00
parent 03184659c2
commit 32600f8184

View File

@ -1217,40 +1217,46 @@ DUOFERN_Parse($$)
} }
my $chan = substr($msg, $sensorMsg{$id}{chan}*2 + 2 , 2); my $chan = substr($msg, $sensorMsg{$id}{chan}*2 + 2 , 2);
my @chans;
if ($sensorMsg{$id}{chan} == 5) { if ($sensorMsg{$id}{chan} == 5) {
for(my $x=0; $x<5; $x++) { for(my $x=0; $x<5; $x++) {
if((0x01<<$x) & hex($chan)) { if((0x01<<$x) & hex($chan)) {
$chan = $x+1; push(@chans, $x+1);
last;
} }
} }
} else {
push(@chans, $chan);
} }
if($id =~ m/..(1A|18|19|01|02|03)/) { foreach (@chans) {
if(($id =~ m/..1A/) || ($id =~ m/0E../) || ($code =~ m/^(A0|A2)..../)) { $chan = $_;
readingsSingleUpdate($hash, "state", $sensorMsg{$id}{state}.".".$chan, 1); if($id =~ m/..(1A|18|19|01|02|03)/) {
} else { if(($id =~ m/..1A/) || ($id =~ m/0E../) || ($code =~ m/^(A0|A2)..../)) {
readingsSingleUpdate($hash, "state", $sensorMsg{$id}{state}, 1); readingsSingleUpdate($hash, "state", $sensorMsg{$id}{state}.".".$chan, 1);
} } else {
readingsSingleUpdate($hash, "channel$chan", $sensorMsg{$id}{name}, 1); readingsSingleUpdate($hash, "state", $sensorMsg{$id}{state}, 1);
} else { }
if($code =~ m/^69.*/) { readingsSingleUpdate($hash, "channel$chan", $sensorMsg{$id}{name}, 1);
$def01 = $modules{DUOFERN}{defptr}{$code."00"}; } else {
if(!$def01) { if($code =~ m/^69.*/) {
DoTrigger("global","UNDEFINED DUOFERN_$code"."_sensor DUOFERN $code"."00");
$def01 = $modules{DUOFERN}{defptr}{$code."00"}; $def01 = $modules{DUOFERN}{defptr}{$code."00"};
if(!$def01) {
DoTrigger("global","UNDEFINED DUOFERN_$code"."_sensor DUOFERN $code"."00");
$def01 = $modules{DUOFERN}{defptr}{$code."00"};
}
$hash = $def01;
}
if(($code !~ m/^69.*/) || ($id =~ m/..(11|12)/)) {
$chan="";
} }
$hash = $def01; if($code =~ m/^(A5|AA|AB)..../) {
} readingsSingleUpdate($hash, "state", $sensorMsg{$id}{state}, 1);
if(($code !~ m/^69.*/) || ($id =~ m/..(11|12)/)) { }
$chan="";
} readingsSingleUpdate($hash, "event", $sensorMsg{$id}{name}.$chan, 1);
if($code =~ m/^(A5|AA|AB)..../) { DoTrigger($hash->{NAME},$sensorMsg{$id}{name}.$chan);
readingsSingleUpdate($hash, "state", $sensorMsg{$id}{state}, 1); }
} }
readingsSingleUpdate($hash, "event", $sensorMsg{$id}{name}.$chan, 1);
DoTrigger($hash->{NAME},$sensorMsg{$id}{name}.$chan);
}
#Umweltsensor Wetter #Umweltsensor Wetter
} elsif ($msg =~ m/0F011322.{36}/) { } elsif ($msg =~ m/0F011322.{36}/) {
@ -1497,6 +1503,8 @@ DUOFERN_StatusTimeout($)
1; 1;
=pod =pod
=item summary controls Rademacher DuoFern devices
=item summary_DE steuert Rademacher DuoFern Ger&auml;te
=begin html =begin html
<a name="DUOFERN"></a> <a name="DUOFERN"></a>