小米 – ha_xiaomi_home

# 小米 – ha_xiaomi_home

## 项目介绍
ha_xiaomi_home 是小米开源的Home Assistant集成,该项目拥有 21541 颗星标,主要用于将小米智能设备集成到Home Assistant智能家居平台中。项目旨在提供一套完整的小米智能设备集成方案,让用户能够在Home Assistant中统一管理和控制小米智能设备。

## 主要特点

– **全面的设备支持**:支持多种小米智能设备,如智能灯具、插座、传感器等
– **实时状态更新**:实时同步设备状态到Home Assistant
– **双向控制**:支持从Home Assistant控制小米智能设备
– **自动化支持**:与Home Assistant的自动化系统无缝集成
– **可扩展性**:支持添加新设备和功能
– **稳定性**:稳定可靠的设备连接和状态同步
– **开源免费**:完全开源,可自由使用和修改
– **社区支持**:活跃的社区,提供技术支持和资源

## 支持的设备类型

– **智能灯具**:小米智能灯泡、灯带等
– **智能插座**:小米智能插座、插线板等
– **传感器**:温度传感器、湿度传感器、人体传感器等
– **开关**:智能开关、窗帘开关等
– **摄像头**:小米智能摄像头
– **空调**:小米智能空调
– **净化器**:小米空气净化器
– **其他**:小米智能门锁、扫地机器人等

## 使用方式

### 安装

“`bash
# 通过HACS安装(推荐)
1. 打开Home Assistant
2. 进入HACS
3. 搜索”Xiaomi Home”
4. 点击安装

# 手动安装
1. 克隆项目到custom_components目录
git clone https://github.com/m Xiaomi/ha_xiaomi_home.git ~/.homeassistant/custom_components/xiaomi_miot
2. 重启Home Assistant
“`

### 配置

在`configuration.yaml`中添加配置:

“`yaml
# 基本配置
xiaomi_miot:
username: your_xiaomi_account
password: your_xiaomi_password
region: cn # 可选: cn, i2, us, ru, tw, sg, my, in

# 高级配置
xiaomi_miot:
username: your_xiaomi_account
password: your_xiaomi_password
region: cn
devices:
– name: 客厅灯
model: yeelink.light.color1
host: 192.168.1.100
token: your_device_token
– name: 卧室插座
model: chuangmi.plug.m1
host: 192.168.1.101
token: your_device_token
“`

### 使用示例

“`yaml
# 在自动化中使用
automation:
– alias: “晚上自动开灯”
trigger:
platform: sun
event: sunset
action:
service: light.turn_on
data:
entity_id: light.living_room_light
brightness: 255
color_temp: 300

# 在场景中使用
scene:
– name: 电影模式
entities:
light.living_room_light: off
light.ambient_light: on
light.ambient_light: { brightness: 100, color_temp: 200 }
“`

### 设备发现和配置

1. **自动发现**:Home Assistant启动后会自动发现小米设备
2. **手动配置**:可以在Home Assistant的集成页面手动配置设备
3. **设备令牌**:需要获取小米设备的令牌才能控制设备
4. **设备分组**:可以在Home Assistant中对设备进行分组管理

## 应用场景

– **智能家居控制**:通过Home Assistant统一控制小米智能设备
– **自动化场景**:创建基于小米设备的自动化场景
– **远程控制**:通过Home Assistant远程控制小米设备
– **语音控制**:与Home Assistant支持的语音助手集成
– **数据收集**:收集小米传感器的数据用于分析
– **智能家居中枢**:将小米设备与其他品牌设备集成到统一平台

## 优势

– **统一管理**:在一个平台中管理所有小米智能设备
– **自动化能力**:利用Home Assistant的强大自动化能力
– **扩展性**:支持添加新设备和功能
– **稳定性**:稳定可靠的设备连接和状态同步
– **社区支持**:活跃的社区,提供技术支持和资源
– **开源免费**:完全开源,可自由使用和修改
ha_xiaomi_home 为小米智能设备的集成提供了强大的解决方案,特别适合需要在Home Assistant中统一管理和控制小米智能设备的用户,能够显著提高智能家居的自动化水平和使用体验。

Scroll to Top