Skip to content

Auto integrate xiaomi devices by miot-spec for HomeAssistant

Notifications You must be signed in to change notification settings

luoban/hass-xiaomi-miot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Xiaomi Miot For HomeAssistant

Installing

Copy custom_components/xiaomi_miot folder to custom_components folder in your HomeAssistant config folder

wget https://github.com/al-one/hass-xiaomi-miot/archive/master.zip
unzip master.zip
cp -rf hass-xiaomi-miot-master/custom_components/xiaomi_miot ~/.homeassistant/custom_components/
rm -rf hass-xiaomi-miot-master

Or you can install component with HACS

Config

HomeAssistant GUI

Configuration > Integrations > ➕ > Search Xiaomi Miot Auto

Configuration variables:

  • host(Required): The IP of your device
  • token(Required): The Token of your device
  • name(Optional): The name of your device
  • model(Optional): The model of device, required if config by yaml

Configuration Xiaomi Cloud:

If your device return code -4004 or -9999 in logs, You can try this way.

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

xiaomi_miot:
  username: xiaomi_username
  password: xiaomi_password
  # server_country: cn

# customize.yaml (Configuration > Customize > Select Entity > Add Other Attribute)
camera.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_did: '123456789'   # (Optional) Your miot device id (Get form cloud if empty)

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 (Configuration > Customize > Select Entity > Add Other Attribute)
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
  check_lan: true    # Check LAN connection in cloud mode

Recommended: Customization Using The UI

Debug

Get Entity State Attributes

Developer tools > State > Filter Entity

Get Debug Logs

logger:
  default: warning
  logs:
    custom_components.xiaomi_miot: debug

Obtain miio token

About

Auto integrate xiaomi devices by miot-spec for HomeAssistant

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%