HuckleberryLovesYou / Homeassistant-Supervised-on-Raspberry-Pi-5

This is a tutorial about the installation of Homeassistant Supervised on your Raspberry Pi 5 running Raspberry Pi OS 64bit
27 stars 9 forks source link

Homeassistant-Supervised-on-Raspberry-Pi-5

This is a tutorial about the installation of Homeassistant Supervised on your Raspberry Pi 5 running Raspberry Pi OS 64bit.

If something doesn't work, make sure to check out the Troubleshooting Section at the bottom of this README.

Skip the blah

Didn't find a fix for your Problem? Feel free to open an issue in this repository!

Found something, that wasn't described good or wrong? Feel free to open an issue in this repository!

Contents

Introduction

First of all - Why even HA-Supervised?

It's pretty simple:

want_addons = %true/false%
want_control_over_system = %true/false%

if want_addons == true:
   if want_control_over_system == true:
      print("Get HA-Supervised")
   else:
     print("Get HA-OS") 
else:
   print("Get HA-Core")

Or in words: If you want to use add-ons, then the only option is to use HA-OS or HA-Supervised. If you don't want add-ons and only care about integrations, then you can use HA-Core. If you decide to want add-ons, you can now either decide between giving away all of your opportunities and just having wasted 90 bucks on a Pi 5, which isn't used more than 10%, or having nearly every possible control over your system and not being restricted by your OS.

Or click here to see an overview of all installation methods

Supported or Unsupported

When am I running an unsupported System? For the entire list, take a look here

What could be the problem with having an unsupported system?

Requirements

It might take up to a minute. Don’t cancel at any time!

You can check if the docker-installation works by using the following command

sudo docker run hello-world

If you want to run Portainer as well, take a look here

Installation of Homeassistant dependencies

From now on, everything needs to be executed as root and does NOT support sudo anymore. So, change into root-mode:

sudo su -

Update every Package on your Device.

apt update && apt upgrade -y

Now install all the required Dependencies. You might have to restart depending if of there was a kernel update going on or not.

apt install apparmor jq wget curl udisks2 libglib2.0-bin network-manager dbus systemd-journal-remote cifs-utils lsb-release nfs-common systemd-resolved -y && systemctl restart systemd-resolved.service

Download os-agent

Today, the newest verison is 1.6.0. If you do that in the future, you may want to check for a newer version. To do that, go to this GitHub page, scroll to the newest release and right-click on the asset called os-agent_%Newest Version%linuxaarch64.deb Hit right click while hovering the file. Then click on copy link address and put it in the command below. It should then look like the following example except for the version-number.

wget https://github.com/home-assistant/os-agent/releases/download/1.6.0/os-agent_1.6.0_linux_aarch64.deb
# You can type "ls" to ensure the download was succesful

Install os-agent

To do that, we use dpkg. Using Tab, the filename completes itself after a few characters.

dpkg -i os-agent_%Your above downloaded Version%_linux_aarch64.deb

You can test if the installation was successful by running:

sudo apt install libglib2.0-bin && gdbus introspect --system --dest io.hass.os --object-path /io/hass/os

This should NOT return an error. If you get an object introspection with interface etc. OS Agent is working as expected.

Install Homeassistant

Download Homeassistant-supervised

Today, the newest version is 1.6.0. By using the following command you automatically download the latest version of Homeassistant. If you still want to check, you can do this on this Github page

wget -O homeassistant-supervised.deb https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb
# You can type "ls" to ensure the download was succesful
# The -O  is there to overwrite exiting files if there are, which makes troubleshooting easier, by having no need to uninstall it after an error.

Installation of Homeassistant-supervised

To install execute the following command.

apt install ./homeassistant-supervised.deb -y

During the Installation, you get asked “Select machine type”. Choose the "pi5-64bit" version.

Near the end there should be this output.

[info] Install supervisor startup scripts
[info] Install AppArmor scripts
[info] Start Home Assistant Supervised
[info] Installing the ‘ha’ cli
[info] Switching to cgroup v1
[info] Within a few minutes you will be able to reach Home Assistant at:
[info] http://homeassistant.local:8123 or using the IP address of Raspberry Pi
[info] machine: http://<Your Pi’s IP Address>:8123

After setup is finished without errors, you can go on.

Restart your entire system with the following command.

reboot

If you get the error "Depends: docker-ce but it is not installable" take a look at here #5

Accessing your Homeassistant Website

Access your Homeassistant-GUI by entering the following in your browser’s address bar. Make sure to use http and NOT https. You can also use the hostname that you set, like shown in the second example. To find out your Pi's IP you can either look in your router's network tab or use the following command. The standard homeassistant port is 8123.

hostname -I
http://<Your Pi's IP-Adress>:8123

E.g.http://192.168.2.5:8123

http://<Your Pi’s hostname>:8123

E.g.http://raspberrypi:8123 # Standard hostname is raspberrypi

Troubleshooting

Error while installing Homeassistant-Supervised.deb caused by wrong os-agent

If something goes wrong with the Installation of Homeassistant Installer, you can try to uninstall the OS-Agent with the following

sudo dpkg -r os-agent

After that you can dwonload the right version of the os-agent and reinstall it.

dpkg -i os-agent_%Your Version Number%_linux_x86_64.deb

Now, install Homeassistant with the same command as mentioned above, because it already overwrites everything.

Use Portainer anyway

To bypass the container name check, you have to name the portainer-container differently. Remove any old Portainer images like shown below:

sudo docker rmi portainer/portainer-ce

Now pull the image again.

sudo docker pull portainer/portainer-ce:latest

Now rename the image

sudo docker tag  portainer/portainer-ce:latest iamnotportainer

Now start a docker-container

sudo docker run -d -p 9000:9000 -p 8000:8000 --name iamnotportainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data iamnotportainer

Now check if the container was named the right way

sudo docker ps -a

After that you can restart HA

If you run into any problems, you might want to try the following commands:

sudo systemctl daemon-reload
sudo systemctl restart docker

Docker Issue: cgroups: memory cgroup not supported on this system

If you get the following message in your docker logs:

level=error msg="add cg to OOM monitor" error="cgroups: memory cgroup not supported on this system"

Fix it by adding "cgroup_memory=1" and "cgroup_enable=memory" in /boot/firmware/cmdline.txt:

sudo nano /boot/firmware/cmdline.txt

Add this to cmdline.txt:

cgroup_memory=1 cgroup_enable=memory

And now reboot your system:

sudo reboot

For further information, take a look here and here

Referring to issue #1 by corgan2222