Home

Awesome

homeassistant-aqara

Home-Assistant implementation for the Xiaomi (Aqara) gateway Supported sensors:

INSTALLATION

  1. Install Home-Assistant,
  2. Enable the developer mode of the gateway.
  1. Download and place aqara.py files in the home-assistant folder like this:

    • .homeassistant/custom_components/aqara.py
    • .homeassistant/custom_components/sensor/aqara.py
    • .homeassistant/custom_components/binary_sensor/aqara.py
  2. Add the new platform in the configuration.yaml: lowercase is important, multiple gateways is not supported by now.

     aqara:
       gateway_password: yourgatewaypassword
    
  3. restart the home assistant service, note that it may take several minutes to install the pyCrypto dependency during the first start.

CUSTOMIZATION

Since until now there is no way to retrieve the configured names from the gateway, Home-Assistant will display each sensor like that:

To make it readable again, create a customize.yaml file in the home-assistant folder. You can use step 7 https://goo.gl/gEVIrn to identify the sensors.

  1. Add a line in the configuration.yaml:

homeassistant:

Name of the location where Home Assistant is running

name: Home ... time_zone: Europe/Paris customize: !include customize.yaml ```

Magnet Automation example

binary_sensor:
  - platform: template
    sensors:
      door:
        friendly_name: Frontdoor
        value_template: "{{ states.binary_sensor.magnet_158d0001179ae9.state == 'open' }}"
        sensor_class: opening
        entity_id:
            - binary_sensor.magnet_158d0001179ae9

automation:
 - alias: FrontDoorClosed
   trigger:
     platform: state
     entity_id: binary_sensor.door
     to: 'off'
   action:
     service: notify.TelegramNotifier
     data:
      message: Door closed
 - alias: FrontDoorOpened
   trigger:
     platform: state
     entity_id: binary_sensor.door
     to: 'on'
   action:
     service: notify.TelegramNotifier
     data:
      message: Door opened

TODO