Home Assistant on an Orange Pi Zero

This blog post is about the setup of Home Assistant on an Orange Pi Zero. Like the setup on a Raspberry Pi Zero it will only take a couple of minutes to get a fully functional super cheap (less than 18 Euro incl. casing and power supply) Home Assistant hub. The reasons to use an Orange Pi Zero beside the prize are the built-in Ethernet port and the availability.

![](upload://vnf6s0pZ0eLPZg6M5y2m9NtBTqX.png)

Download the Armbian and create the SD card with Etcher. There is no possibility to connect a display to the Orange Pi Zero. This means that you need a wired network setup with DHCP server. After your Orange Pi Zero is running, give it some time, and look for its IP address. The hostname is orangepizero.

If you found the IP address then use your SSH client to connect to the Orange Pi Zero. The default password is 1234.

$ ssh [email protected]
[...]
[email protected]'s password: 
You are required to change your password immediately (root enforced)
  ___                               ____  _   _____
 / _ \ _ __ __ _ _ __   __ _  ___  |  _ \(_) |__  /___ _ __ ___
| | | | '__/ _` | '_ \ / _` |/ _ \ | |_) | |   / // _ \ '__/ _ \ 
| |_| | | | (_| | | | | (_| |  __/ |  __/| |  / /|  __/ | | (_) |
 \___/|_|  \__,_|_| |_|\__, |\___| |_|   |_| /____\___|_|  \___/ 
                       |___/                                     
Welcome to ARMBIAN 5.27.170514 nightly Ubuntu 16.04.2 LTS 4.11.0-sun8i
System load:   0.86 0.35 0.13  	Up time:       9 min
Memory usage:  5 % of 496MB  	IP:            192.168.0.151
CPU temp:      39°C
Usage of /:    16% of 7.1G
[ General system configuration: armbian-config ]
New to Armbian? Check the documentation first: https://docs.armbian.com
Changing password for root.
(current) UNIX password: 
Enter new UNIX password: 
Retype new UNIX password: 
You are using Armbian nightly build.
It is provided AS IS with NO WARRANTY and NO END USER SUPPORT.
Creating a new user account. Press <Ctrl-C> to abort
Please provide a username (eg. your forename): ha
Trying to add user ha
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = "en_US.UTF-8",
	LC_ALL = (unset),
	LC_PAPER = "de_CH.UTF-8",
	LC_MONETARY = "de_CH.UTF-8",
	LC_NUMERIC = "de_CH.UTF-8",
	LC_MESSAGES = "en_US.UTF-8",
	LC_MEASUREMENT = "de_CH.UTF-8",
	LC_TIME = "de_CH.UTF-8",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
Adding user `ha' ...
Adding new group `ha' (1000) ...
Adding new user `ha' (1000) with group `ha' ...
Creating home directory `/home/ha' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Changing the user information for ha
Enter the new value, or press ENTER for the default
	Full Name []: homeassistant
	Room Number []: 
	Work Phone []: 
	Home Phone []: 
	Other []: 
Is the information correct? [Y/n] y
Dear homeassistant, your account ha has been created and is sudo enabled.
Please use this account for your daily work from now on.
[email protected]:~# 

Get the latest details about the packages.

[email protected]:~# apt-get update
Hit:1 http://ports.ubuntu.com xenial InRelease
Get:2 http://ports.ubuntu.com xenial-security InRelease [102 kB]
Hit:3 http://beta.armbian.com xenial InRelease
Get:4 http://ports.ubuntu.com xenial-updates InRelease [102 kB]
Get:5 http://ports.ubuntu.com xenial-backports InRelease [102 kB]
Get:6 http://ports.ubuntu.com xenial-updates/main armhf Packages [479 kB]
Get:7 http://ports.ubuntu.com xenial-updates/universe armhf Packages [419 kB]
Fetched 1205 kB in 7s (158 kB/s)
Reading package lists... Done

Let’s run an upgrade to make sure that all available packages are up-to-date.

Now, we are installing the requirements for Home Assistant.

Those steps to install Home Assistant are described in the documentation and the guide for venv as well. Switch to the create user ha and perform the remaining installation steps which are reduced to the minimum below:

![](upload://64NYcG1XIlgQlm28DsEXGKu3dFJ.png)

To make it ready for daily usage, don’t forget to enable autostart.


This is a companion discussion topic for the original entry at https://home-assistant.io/blog/2017/05/13/home-assistant-on-orange-pi-zero/

Thanks for this guide. It, however, only deals with installing Home Assistant, not the more capable HassIO. Installing HassIO (and thus Home Assistant) is a breeze under Armbian Bionic (haven’t tested below Bionic).

Follow the instructions above to right after apt-get upgrade. Then instead of downloading the Home Assistant image, run armbian-config.

root@orangepizero:~# armbian-config
select: network->WiFi
connect to your router, then tab to to return to previous menu

Now go to Software->Softy
select hassio, machine type gemuarm

Hassio will now install. Reboot and surf to your Orangepi at port 8123
In the example above, that would be http://192.168.0.151:8123
hassio.local:8123 does not seem to work in my setup yet.

Not everyone agrees that the additional load of Docker on a low power system is a good idea. The functionality of most addons available in Hasso can be installed for Home Assistant too.

Having run Home Assistant on an Orange Pi Zero, I’d say this is fine for testing and to find out if HA is “right” for you. But as a reliable production system, no way.

My initial HA install on a Zero worked fine with a few entities. However once I put it into production and began adding sensors, other platforms besides MQTT, etc. it ran out of memory very quickly having only 512MB.

I was getting out of memory issues every few days. Causing services to shut down and the Zero to become unresponsive until a power cycle. After battling it, and actually considering that I had made a mistake in relying on HA, the Zero failed with a burned processor.

Moved HA to a 15 year old Pentium M laptop running Ubuntu and it has been rock solid since. Plus about 100x faster. As in, the History and Logbook is actually usable.

Hello, do you have the store add-on with your installation?

What is the store add-on?

Hi @magatst, welcome to the community.

You may be referring to either the Supervisor Add-ons or HACS.

The former depends on which install method you choose and the latter is installed independently, afterwards.

It gave me an error as below.

fatal error: ffi.h: No such file or directory
             #include <ffi.h>
            compilation terminated.

You need to enter the following command.

apt install libffi-dev cargo rustc

Orange Pi Zero H2+ 512Mb, HASS 2024.3.1, Armbian 24.2.1

It’s still possible to run HA on Pi Zero, but 512Mb is not enough for install, so I’ve done this with qemu.

  1. Get Armbian_24.2.1_Orangepizero_bookworm_current_6.6.20.img
  2. Expand it to pow 2 untill QEMU wrongly requires SD card sizes to be a power of two (#1754) · Issues · QEMU / QEMU · GitLab is not fixed:
qemu-img resize Armbian_24.2.1_Orangepizero_bookworm_current_6.6.20.img 4G
  1. Extract boot: insert loop with max_part specified, losetup, mount, copy, umount.

  2. Start qemu as described here: Orange Pi Zero running in QEMU – Dejvino's notebook

  3. Inside qemu

apt update
apt dist-upgrade
apt install python3-pip python3-virtualenv python3-dev pkg-config cmake cargo libjpeg-dev libturbojpeg0-dev libffi-dev liblapack-dev libblas-dev libopenblas-pthread-dev libopenblas-dev libatlas-base-dev ffmpeg libavdevice-dev

adduser --system --group --home /srv/hass hass
sudo -su hass

virtualenv /srv/hass
source bin/activate
pip3 install --upgrade pip
pip3 install homeassistant

add systemd unit: /etc/systemd/system/hass.service

[Unit]
Description=Home Assistant
Requires=network.target

[Service]
Type=simple
ExecStart=/srv/hass/bin/hass
User=hass
Group=hass

[Install]
WantedBy=multi-user.target
  1. Stop qemu, write image to sdcard, extend volume.
pv Armbian_24.2.1_Orangepizero_bookworm_current_6.6.20.img > /dev/sda
parted /dev/sda resizepart 1 100%
e2fsck -f /dev/sda1
resize2fs /dev/sda1