Install Raspberry Pi OS Lite 64bit with the Raspberry Pi Imager.
Enable ssh with key authentication, change the host name, set the user password, the WiFi password. etc.
-
Boot the Pi.
-
Disable MAC randomization
In order for the router to be able to assign Pi a static IP.
In /etc/NetworkManager/conf.d/100-disable-wifi-mac-randomization.conf
:
[connection]
wifi.cloned-mac-address=preserve
[device]
wifi.scan-rand-mac-address=no
- Configure wifi with the NetworkManager
This needs to be done on a cable connection or with a keyboard/monitor pluggined in to your PI.
sudo service NetworkManager start
nmcli dev wifi list
sudo nmcli dev wifi connect "<network-ssid>" password "<password>"
nmcli device status
Enable the NetworkManager service:
sudo raspi-config
Advanced Options -> Network Config -> NetworkManager.
The rest of the setup can be done on wifi.
- Enable uart
This is RaspBee specific.
In /boot/config.txt
:
enable_uart=1
#dtoverlay=miniuart-bt
Alternatively:
sudo raspi-config
Interfacing Options -> Serial:
- Would you like a login shell accessible over serial? → No
- Would you like the serial port hardware to be enabled? → Yes
- Update motd.
sudo vi /etc/motd
_ _ _
/\/\ __ _ | |(_) _ __ | | __ __ _
/ \ / _` || || || '_ \ | |/ / / _` |
/ /\/\ \| (_| || || || | | || < | (_| |
\/ \/ \__,_||_||_||_| |_||_|\_\ \__,_|
- Reboot.
- Install Home Assistant dependencies.
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install apparmor cifs-utils jq wget curl udisks2 libglib2.0-bin network-manager dbus systemd-journal-remote lsb-release nfs-common systemd-resolved -y
sudo apt --fix-broken install
sudo reboot
- Install docker.
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker pi
rm get-docker.sh
- Install Home Assistant OS agent.
https://github.com/home-assistant/os-agent/releases/latest
wget https://github.com/home-assistant/os-agent/releases/download/1.6.0/os-agent_1.6.0_linux_aarch64.deb
sudo dpkg -i os-agent_1.6.0_linux_aarch64.deb
rm os-agent_1.6.0_linux_aarch64.deb
https://github.com/home-assistant/supervised-installer
wget https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb
sudo dpkg -i --ignore-depends=systemd-resolved homeassistant-supervised.deb
rm homeassistant-supervised.deb
Choose raspberrypi4-64
as a machine type, unless running a 32bit version of Raspberry Pi OS (in which case, select raspberrypi4
).
- Enable apparmor in case it wasn't enabled.
sudo systemctl enable --now apparmor.service
Add the following parameters to the kernel boot parameters in /boot/cmdline.txt
:
apparmor=1 security=apparmor systemd.unified_cgroup_hierarchy=0
- Reboot.
deCONZ can be installed as a Home Assistant addon via the UI. The addon needs to be configured to use /dev/ttyS0
(/dev/ttyAMA0
if miniuart-bt dtoverlay is enabled).
Any existing configuration needs to be put to /usr/share/hassio/addons/data/core_deconz/.local/share/dresden-elektronik/deCONZ
.
Configure the cloudflared addon.
/lib/systemd/system/ddclient.service:
[Unit]
Description=DDClient
Requires=docker.service
After=network.target docker.service
[Service]
Restart=always
RestartSec=5s
ExecStart=/usr/bin/docker run -t --rm --name=ddclient -e PUID=1000 -e PGID=1000 -e TZ=Etc/UTC -v /etc/ddclient:/config lscr.io/linuxserver/ddclient:latest
ExecStop=-/usr/bin/docker stop ddclient
[Install]
WantedBy=multi-user.target
/etc/ddclient/ddclient.conf:
daemon=1200
syslog=yes
ssl=yes
use=web
web='https://cloudflare.com/cdn-cgi/trace'
web-skip='ip='
protocol=cloudflare
zone=example.com
ttl=1
password=api-token-value-here
example.com
sudo systemctl enable ddclient.service
sudo systemctl start ddclient.service