GithubHelp home page GithubHelp logo

logistik777 / hass-xiaomi-miot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from al-one/hass-xiaomi-miot

0.0 0.0 0.0 280 KB

Auto integrate xiaomi devices by miot-spec for HomeAssistant

License: Apache License 2.0

Python 98.84% Shell 1.16%

hass-xiaomi-miot's Introduction

Xiaomi Miot For HomeAssistant

English | 简体中文

MIoT-Spec: The protocol specification for Xiaomi IoT devices, is a standard designed by the Xiaomi IoT platform to describe the function definition of hardware products according to the networking mode of hardware products, the characteristics of product functions, the characteristics of user usage scenarios and the user's requirements for hardware product use experience specification.

This component uses the MIoT-Spec to automatically integrate Xiaomi devices into HomeAssistant, and currently supports most Xiaomi MIoT devices. And it supports HA Web UI, and you can easily integrate Xiaomi devices into HA without configuring yaml.

Installing

Download and copy custom_components/xiaomi_miot folder to custom_components folder in your HomeAssistant config folder

# Auto install via terminal shell
wget -q -O - https://raw.fastgit.org/al-one/hass-xiaomi-miot/master/install.sh | bash -

Or you can install component with HACS

Config

⚙️ Configuration > 🧩 Integrations > ➕ Add Integration > 🔍 Search Xiaomi Miot Auto

Or click (HA v2021.3.0+): add

You have two ways to integrate xiaomi devices:

  • Add device using host/token

    Suitable for devices supporting miot-spec in LAN

  • Add devices using Mi Account

    Suitable for miio, ble and ZigBee devices (miot_cloud will be enabled)

Configuration Xiaomi Cloud:

If your device (integrate by token) unavailable or return code -4004 or -9999 in logs, You can try this way.

# configuration.yaml
xiaomi_miot:
  username: xiaomi_username
  password: xiaomi_password
  # server_country: cn # location of xiaomi cloud: cn(default), de, i2, ru, sg, us

Enabled miot cloud for device:

⚙️ Configuration > 🧩 Integrations > Xiaomi Miot Auto > Options > ☑️ Enable miot cloud

Customize entity

# configuration.yaml
homeassistant:
  customize: !include customize.yaml


# customize.yaml
domain.your_entity_id:
  miot_cloud: true          # Enable miot cloud for entity (read, write, action)
  # miot_cloud_write: true  # (Optional) Enable miot cloud (only write)
  # miot_cloud_action: true # (Optional) Enable miot cloud (only action)
  # miot_local: true        # Force to read and write data in LAN

climate.your_entity_id:
  bind_sensor: sensor.temperature_entity,sensor.humidity_entity # Sensor entities

camera.your_entity_id:
  video_attribute: 1   # https://github.com/al-one/hass-xiaomi-miot/issues/11#issuecomment-773054167
  keep_streaming: true # Continuously update stream address
  check_lan: true      # Check LAN connection in cloud mode

cover.your_entity_id:
  closed_position: 5 # Change cover state to closed when position <= 5%

doamin.your_entity_id:
  interval_seconds: 30 # Seconds between each update state (Requires reload config entry)
  chunk_properties: 10 # Chunk miot properties on update state (LAN)

Recommended Customization Using The UI:

⚙️ Configuration > 🖌 Customize > 🔍 Select Entity > Add Other Attribute

Debug

Get Entity State Attributes

🔨 Developer tools > ℹ️ State > 🔍 Filter Entity

# configuration.yaml
logger:
  default: warning
  logs:
    custom_components.xiaomi_miot: debug

⚙️ Configuration > ✍️ Logs

Obtain miio token

  • Use HomeAssistant Service

    1. Goto HomeAssistant service developer tools
    2. Select xiaomi_miot.get_token, Enter the entity ID and device name
    3. Find the token from the HA notifications
  • Use MiHome mod by @vevsvevs

    1. Down apk from СКАЧАТЬ ВЕРСИЮ 6.x.x
    2. Create folder /sdcard/vevs/logs/ ⚠️
    3. Find the token from vevs/logs/misc/devices.txt

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.