diff --git a/FHEM/71_XiaomiSmartHome.pm b/FHEM/71_XiaomiSmartHome.pm index d5c482c..588861d 100644 --- a/FHEM/71_XiaomiSmartHome.pm +++ b/FHEM/71_XiaomiSmartHome.pm @@ -50,7 +50,7 @@ sub XiaomiSmartHome_Notify($$); sub XiaomiSmartHome_updateSingleReading($$); sub XiaomiSmartHome_updateAllReadings($); my $iv="\x17\x99\x6d\x09\x3d\x28\xdd\xb3\xba\x69\x5a\x2e\x6f\x58\x56\x2e"; -my $version = "0.22"; +my $version = "0.23"; my %XiaomiSmartHome_gets = ( "getDevices" => ["get_id_list", '^.+get_id_list_ack' ], @@ -124,10 +124,15 @@ sub XiaomiSmartHome_Read($) { if ($decoded->{'model'} && $decoded->{'model'} eq 'gateway' ){ if ($decoded->{'cmd'} eq 'report'){ my $data = decode_json($decoded->{data}); + Log3 $name, 5, "$name: Read>" . " Data: " . $data ; if (defined $data->{rgb}){ Log3 $name, 3, "$name: Read>" . " SID: " . $decoded->{'sid'} . " Type: Gateway" . " RGB: " . $data->{rgb} ; readingsBulkUpdate($hash, "RGB", $data->{rgb} , 1 ); } + if (defined $data->{illumination}){ + Log3 $name, 3, "$name: Read>" . " SID: " . $decoded->{'sid'} . " Type: Gateway" . " Illumination: " . $data->{illumination} ; + readingsBulkUpdate($hash, "illumination", $data->{illumination} , 1 ); + } } elsif ($decoded->{'cmd'} eq 'heartbeat'){ my $data = decode_json($decoded->{data}); @@ -148,6 +153,7 @@ sub XiaomiSmartHome_Read($) { } else { readingsBulkUpdate($hash, 'heartbeat', "Write_OK", 1 ); + readingsBulkUpdate($hash, "proto_version", $data->{proto_version} , 1 ); } } readingsEndUpdate( $hash, 1 ); diff --git a/controls_mish.txt b/controls_mish.txt index 9023635..bc13ad3 100644 --- a/controls_mish.txt +++ b/controls_mish.txt @@ -1,2 +1,2 @@ -UPD 2017-05-03_19:53:18 22990 FHEM/71_XiaomiSmartHome.pm +UPD 2017-05-04_19:31:19 23384 FHEM/71_XiaomiSmartHome.pm UPD 2017-05-01_13:14:43 11699 FHEM/71_XiaomiSmartHome_Device.pm \ No newline at end of file