HomeAssistant安装使用

一、Home Assistant安装

官方文档:https://www.home-assistant.io/installation/raspberrypi

sudo vim /etc/docker/daemon.json
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
"registry-mirrors": ["https://registry.docker-cn.com"]
"registry-mirrors": ["https://52yx7zhl.mirror.aliyuncs.com"]
sudo systemctl restart docker
services:
  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/raspberrypi3-homeassistant:stable"
    volumes:
      - /etc/config:/config
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
    privileged: true
    network_mode: host
    environment:
      - GITHUB_TOKEN=

supervised

https://github.com/home-assistant/supervised-installer

bash installer.sh --machine raspberrypi3

二、安装插件商店HACS

官方文档:https://hacs.xyz/docs/installation/installation

运行完安装命令后,添加集成,HACS

GitHub Ratelimit error问题解决方法

github的Settings/Developer settings/Personal access tokens,创建一个token,然后设置到环境变量中

# linux
export GITHUB_TOKEN=

安装主题:iOS Themes - Dark Mode and Light Mode

安装完成之后,你需要到configuration.yaml里添加一行代码

frontend:  
  themes: !include_dir_merge_named themes

再重启home assistant一次,之后你可以点击左下角的头像进行主题更换

三、添加集成

https://www.home-assistant.io/integrations/

1. xiaomi_miio

小米设备token获取

https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor

Xiaomi Miio

zhimi.airpurifier.ma2

zimi.powerstrip.v2

2. 小米空调伴侣

需要手动添加仓库

https://github.com/EugeneLiu/xiaomi_airconditioningcompanionMCN02

直接hacs下载

四、主题

https://github.com/jimz011/homekit-infused/tree/4.x.x-docs

https://github.com/jimz011/homekit-infused/tree/4.x.x-personal

直接hacs下载loveplace:

Simple Thermostat

Air Purifier Card

mini-graph-card

小的线段图

UI配置参考

图标,来自 https://materialdesignicons.com/

自定义实体,分组,https://sspai.com/post/40272

设置地理位置

https://www.openhistoricalmap.org/

https://github.com/home-assistant/supervised-installer

https://github.com/home-assistant/supervisor

FRP服务器搭建

# install
wget --no-check-certificate https://raw.githubusercontent.com/clangcn/onekey-install-shell/master/frps/install-frps.sh -O ./install-frps.sh
chmod 700 ./install-frps.sh
./install-frps.sh install

# update
wget --no-check-certificate https://raw.githubusercontent.com/clangcn/onekey-install-shell/master/frps/install-frps.sh -O ./install-frps.sh
bash install-frps.sh update

局域网建立.local域名

https://notes.leconiot.com/mdns.html