Introduction
This manual was compiled by me after several weeks of studying the forums, for those who want to go my way. Criticism is welcome.
Stack selection
Much has been said about Home Assistant (hereinafter referred to as HA for short), and, in my opinion, this is the most successful smart home system. On the topic of choice, you can read here:
https://habr.com/ru/post/485848/
https://sprut.ai/client/article/546
https://www.lazyhome.ru/index.php/15-overview/22-openhab-majordomo
Why HDD? Many times on the forums they wrote that a raspberry with Home Assistant on board eats SD cards one per year. In addition, HA also writes logs to what extent it is not clear. So no SD.
Equipment in stock
Raspberry Pi 4
HDD
SATA to USB adapter (if necessary)
Monitor
Klava
Laptop (computer) with the ability to record SD cards. (I have a laptop under Windows 10)
Router for access to the network
Home Assistant installation options
The official site offers us several ways to install Home Assistant:
Home Assistant Operating System for Raspberry Pi. The easiest way to install: uploaded the image and no problem. All features are available. Recommended by developers. The downside is the lack of a complete system.
Home Assistant Operating System (VM) Linux. . . . . , . . - Docker. , .
Home Assistant Container. Docker. . - Supervisor.
Home Assistant Core. Python. Home Assistant. - Supervisor.
Home Assistant Supervised. Docker, Supervisor . :
! Home Assistant . , . , .
HA . , HA Home Assistant Operating System. , . , Home Assistant Supervised . , , Debian .
- Linux, Docker . .
Docker .
. .
Debian ( Debian Linux Debian 10 aka Buster (no derivatives)) . Debian 4 . Supervisor.
- . , :
Home Assistant. - .
:
, Supervisor
, Supervisor
Supervisor
: . . .
.
0.
Raspberry WiFi. , DHP IP- Raspberry. , , .
Ubuntu . Ubuntu Server 20.04.2 LTS 64-bit. SD Balena Etcher. ... . , Ububuntu . network-config
WiFi. - :
version: 2
ethernets:
eth0:
dhcp4: true
optional: true
wifis:
wlan0:
dhcp4: true
optional: true
access-points:
" ":
password: " "
:
Raspberry WiFi. . ,
sudo reboot -h now
.
. , ubuntu
. Login incorrect
. -- , . - . , - Ubuntu , . IP MAC ip a
. IP MAC . - .
1. HDD
-.
sudo apt update
sudo apt upgrade -y
sudo apt install rpi-eeprom
. sudo reboot -h now
.
( ):
default
- , ,latest
.
latest
- , -
beta
-
, /.
:
,
latest
(stable
). , USB.default
(critical
) USB.
, default
. -, .
, : sudo rpi-eeprom-update -a
. sudo reboot -h now
.
: Ubuntu USB (HDD) . , 0. : HDD SATA-USB. - . , HDD SSD. HDD Toshiba MK7575GSX .
: ( FAT32) vmlinuz
, ( 7-Zip) vmlinux
. config.txt
, - :
#[pi4]
#kernel=uboot_rpi_4.bin
#max_framebuffers=2
#[pi2]
#kernel=uboot_rpi_2.bin
#[pi3]
#kernel=uboot_rpi_3.bin
, - :
[all]
arm_64bit=1
device_tree_address=0x03000000
kernel=vmlinux
initramfs initrd.img followkernel
. , ...
: wi-fi 0.
. : https://github.com/raspberrypi/firmware/tree/master
. Code
, Download ZIP
. Boot
( !) .dat
.elf
USB . USB . USB 3.0 (, ) . , ... , .
: - Linux - . GitHub' . , - : - , (, latest
), . , , , , sudo apt full-upgrade
Ubuntu , vmlinuz
vmlinux
.
2.
, Docker, Systemd, NetworkManager, AppArmor. Sysstemd AppArmor - .
jq
, - . . sudo apt install jq
. !
NetworkManager. sudo apt install network-manager
. sudo systemctl enable NetworkManager
. . systemd-networkd NetworkManager. , NetworkManager. /etc/netplan
sudo vi /etc/netplan/50-cloud-init.yaml
. : 50-cloud-init.yaml
. , . renderer: NetworkManager
network:
. . yaml . sudo netplan generate
sudo netplan apply
, . systemd-networkd - -sudo systemctl stop systemd-networkd
sudo systemctl disable systemd-networkd
, .
Docker. Docker.
, Docker sudo apt install apt-transport-https ca-certificates curl gnupg-agent \
software-properties-common
.
Docker curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
. , sudo apt-key fingerprint 0EBFCD88
. 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
.
Docker .
sudo add-apt-repository \
"deb [arch=arm64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) \
stable"
sudo apt update
Docker sudo apt install docker-ce docker-ce-cli containerd.io
. , Docker sudo docker run hello-world
.
3. Home Assistant
, Home Assistant! curl -Lo installer.sh https://raw.githubusercontent.com/home-assistant/supervised-installer/master/installer.sh
But we are in no hurry to launch it. Better yet, open it through vi installer.sh
. We find the line and # Pull supervisor image
after it we insert sleep 20
, and then we insert another line HASSIO_VERSION="latest"
. Switch to superuser mode sudo su
and run the script bash installer.sh --machine raspberrypi4-64
. We are waiting for the script to complete. It takes a while to load Home Assistant for the first time. Be patient. If everything went well, you can reach HA at http: // local ip raspberry : 8123. Do not forget to delete rm installer.sh
it is no longer needed.
That's all.