Merge branch 'master' into devel
This commit is contained in:
@@ -40,6 +40,8 @@ eval "use Crypt::CBC";
|
|||||||
return "\nERROR: Please install Crypt::CBC" if($@);
|
return "\nERROR: Please install Crypt::CBC" if($@);
|
||||||
eval "use Net::Ping";
|
eval "use Net::Ping";
|
||||||
return "\nERROR: Please install Net::Ping" if($@);
|
return "\nERROR: Please install Net::Ping" if($@);
|
||||||
|
eval "use Math::Round";
|
||||||
|
return "\nERROR: Please install libmath-round-perl" if($@);
|
||||||
|
|
||||||
|
|
||||||
use Color;
|
use Color;
|
||||||
@@ -50,7 +52,9 @@ use SetExtensions;
|
|||||||
sub XiaomiSmartHome_Notify($$);
|
sub XiaomiSmartHome_Notify($$);
|
||||||
sub XiaomiSmartHome_updateSingleReading($$);
|
sub XiaomiSmartHome_updateSingleReading($$);
|
||||||
my $iv="\x17\x99\x6d\x09\x3d\x28\xdd\xb3\xba\x69\x5a\x2e\x6f\x58\x56\x2e";
|
my $iv="\x17\x99\x6d\x09\x3d\x28\xdd\xb3\xba\x69\x5a\x2e\x6f\x58\x56\x2e";
|
||||||
|
|
||||||
my $version = "1.19";
|
my $version = "1.19";
|
||||||
|
|
||||||
my %XiaomiSmartHome_gets = (
|
my %XiaomiSmartHome_gets = (
|
||||||
"getDevices" => ["get_id_list", '^.+get_id_list_ack' ],
|
"getDevices" => ["get_id_list", '^.+get_id_list_ack' ],
|
||||||
|
|
||||||
|
|||||||
@@ -24,9 +24,11 @@ package main;
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
use Math::Round qw/nearest/;
|
||||||
|
|
||||||
|
|
||||||
my $version = "1.19";
|
my $version = "1.19";
|
||||||
|
|
||||||
sub XiaomiSmartHome_Device_updateSReading($);
|
sub XiaomiSmartHome_Device_updateSReading($);
|
||||||
|
|
||||||
|
|
||||||
@@ -44,9 +46,11 @@ sub XiaomiSmartHome_Device_Initialize($)
|
|||||||
|
|
||||||
$hash->{AttrList} = "IODev follow-on-for-timer:1,0 follow-on-timer ".
|
$hash->{AttrList} = "IODev follow-on-for-timer:1,0 follow-on-timer ".
|
||||||
"do_not_notify:1,0 ignore:1,0 dummy:1,0 showtime:1,0 valueFn:textField-long ".
|
"do_not_notify:1,0 ignore:1,0 dummy:1,0 showtime:1,0 valueFn:textField-long ".
|
||||||
|
|
||||||
"rnd_tmp:1,2,3 ".
|
"rnd_tmp:1,2,3 ".
|
||||||
"rnd_hum:1,2,3 ".
|
"rnd_hum:1,2,3 ".
|
||||||
"rnd_bat:1,2,3 ".
|
"rnd_bat:1,2,3 ".
|
||||||
|
|
||||||
$readingFnAttributes ;
|
$readingFnAttributes ;
|
||||||
}
|
}
|
||||||
#####################################
|
#####################################
|
||||||
@@ -194,9 +198,11 @@ sub XiaomiSmartHome_Device_on_timeout($){
|
|||||||
#####################################
|
#####################################
|
||||||
sub XiaomiSmartHome_Device_Read($$$){
|
sub XiaomiSmartHome_Device_Read($$$){
|
||||||
my ($hash, $msg, $name) = @_;
|
my ($hash, $msg, $name) = @_;
|
||||||
|
|
||||||
my $XMIround_tmp = AttrVal( $hash->{NAME}, "rnd_tmp", "2" );
|
my $XMIround_tmp = AttrVal( $hash->{NAME}, "rnd_tmp", "2" );
|
||||||
my $XMIround_hum = AttrVal( $hash->{NAME}, "rnd_hum", "2" );
|
my $XMIround_hum = AttrVal( $hash->{NAME}, "rnd_hum", "2" );
|
||||||
my $XMIround_bat = AttrVal( $hash->{NAME}, "rnd_bat", "1" );
|
my $XMIround_bat = AttrVal( $hash->{NAME}, "rnd_bat", "1" );
|
||||||
|
|
||||||
my $decoded = eval{decode_json($msg)};
|
my $decoded = eval{decode_json($msg)};
|
||||||
if ($@) {
|
if ($@) {
|
||||||
Log3 $name, 1, "$name: DEV_Read> Error while request: $@";
|
Log3 $name, 1, "$name: DEV_Read> Error while request: $@";
|
||||||
@@ -222,6 +228,7 @@ sub XiaomiSmartHome_Device_Read($$$){
|
|||||||
readingsBulkUpdate($hash, "no_close", "0", 1 );
|
readingsBulkUpdate($hash, "no_close", "0", 1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined $data->{no_motion}){
|
if (defined $data->{no_motion}){
|
||||||
Log3 $name, 4, "$name: DEV_Read>" . " Name: " . $hash->{NAME} . " SID: " . $sid . " Type: " . $hash->{MODEL} . " NO_motion: " . $data->{no_motion};
|
Log3 $name, 4, "$name: DEV_Read>" . " Name: " . $hash->{NAME} . " SID: " . $sid . " Type: " . $hash->{MODEL} . " NO_motion: " . $data->{no_motion};
|
||||||
readingsBulkUpdate($hash, "no_motion", "$data->{no_motion}", 1 );
|
readingsBulkUpdate($hash, "no_motion", "$data->{no_motion}", 1 );
|
||||||
|
|||||||
36
README.md
36
README.md
@@ -1,6 +1,38 @@
|
|||||||
# fhem-XiaomiSmartHome Gateway
|
# fhem-XiaomiSmartHome Gateway
|
||||||
With this module, the XiaomiGateway is bound to Fhem. The module listens for multicast messages from the gateway. Currently only for the sensortype Magnet, Motion, Temperature-Humidity, Switch, Cube, Curtain, Smoke and Gas.
|
With this module, the Xiaomi Smarthome Gateway is bound to FHEM. The module listens for multicast messages from the gateway.
|
||||||
Changing and switching the led of the gateway and changing ringtone and volume of the gateway is also possible
|
Changing and switching the LED from the gateway and changing ringtone and volume of the gateway is also possible
|
||||||
|
|
||||||
* Please read the Wiki !! you need to install some Perl modules.
|
* Please read the Wiki !! you need to install some Perl modules.
|
||||||
* https://github.com/T0RST3N/fhem-XiaomiSmartHome/wiki
|
* https://github.com/T0RST3N/fhem-XiaomiSmartHome/wiki
|
||||||
|
|
||||||
|
# Supported Sensors
|
||||||
|
* magnet: Window/Door magnetic sensor
|
||||||
|
* motion: Human body motion sensor
|
||||||
|
* sensor_motion.aq2: Aqara Human body motion sensor with lux readings
|
||||||
|
* sensor_ht: Temperature and humidity sensor
|
||||||
|
* weather.v1: Aqara Temperature, pressure and humidity sensor
|
||||||
|
* switch: Wireless sensor switch
|
||||||
|
* plug & 86plug: Smart socket
|
||||||
|
* cube: Cube sensor
|
||||||
|
* 86sw1: Wireless switch single
|
||||||
|
* 86sw2: Wireless switch double
|
||||||
|
* ctrl_neutral1: Single bond ignition switch
|
||||||
|
* ctrl_neutral2: Double bond ignition switch
|
||||||
|
* rgbw_light: Smart lights (report only)
|
||||||
|
* curtain: Curtain (Control only if device has reporte curtain_level)
|
||||||
|
* wleak: Watersensor
|
||||||
|
* smoke: smoke alarm detector
|
||||||
|
* * 0: disarm
|
||||||
|
* * 1: arlarm
|
||||||
|
* * 8: battery arlarm
|
||||||
|
* * 64: arlarm sensitivity
|
||||||
|
* * 32768: ICC communication failure
|
||||||
|
* gas: gas alarm detector
|
||||||
|
* * 0: disarm
|
||||||
|
* * 1: arlarm
|
||||||
|
* * 2: analog arlarm
|
||||||
|
* * 64: arlarm sensitivity
|
||||||
|
* * 32768: ICC communication failure
|
||||||
|
|
||||||
|
# A BIG ThankYOU to my Supporters
|
||||||
|
* StefanB from Coburg
|
||||||
|
|||||||
BIN
images/7.PNG
Normal file
BIN
images/7.PNG
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
Reference in New Issue
Block a user