2024年11月21日星期四 下午11:31:03

Home Assistant Core 集成·HACS插件教程

2 年 前
#5902 引用
Home Assistant Core 集成·HACS插件教程

Before you can Install HACS you need to acknowledge the following:


HACS is not an addon, that is an integration. These are different things.

HACS 是 Home Assistant 上的一个第三方成。

全名:Home Assistant Community Store

网站:https://hacs.xyz/

HACS是一个自定义组件(集成)




What install method is your HA instance based on? HassOS, Home Assistant Container, Home Assistant Supervised or Home Assistant Core?
What is the underlying hardware, RPI, NUC or maybe openWRT 6 on a modem/router??

/home/homeassistant/.homeassistant/custom_components/hacs
解决GitHub的raw.githubusercontent.com无法连接问题 ...
你需要下载与ha 安装方式 相应的匹配的版本,而不是随便下载一个


安装完毕Home Assistant Core套件后,需要安装HACS的可以参考下面教程。

$ ll /home/homeassistant/.homeassistant/custom_components

total 16
drwxr-xr-x  4 homeassistant homeassistant 4096 mai    7 21:40 ./
drwxrwxr-x 10 homeassistant homeassistant 4096 mai    8 08:30 ../
drwxrwxr-x  4 homeassistant homeassistant 4096 mai    7 21:40 ble_monitor/
drwxr-xr-x 12 homeassistant homeassistant 4096 mai    7 21:15 hacs/



homeassistant core安装 HACS插件正确方法

step 1、下载hacs(2022.9.25更新了6、7通用,限制了hacs能正常运行的版本)
sudo -i
cd /var/packages/homeassistant/var/config
mkdir www
mkdir -p custom_components/hacs
cd custom_components/hacs
#注意:HA套件版内核老了,测试hacs v1.20.0运行OK
wget https://ghproxy.com/https://github.com/hacs/integration/releases/download/1.20.0/hacs.zip
7z x hacs.zip


step 2、安装hacs

2.1 配置---集成 里面搜索HACS
2.2 安装HACS
2.3 用github账户授权HACS登录
2.4 启动使用HACS





错误方式

wget https://github.com/hacs/integration/releases/latest/download/hacs.zip


各种论坛下载hacs.zip,解压到HA目录下面的custom_components/hacs,重启。

结果就是报一大堆错误。

原因

包下载错误

正确方法:

进入HACS的官网(Prerequisites | HACS),进入download页面,提供了3种类型的包下载:

选择我们的Home Assistant CORE方式下载包

(和后面成功方式下载HACS包,对比了下解压后有些不一样,估计就是问题所在)



获取正确完整的HACS包,解压拷贝到HA目录的custom_components/hacs下,再重启HA,此时你就能在主页和集成里面发现HACS

进入HACS的官网(Prerequisites | HACS),进入download页面,选择我们的CORE方式的配置安装:


https://blog.csdn.net/qq_33611327/article/details/123047532

官网正确安装 hacs的方法

https://hacs.xyz/docs/setup/remove

图解具体操作

https://www.wundertech.net/how-to-install-hacs-on-home-assistant/

教程核心点就是提示HA配置的目录(DSM6、7都是这个):/var/packages/homeassistant/var/config

https://imnks.com/4167.html

https://zhuanlan.zhihu.com/p/637402821

How to Install HACS on Home Assistant (Supervised)
https://www.wundertech.net/how-to-install-hacs-on-home-assistant/
0
2 年 前
#5904 引用
用github账户授权HACS登录
https://github.com/login/device
授权码
ADD9-257D






本文描述如下内容:

1.解决网络问题
2.下载正确的hacs版本
3.安装集成hacs


1.解决网络问题
https://blog.csdn.net/weixin_40973138/article/details/106081946


Where Home Assistant looks for integrations

Home Assistant will look at the following locations:



homeassistant/components/<domain> (built-in integrations)
<config directory>/custom_components/<domain>



examples

built-in integrations


/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/xiaomi


homeassistant/components/ 路径在 HA 在 python 中的安装路径,比如:

/srv/homeassistant/lib/python3.7(要根据你的虚拟用户的python版本做相应的修改)/site-packages/homeassistant/components


/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/xiaomi


third integrations


/home/homeassistant/.homeassistant/custom_components/xiaomi_gateway3
/home/homeassistant/.homeassistant/custom_components/xiaomi_miot



$ ll /home/homeassistant/.homeassistant/custom_components

total 16
drwxr-xr-x  4 homeassistant homeassistant 4096 mai    7 21:40 ./
drwxrwxr-x 10 homeassistant homeassistant 4096 mai    8 08:30 ../
drwxrwxr-x  4 homeassistant homeassistant 4096 mai    7 21:40 ble_monitor/
drwxr-xr-x 12 homeassistant homeassistant 4096 mai    7 21:15 hacs/







.../custom_components/xiaomi_miot/
├── __init__.py
├── air_quality.py
├── binary_sensor.py
├── camera.py
├── climate.py
├── config_flow.py
├── core/
├── ......
├── vacuum.py
└── water_heater.py


如果安装成功后搜索不到插件,请确认的插件目录结构如下,并清理浏览器缓存或更换浏览器后再尝试。
0
2 年 前
#5905 引用
Xiaomi Miot Auto





Path to configuration.yaml: /home/homeassistant/.homeassistant


step 2:mkdir custom_components




/home/homeassistant/.homeassistant/custom_components


Step 3: mkdir xiaomi_miot


/home/homeassistant/.homeassistant/custom_components/xiaomi_miot


Step 4:Manually copy xiaomi_miot folder from latest release to /config/custom_components folder.



{
  "name": "Xiaomi Miot Auto",
  "domain": "xiaomi_miot",
  "version": "0.6.7",
  "config_flow": true,
  "iot_class": "cloud_polling",
  "documentation": "https://github.com/al-one/hass-xiaomi-miot",
  "issue_tracker": "https://github.com/al-one/hass-xiaomi-miot/issues",
  "codeowners": ["@al-one"],
  "dependencies": [
    "http",
    "persistent_notification",
    "ffmpeg"
  ],
  "after_dependencies": ["homekit"],
  "requirements": [
    "construct==2.10.56",
    "python-miio>=0.5.6",
    "micloud>=0.3"
  ]
}
0
2 年 前
#5906 引用
1
0
2 年 前
#5929 引用
1
0
2 年 前
#5930 引用
1
0
2 年 前
#5931 引用
1
0
2 年 前
#5932 引用
XiaomiGateway3

https://github.com/AlexxIT/XiaomiGateway3


MiCloud devices info
Name: Mi Smart Power Plug 2 (Wi-Fi and Bluetooth Gateway)2
Model: chuangmi.plug.212a01
IP: 192.168.101.23
MAC: 68:AB:BC:88:89:98
Token: 2408ba10c691f7eb2e8ef627dc0683d

Device

Mi Smart Power Plug 2 (Wi-Fi and Bluetooth Gateway)2 (192.168.101.23)

Aqara 网关M1S-ZHWG15LM (192.168.101.24)




{
  "domain": "xiaomi_gateway3",
  "name": "Xiaomi Gateway 3",
  "config_flow": true,
  "documentation": "https://github.com/AlexxIT/XiaomiGateway3",
  "issue_tracker": "https://github.com/AlexxIT/XiaomiGateway3/issues",
  "codeowners": ["@AlexxIT"],
  "dependencies": ["http"],
  "requirements": ["zigpy>=0.33.0"],
  "version": "2.1.0",
  "iot_class": "local_push"
}

0
2 个月 前
#46510 引用
202409
HACS update ver:2.0    插件提示可以自动升级
0