FIX reading temperatur& humidity

obsolet reading temperatureP deleted, humidity and temperatur in user
friendly format
This commit is contained in:
2017-03-03 14:49:44 +01:00
parent 8f98a8db63
commit 2c35b66ac9

View File

@@ -65,12 +65,12 @@ sub XiaomiSmartHome_Device_Parse($$) {
}
elsif($status[1] eq 'temperature'){
Log3 $name, 3, "$name: Sensor: " . $hash->{MODEL} . " SID: " . $sid . " Temperature: " . $status[3];
readingsSingleUpdate($hash, "temperature", "$status[3]", 1 );
$status[3] =~ s/(^[-+]?\d+?(?=(?>(?:\d{2})+)(?!\d))|\G\d{2}(?=\d))/$1./g;
readingsSingleUpdate($hash, "temperatureP", "$status[3]", 1 );
readingsSingleUpdate($hash, "temperature", "$status[3]", 1 );
}
elsif($status[1] eq 'humidity'){
Log3 $name, 3, "$name: Sensor: " . $hash->{MODEL} . " SID: " . $sid . " Humidity: " . $status[3];
$status[3] =~ s/(^[-+]?\d+?(?=(?>(?:\d{2})+)(?!\d))|\G\d{2}(?=\d))/$1./g;
readingsSingleUpdate($hash, "humidity", "$status[3]", 1 );
}
XiaomiSmartHome_Device_update($hash);