Install Home Assistant (HASS) on an Orange Pi running under Armbian

Home Assistant is a home automation server fully developed in the Python language, so it is possible to install it on an Orange Pi. For this tutorial, I used an Orange Pi+ 2e equipped with 16GB of memory eMMC working Armbian. Home Assistant has evolved a lot in one year. It is now possible to install it (or test it) in a virtual environment. It is also possible to test it through Docker without any (almost) installation. To do this, read the article how to test home automation software easily with Docker.

Install Home Assistant on Armbian

Since December 2016, it is recommended to install HASS in a virtual Python environment. This installation makes it possible to isolate the home automation server from the rest of the Linux distribution. This configuration increases the security of the system. In return, maintenance is a bit more complicated (and installation if done manually). It is possible to manually install Home Assistant by following this tutorial. However, I advise you to use the All-In-One installation script developed for the Raspbian distribution of Raspberry Pi.

What does the All-In-One Installer script do?

The All-In-One script (detailed here) takes care of installing and configuring the HASS home automation server:

  • Created all necessary directories
  • Created the necessary accounts and groups
  • Installs dependencies (Python, Linux)
  • Configures a Python virtual environment to run Home Assistant and its components regardless of the administrator account (better security)
  • Installs Mosquitto broker with web support (ports 1883 and 9001)
  • Created and installed Python-openzwave in the virtual Home Assistant environment
  • Created the openzwave-control-panel in / srv / homeassistant / src / open-zwave-panel
  • Configures the SystemD service so that HASS starts automatically at system startup

Install HASS with the All-In-One script

Log in to your Orange Pi (or Raspberry Pi) in SSH with an administrator account (root) and execute the following command that launches the installation script suited to the Raspberry Pi (and also works smoothly on Orange Pi).

Installation may take some time (especially if the system needs to be updated). Count about 1 hour on an Orange Pi + 2e.

Useful commands to know

At the end of the installation, the system will restart automatically. Home Assistant is not a war lightning at startup. Depending on the configuration, HASS may take a few minutes to start. At first boot, there may also be some dependencies to install. So we have to be patient.

Learn about the state of the server with the command journalctl

As HASS starts automatically at startup, we are (a little) blind. It is possible to know the state of the server using several Linux commands. First of all one can know the state of the server with the command systemctl . The following command allows to know the status of the server (its status) as well as possible errors in the configuration file.

[box type = “info” align = “” class = “” width = “”] Please note that the command must be preceded by a sudo.[/wpsm_box]

By replacing the status argument, the systemctl command also allows you to restart the server (restart) or stop it.

The command journalctl is the command associated with systemctl, which allows you to display the execution log of it.

  • -u specifies the service
  • -f allows to follow (follow) in real time the log of the service

Type CTRL + C on the keyboard to interrupt the execution of the command.

Follow home-assistant.log

Finally, the log (log) of HASS can be tracked in real time using the linux tail command with the -f (follow)

That’s it. To connect to the server, as usual, open a web browser and enter the IP address followed by port 8123. From Armbian, type localhost: 8123 in the address bar.

Update Home Assistant

Since HomeAssistant is running in a virtual (and protected) Python environment, the upgrade procedure is a bit more complicated. Connect SSH to your Raspberry Pi or Orange Pi and then run the following command to switch users

Then change the source of the Python virtual environment

Finally, launch the update

Execute the exit command to disconnect from the homeassistant account. The update is complete.

Here is an excerpt of an update (version 0.44.1)

Subscribe to the weekly newsletter

No spam and no other use will be made of your email. You can unsubscribe anytime.

  • tl5k5

    I’m about to do this build with my daughter for a school science project. What are your thoughts on setting up a portable bluetooth speaker w/mic for the audio i/o?

    • Hello Tl5. It’s a great project. I think we need to disassociate the audio output and the speech recognition (the microphone). I think you want to make a project similar to Google Home or Alexa. In my opinion, connecting the bluetooth speaker is not a problem. For the microphone I bought this dongle (I also work on the subject … but it’s secret 😉 )

      • tl5k5

        Doesn’t the OP 2+e have an on-board mic? Can it be used instead of the UDB mic?

        • Absolutely. Excuse me, I had not seen that the subject was posted on an article about Orange Pi. Yes it is certainly possible but I have not yet found time to test the microphone. I look as soon as I have a moment

  • Edu Castellini Dourado

    I made this process but dont have a tab to install other components.
    Its possible to install componet after the install of All-In-One script…?

DIY Projects