Home Assistant Smart Home- Step1 – HA Supervised Hub

Idea: Debian 11 + HA Supervised

Home Assistant Supervised installation method allows for greater customization of the system, as well as the potential for installing additional software on the Hub. However, in order to receive official support from HA, it is necessary to install on a pure Debian 11 operating system. Derivatives of Debian are not supported.

Prerequisite

Before beginning, let us identify the installation plan that is most suitable for you and determine what supplies you will need. There are two main installation plans available. Please note: It is necessary to have a fundamental understanding of Linux, and you can learn this from free online classes or Google.

Raspberry Pi case

An ARM-based solution based on Raspberry Pi offers low energy consumption with slightly lower performance, yet is suitable for daily use in a home automation system.

  • Raspberry Pi 4 or 3 – the performance of Pi Zero or Pi Zero 2 are don’t enough
  • SD card / SSD drive – SSD is better option for performance and stability
  • SD card Reader – If you use SD card
  • Cable – hardwired is best, don’t ask why 🙂
  • Keybord
  • Monitor

X86 Mini PC case

An X86 architecture-based mini PC solution offers much better performance than ARM and greater scalability, the downside is it consume energy a bit higher than Raspberry Pi case. Even the older models of mini PCs have enough power to meet most needs, making them a great alternative for those who are experiencing a shortage of supply of the Raspberry Pi.

  • X86 mini PC
  • USB drive – For Debian OS installation
  • Cable
  • Keybord
  • Monitor

Implementation steps

1. Install Debian 11 OS

Download Debian 11 image for installation, bellowing is images for RPi or Mini PC.

Debian 11 for Raspberry Pi
Debian 11 for 64-bit PC

The installation process for each of the two solutions varies. For the Raspberry Pi, an image should be burned to an SD card or SSD drive and then contect to the Pi. For the Mini PC, a USB boot disk should be created, plugged into the Mini PC, and then start the installation process.

2. Enable root SSH

To begin, connect a Network Cable, Monitor and keyboard to your Pi or Mini PC. After that, setup password for root account, and then enable the SSH login as root.

passwd root

Modify /etc/ssh/sshd_config for set “PermitRootlogin” to “yes”

nano /etc/ssh/sshd_config
/etc/init.d/sshd restart
Change “PermitRootlogin” to yes

Once SSH is operational, you can establish a connection via SSH to complete further setup.

3. Install Docker

Use following commands to install Docker and related softwares.

sudo -i

apt update && sudo apt upgrade -y && sudo apt autoremove -y

apt – fix-broken install

apt-get install jq wget curl udisks2 libglib2.0-bin network-manager dbus apparmor-utils systemd-journal-remote lsb-release -y

curl -fsSL get.docker.com | sh

4. Install OS-Agent

It is recommended that you upgrade to the newest version of os-agent instead of 1.4.1 shown bellow.

wget https://github.com/home-assistant/os-agent/releases/download/1.4.1/os-agent_1.4.1_linux_aarch64.deb

dpkg -i os-agent_1.4.1_linux_aarch64.deb

5. Install HA Supervised

Finally, you can begin to install HA Supervised with bellowing command.

wget https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb

dpkg -i homeassistant-supervised.deb

Once the installation process is successful, it may take up to 20-30 minutes for the HA to start functioning, the duration of which may vary depending on the hardware and internet speed.

You can use “docker stats” command to check if HA containers are all in place.

docker stats
All containers for HA supervised

Once you observe all seven docker containers, the installation is nearly complete.

6. Install necessary Add-ons

To begin setting up your HomeAssistant account, open the browser to <HomeAssistantIP>:8123 to access the onbording guide. From there, you can configure your metrics, language, and location settings.

Be sure to enable the Advanced Mode for access to all the features available, you can find the switch in your account profile.

Go to Settings -> Add-ons, you need find and install bellowing Add-ons for next step.

  • File editor – for edit YAML files
  • Terminal & SSH – for install HACS
  • Duck DNS – for Remote access
  • MariaDB – replace SQLlite for better performance
  • Samba Share – Simple File shared in local Network
  • Dnsmasq – local DNS server

7. Install HACS

The HACS (Home Assistant Coumnity Store) is a marvelous resource for incorporating additional Loveplace, Theme, and Integration.you can find it in the community store in the Home Assistant UI. The HACS allows users to easily find, install, update, and configure integrations in a few steps. It also provides a platform for developers to share their custom integrations with the community. Moreover, the community store allows users to review the integrations and provide feedback. This makes it easier for users to find the right integrations for their needs.

wget -O - https://get.hacs.xyz | bash -

Once the installation is complete, restart the HA service and clear your browser’s cache (simply press F12 in Chrome). You can then add HACS as an integration, following the guide, after which you will be able to find HACS in the sidebar.

  • Add HACS in integration

Trouble Shooting

The process of installation is complex, with many components and configurations, and it is not uncommon for errors to arise. Do not be disheartened, as there are solutions available to address them. Here are some of the most frequent errors and the corresponding solutions.

Dnsmasq: can’t run because port 53 is in used

By default, Debian local DNS service named “systemd-resolve” will running and use port 53, you need to stop and remove it.

apt-get install lsof

lsof -i:53

systemctl stop systemd-resolve

nano /etc/systemd/resolved.conf

Uncomment “DNSStubListener=yes” and change it to “DNSStubListener=no”, it will make systemd-resolve not use port 53.

[Resolve]
# Some examples of DNS servers which may be used for DNS= and FallbackDNS=:
# Cloudflare: 1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001
# Google:     8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844
# Quad9:      9.9.9.9 2620:fe::fe
#DNS=
#FallbackDNS=
#Domains=
#DNSSEC=no
#DNSOverTLS=no
#MulticastDNS=yes
#LLMNR=yes
#Cache=yes
#
DNSStubListener=no

Save the file, then restart the service systemd-resolve with command: systemctl start systemd-resolve

HACS: connection refused

can’t connect to remote host

Try to ping “raw.githubusercontent.com”, if you can’t get any host info, then you meet DNS cache pollution,to fix it, go to “Terminal & SSH”, use “nano /etc/hosts”. Add a new line “raw.githubusercontent.com 185.199.108.133” , then you can continue HACS. Note: this is a temporary fix, once the HA is reboot, the record in /etc/hosts will gone.

Leave a Reply

Your email address will not be published. Required fields are marked *