Giter Site home page Giter Site logo

aqara-mqtt's Introduction

Aqara-MQTT

Build Status

Aqara (Xiaomi) Gateway to MQTT bridge. I use it for home assistant integration and it works well now.

You need to activate developer mode (described here: http://bbs.xiaomi.cn/t-13198850)

Bridge accept following MQTT set:

"home/plug/heater/status/set" -> on 

will turn on plug/heater and translate devices state from gateway:

"home/plug/heater/status" on

Architecture

Docker image support following architectures (you must choose your architecture in docker-compose):

  • armhf (raspberry pi 3, arm32v7)
  • i386 (x86 pc)
  • x64 (x64 pc)

Config

Edit file config/config-sample.yaml and rename it to config/config.yaml

Docker-Compose

Sample docker-compose.yaml file for user:

aqara:
  image: monster1025/aqara-mqtt:1-armhf
  container_name: aqara
  volumes:
    - "./config:/app/config"
  net: host
  restart: always

Related projects

General discussions:

Home assistant examples:

  • Gateway rgb light as home assistant bulb template
- platform: mqtt_template
  name: "Main Gateway"
  state_topic: "home/gateway/main/rgb"
  command_topic: "home/gateway/main/rgb/set"
  command_on_template: "{%- if red is defined and green is defined and blue is defined -%}{{ red }},{{ green }},{{ blue }}{%- else -%}255,179,0{%- endif -%},{%- if brightness is defined -%}{{ (float(brightness) / 255 * 100) | round(0) }}{%- else -%}100{%- endif -%}"
  command_off_template: "0,0,0,0"
  state_template: "{%- if value.split(',')[3]| float > 0 -%}on{%- else -%}off{%- endif -%}"  # must return `on` or `off`
  brightness_template: "{{ (float(value.split(',')[3])/100*255) | round(0) }}"
  red_template: "{{ value.split(',')[0] | int }}"
  green_template: "{{ value.split(',')[1] | int }}"
  blue_template: "{{ value.split(',')[2] | int }}"
  • Switch automation example:
trigger:
    platform: mqtt
    topic: home/switch/hall/status
    payload: 'click'
action:
  service: script.hall_force_light_on

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.