- Xiaomi Gateway + Xiaomi Gateway (Aqara)
-
The xiaomi aqara
platform allows you to integrate the following Xiaomi devices into Home Assistant.
The xiaomi_aqara
component allows you to integrate Xiaomi Aqara-compatible devices into Home Assistant.
Supported Devices
- Temperature and Humidity Sensor (1st and 2nd generation)
- Motion Sensor (1st and 2nd generation)
- Door and Window Sensor (1st and 2nd generation)
- Button (1st and 2nd generation) -
- Plug aka Socket (ZigBee version, reports power consumed, power load, state and if device in use) +
- Plug aka Socket (Zigbee version, reports power consumed, power load, state and if device in use)
- Wall Plug (reports power consumed, power load and state)
- Aqara Wall Switch (Single)
- Aqara Wall Switch (Double) @@ -96,7 +97,7 @@
- Water Leak Sensor
- Battery
What’s not available?
+Unsupported Devices
- Gateway Radio
- Gateway Button @@ -105,8 +106,9 @@
- Decoupled mode of the Aqara Wall Switches (Single & Double)
- Additional alarm events of the Gas and Smoke Detector: Analog alarm, battery fault alarm (smoke detector only), sensitivity fault alarm, I2C communication failure
Follow the setup process using your phone and Mi-Home app. From here you will be able to retrieve the key from within the app following this tutorial
-To enable Xiaomi gateway in your installation, add the following to your configuration.yaml
file:
Setup
+Follow the setup process using your phone and Mi-Home app. From here you will be able to retrieve the key from within the app following this tutorial.
+To enable Xiaomi Gateway (Aqara) in your installation, add the following to your configuration.yaml
file:
One Gateway
# You can leave mac empty if you only have one gateway.
xiaomi_aqara:
@@ -134,14 +136,30 @@
key: xxxxxxxxxxxxxxxx
Configuration variables:
--
-
- mac (Optional): The MAC of your gateway. Required if you have more than one. -
- key (Optional): The key of your gateway. Required if you also want to control lights and switches. Sensors and binary sensors will still work. -
- discovery_retry (Optional): Amount of times Home Assitant should try to reconnect to the Xiaomi Gateway. Default is 3. -
- interface (Optional): Which network interface to use. Defaults to any. -
Services
+Configuration Variables
+-
+
- mac +
-
+
(string)(Required)The MAC of your gateway. Optional if only using one gateway.
+
+ - key +
-
+
(string)(Required)The key of your gateway. Optional if only using sensors and/or binary sensors.
+
+ - discovery_retry +
-
+
(int)(Optional)Number of times that Home Assistant should try to reconnect to the gateway.
+Default value: 3
+
+ - interface +
-
+
(string)(Optional)Which network interface to use.
+Default value: any
+
+
Services
The gateway provides two services: xiaomi.play_ringtone
and xiaomi.stop_ringtone
. To play ringtones by Home Assistant, the version of the gateway firmware must be 1.4.1_145
at least. A ringtone_id
and gw_mac
must be supplied. The parameter ringtone_vol
(percent) is optional. Allowed values of the ringtone_id
are:
- alarm ringtones [0-8] @@ -149,7 +167,11 @@
- alarm clock [20-29]
- custom ringtones (uploaded by the Mi Home app) starting from 10001
Automation example
+Examples
+Long Press on Smart Button
+This example plays the sound of a dog barking when the button is held down, +and stops the sound when the button is pressed once. +Note: The sound will stop playing automatically when it has ended.
- alias: Let a dog bark on long press
trigger:
platform: event
@@ -177,15 +199,15 @@
gw_mac: xxxxxxxxxxxx
Troubleshooting
-Connection problem
+Troubleshooting
+Connection problem
2017-08-20 16:51:19 ERROR (SyncWorker_0) [homeassistant.components.xiaomi] No gateway discovered
2017-08-20 16:51:20 ERROR (MainThread) [homeassistant.setup] Setup failed for xiaomi: Component failed to initialize.
That means that Home Assistant is not getting any response from your Xiaomi gateway. Might be a local network problem or your firewall.
-
-
- Make sure you have enabled LAN access: https://community.home-assistant.io/t/beta-xiaomi-gateway-integration/8213/1832 +
- Make sure you have enabled LAN access.
- Turn off the firewall on the system where Home Assistant is running.
- Try to leave the MAC address
mac:
blank. - Try to set
discovery_retry: 10
.
@@ -423,7 +445,7 @@
Wink