diff --git a/fhem/FHEM/00_FHZ.pm b/fhem/FHEM/00_FHZ.pm index 324e15ebe..4fbe04008 100755 --- a/fhem/FHEM/00_FHZ.pm +++ b/fhem/FHEM/00_FHZ.pm @@ -211,8 +211,10 @@ FHZ_Define($$) return undef; } + Log 3, "FHZ opening FHZ device $dev"; my $po = new Device::SerialPort ($dev); return "Can't open $dev: $!\n" if(!$po); + Log 3, "FHZ opened FHZ device $dev"; $po->reset_error(); $po->baudrate(9600); diff --git a/fhem/FHEM/10_FS20.pm b/fhem/FHEM/10_FS20.pm index 8bb105a15..416ac3bc7 100755 --- a/fhem/FHEM/10_FS20.pm +++ b/fhem/FHEM/10_FS20.pm @@ -110,7 +110,7 @@ FS20_SetState($$$$) { my ($hash, $tim, $vt, $val) = @_; - $val = $1 if($val =~ m/^\(.*\) \d+$/); + $val = $1 if($val =~ m/^(.*) \d+$/); return "Undefined value $val" if(!defined($fs20_c2b{$val})); return undef; } diff --git a/fhem/fhem.pl b/fhem/fhem.pl index d91a1caa0..4a7d400ea 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -1303,8 +1303,8 @@ CommandSetstate($$) if($a[1] =~ m/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} /) { my @b = split(" ", $a[1], 4); - if(@b == 3) { # Compatibility mode - $b[3] = $b[2]; + if($defs{$a[0]}{TYPE} eq "FS20" && $b[2] ne "state") { # Compatibility mode + $b[3] = $b[2] . ($b[3] ? " $b[3]" : ""); $b[2] = "state"; } @@ -1312,13 +1312,13 @@ CommandSetstate($$) $ret = CallFn($a[0], "StateFn", $d, $tim, $b[2], $b[3]); return $ret if($ret); - next if($d->{READINGS}{$b[2]} && $d->{READINGS}{$b[2]}{TIME} ge $tim); + if(!$d->{READINGS}{$b[2]} || $d->{READINGS}{$b[2]}{TIME} lt $tim) { + $d->{READINGS}{$b[2]}{VAL} = $b[3]; + $d->{READINGS}{$b[2]}{TIME} = $tim; - $d->{READINGS}{$b[2]}{VAL} = $b[3]; - $d->{READINGS}{$b[2]}{TIME} = $tim; - - $oldvalue{$a[0]}{TIME} = $tim; - $oldvalue{$a[0]}{VAL} = $b[2]; + $oldvalue{$a[0]}{TIME} = $tim; + $oldvalue{$a[0]}{VAL} = $b[2]; + } } else { $d->{STATE} = $a[1];