Add: New Reading no_close
Add: Reading no_close for magnet sensors. the gateway report when the sensor is longer opened, 60, 120, 180, 300 seconds.
This commit is contained in:
@@ -25,7 +25,7 @@ package main;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $version = "0.06";
|
||||
my $version = "0.07";
|
||||
sub XiaomiSmartHome_Device_updateSReading($);
|
||||
|
||||
#####################################
|
||||
@@ -80,12 +80,19 @@ sub XiaomiSmartHome_Device_Read($$$){
|
||||
readingsSingleUpdate($hash, "state", "$data->{status}", 1 );
|
||||
if ($data->{status} eq 'motion' && $hash->{MODEL} eq 'motion'){
|
||||
readingsSingleUpdate($hash, "no_motion", "0", 1 );
|
||||
}
|
||||
if ($data->{status} eq 'close' && $hash->{MODEL} eq 'magnet'){
|
||||
readingsSingleUpdate($hash, "no_close", "0", 1 );
|
||||
}
|
||||
}
|
||||
if(defined $data->{no_motion}){
|
||||
Log3 $name, 3, "$name>" . " SID: " . $sid . " Type: " . $hash->{MODEL} . " NO_motion: " . $data->{no_motion};
|
||||
readingsSingleUpdate($hash, "no_motion", "$data->{no_motion}", 1 );
|
||||
}
|
||||
if(defined $data->{no_close}){
|
||||
Log3 $name, 3, "$name>" . " SID: " . $sid . " Type: " . $hash->{MODEL} . " NO_close: " . $data->{no_close};
|
||||
readingsSingleUpdate($hash, "no_close", "$data->{no_close}", 1 );
|
||||
}
|
||||
if(defined $data->{voltage}){
|
||||
Log3 $name, 3, "$name>" . " SID: " . $sid . " Type: " . $hash->{MODEL} . " Voltage: " . $data->{voltage};
|
||||
readingsSingleUpdate($hash, "voltage", "$data->{voltage}", 1 );
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
UPD 2017-03-22_18:48:03 14910 FHEM/71_XiaomiSmartHome.pm
|
||||
UPD 2017-03-23_18:32:10 7891 FHEM/71_XiaomiSmartHome_Device.pm
|
||||
UPD 2017-03-25_10:48:10 8231 FHEM/71_XiaomiSmartHome_Device.pm
|
||||
Reference in New Issue
Block a user