智能家居入门:用 Home Assistant 打造你的第一个自动化场景

智能家居入门:用 Home Assistant 打造你的第一个自动化场景

为什么选择 Home Assistant?

智能家居市场品牌林立,小米、HomeKit、涂鸦各自为战。Home Assistant(HA)作为开源平台,能统一接入不同品牌设备,实现真正的联动自动化。

硬件准备清单

入门最低成本方案:

  • 树莓派 4B 或 旧笔记本(2GB 内存即可)
  • 小米多模网关 × 1(约 150 元)
  • 人体传感器 × 2(约 60 元/个)
  • 智能插座 × 2(约 50 元/个)

总预算控制在 400 元内,比买一套品牌套装便宜一半。

Home Assistant 安装步骤

推荐使用 Docker 部署,一条命令搞定:

docker run -d \
  --name homeassistant \
  --privileged \
  --restart=unless-stopped \
  -e TZ=Asia/Shanghai \
  -v /home/ha/config:/config \
  --network=host \
  ghcr.io/home-assistant/home-assistant:stable

安装完成后访问 http://你的 IP:8123 即可完成初始化。

第一个自动化:人来灯亮

在 HA 配置文件中添加:

automation:
  - alias: "走廊人来开灯"
    trigger:
      platform: state
      entity_id: binary_sensor.hallway_motion
      to: "on"
    action:
      entity_id: light.hallway
      service: light.turn_on

品牌平台对比

平台 成本 灵活性 学习曲线
Home Assistant 极高 中等
小米米家 中等
Apple HomeKit 中等

HA 适合爱折腾的用户,一次搭建终身受益。本地运行不依赖云端,断网也能用,隐私更安全。

Comments

No comments yet. Why don’t you start the discussion?

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注