diff --git a/fhem/CHANGED b/fhem/CHANGED index bcf1a2273..afe6f6c29 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -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: 74_XiaomiBTLESens: fix corrupt character for temperature - bugfix: 74_XiaomiBTLESens: fix humidity bug than temperature is lower 10 - feature: 88_xs1Bridge: automatic Logfile after define | feature extension - changed: 98_weekprofile: send values for on/off instead of "on"/"off" diff --git a/fhem/FHEM/74_XiaomiBTLESens.pm b/fhem/FHEM/74_XiaomiBTLESens.pm index 665afa652..c4a34afd1 100644 --- a/fhem/FHEM/74_XiaomiBTLESens.pm +++ b/fhem/FHEM/74_XiaomiBTLESens.pm @@ -47,7 +47,7 @@ use JSON; use Blocking; -my $version = "2.0.8"; +my $version = "2.0.9"; @@ -409,14 +409,14 @@ sub XiaomiBTLESens_CreateParamGatttool($@) { Log3 $name, 4, "XiaomiBTLESens ($name) - Run CreateParamGatttool with mod: $mod"; if( $mod eq 'read' ) { - $hash->{helper}{RUNNING_PID} = BlockingCall("XiaomiBTLESens_ExecGatttool_Run", $name."|".$mac."|".$mod."|".$handle, "XiaomiBTLESens_ExecGatttool_Done", 60, "XiaomiBTLESens_ExecGatttool_Aborted", $hash) unless( exists($hash->{helper}{RUNNING_PID}) ); + $hash->{helper}{RUNNING_PID} = BlockingCall("XiaomiBTLESens_ExecGatttool_Run", $name."|".$mac."|".$mod."|".$handle, "XiaomiBTLESens_ExecGatttool_Done", 90, "XiaomiBTLESens_ExecGatttool_Aborted", $hash) unless( exists($hash->{helper}{RUNNING_PID}) ); readingsSingleUpdate($hash,"state","read sensor data",1); Log3 $name, 5, "XiaomiBTLESens ($name) - Read XiaomiBTLESens_ExecGatttool_Run $name|$mac|$mod|$handle"; } elsif( $mod eq 'write' ) { - $hash->{helper}{RUNNING_PID} = BlockingCall("XiaomiBTLESens_ExecGatttool_Run", $name."|".$mac."|".$mod."|".$handle."|".$value."|".$XiaomiModels{AttrVal($name,'model','')}{wdatalisten}, "XiaomiBTLESens_ExecGatttool_Done", 60, "XiaomiBTLESens_ExecGatttool_Aborted", $hash) unless( exists($hash->{helper}{RUNNING_PID}) ); + $hash->{helper}{RUNNING_PID} = BlockingCall("XiaomiBTLESens_ExecGatttool_Run", $name."|".$mac."|".$mod."|".$handle."|".$value."|".$XiaomiModels{AttrVal($name,'model','')}{wdatalisten}, "XiaomiBTLESens_ExecGatttool_Done", 90, "XiaomiBTLESens_ExecGatttool_Aborted", $hash) unless( exists($hash->{helper}{RUNNING_PID}) ); readingsSingleUpdate($hash,"state","write sensor data",1); @@ -448,7 +448,7 @@ sub XiaomiBTLESens_ExecGatttool_Run($) { my $hci = AttrVal($name,"hciDevice","hci0"); $cmd = "ssh $sshHost '" if($sshHost ne 'none'); - $cmd .= "timeout 5 " if($listen); + $cmd .= "timeout 10 " if($listen); $cmd .= "gatttool -i $hci -b $mac "; $cmd .= "--char-read -a $handle" if($gattCmd eq 'read'); $cmd .= "--char-write-req -a $handle -n $value" if($gattCmd eq 'write'); @@ -707,6 +707,9 @@ sub XiaomiBTLESens_ThermoHygroSensHandle0x10($$) { Log3 $name, 4, "XiaomiBTLESens ($name) - Thermo/Hygro Sens Handle0x10"; + return XiaomiBTLESens_stateRequest($hash) + unless($notification =~ /^([0-9a-f]{2}(\s?))*$/); + my @numberOfHex = split(' ',$notification); $notification =~ s/\s+//g;