【BIGTREETECH CB1】—— Installing HomeAssistant
[Copy link]
2. CB1_HomeAssistant_notes
2.1. Install HomeAssistant-Core using the system's own Python
2.1.1. Install home-assistant-core according to the tutorial on HomeAssistant official website
https://www.home-assistant.io/installation/raspberrypi#install-home-assistant-core
-
The debian image is switched to the tuna image source of Tsinghua University in China
Refer to the Debian mirror usage help ( https://mirrors.tuna.tsinghua.edu.cn/help/debian/ )
sudo you /etc/apt/sources.list
# The source mirror is commented out by default to increase the speed of apt update. You can uncomment it if necessary. deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
debhttps://mirrors.tuna.tsinghua.edu.cn/debian/bullseye-backports main contrib non-free # deb-srchttps://mirrors.tuna.tsinghua.edu.cn/debian/bullseye-backports main contrib non-free
debhttps://mirrors.tuna.tsinghua.edu.cn/debian-securitybullseye-security main contrib non-free # deb-srchttps://mirrors.tuna.tsinghua.edu.cn/debian-securitybullseye-security main contrib non-free
-
Switch pip source
Downloading from pip's official website is too slow (40KB/s). Refer to Python to modify the pip source to the domestic source ( https://www.cnblogs.com/137point5/p/15000954.html )
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
-
The difference from the text is
The original text is for Raspberry Pi, which has built-in gpio and i2c user groups, but the CB1 system does not have these user groups, so the command
sudo useradd -rm homeassistant -G dialout,gpio,i2c
Should be changed to
sudo useradd -rm homeassistant -G dialout
-
Run at the end
pip3 install homeassistant==2023.2.0
An error occurred, saying that the 2023.2.0 version of HomeAssistant was not found.
-
Maybe the pip source has not been updated yet.
-
Note: Later, in the installed HomeAssistant, it will be prompted that the current system Python version is 3.9, which has been disabled in version 2023.2.0 and needs to be updated to Python-3.10 or above before it can be used.
-
Do not specify the latest HomeAssistant version, ie: pip3 install homeassistant
-
The whole process is shown in the figure:
-
The command line result after the installation is completed is as shown below:
2.2. Run and use HomeAssistant-
After installation, enter hass in the command line to run the HomeAssistant service.
(Note: From the command line output information, you can see that the previous installation of pip3 install home-assistant==2023.2.0 failed because HomeAssistant-2023.2 stopped supporting the current Python-3.9.2 version, so you can only install the latest version supported by python-3.9.2 - HomeAssistant-2023.1.7)
2.2.1. Configuring HomeAssistant
Enter http://XXXX:8123 (replace XXXX with your machines' IP address) in the browser address bar to enter the HomeAssistant browser interface. The initial configuration is as follows:
-
First, create a user
-
Log in after setting user information:
-
After logging in, automatically discover devices supported by HomeAssistant
During the test, it was found that the router (Huawei AX3 Pro) in the wireless network connected to the system supports HomeAssistant:
-
Settings/repair information
There is an information sign in the Settings on the left sidebar. After clicking it, I found a repair message, which also verified the reason why the previous installation of the latest HomeAssistant-2023.2.0 failed: HomeAssistant-2023.2 will no longer support python-3.9 and requires at least python-3.10 and above.
|