Home Assistant. Get started on Raspberry Pi 4. Procedure 2020

Home Assistant 2020 installation procedure on Raspberry Pi 4, Odroid, Intel NUC, SBC Thinkercad, VM Debian
Share on facebook
Share on twitter
Share on linkedin
Share on pinterest
Share on email
Share on whatsapp

Home Assistant (HASS) is a very powerful and secure home automation server entirely written in Python which has an impressive number of plugins (free!). Getting started may seem more difficult compared to Domoticz, but great efforts have been made to simplify in recent years.

 

Tutorial updated on June 25, 2020

Previously, it was possible to simply install HASS with a single command line (like most other home automation software). It’s still possible, but it’s best to use a pre-compiled image. Even if things are going in the right direction, getting started with HASS may still seem a bit technical. The multiplication of names first. Core, Supervised … you end up getting lost. On the installation side, nothing too complicated, just the configuration of the WiFi which requires a temporary USB key: roll:

Recommended material

Home Assistant fits very well with an old Raspberry Pi 3 model B, no problem to recycle an old Raspberry Pi lying on the shelf. If you are new to home automation, I advise you to opt for a Raspberry Pi 4 with at least 2GB of RAM. Home Assistant also works very well on Tinkerboard, Odroid-C2, Odroid-N2 (4GB), Odroid-XU4, Intel-Nuc and virtual machines.

Raspberry Pi 4 Kit (best solution)

Purchasing a Raspberry Pi 4 in the form of a bundle remains the most economical solution. The Raspberry Pi 4 heats more than the previous generation, remember to order a cooling system if it is not included in your kit.

See more kits

Quality 5V / 3A power supply

The Raspberry Pi consumes little but it is preferable to have a power supply that can deliver 2.5A minimum. For a Raspberry Pi 4 or the use of the GPIO and / or the camera module requires a USB-C type 5V / 3A power supply (3000mA)

Micro-USB Power supply for Raspberry Pi 3 model A+, B+ or older

See more power supply and UPS HAT

Two class 10 microSD boards

An 8GB SD board is more than enough. Buy a major brand board with the mention class 10 minimum. You will get better performance with new generation SDXC type II V90 boards (90MB/s).

Choosing a quality SD board is crucial. On the one hand so that the system is fast and on the other hand to avoid breakdowns. SD boards were not designed for such intensive use (not like SSD flash drives).

Buy a second SD board and regularly clone the main SD board (after each update, every month). In case of failure, you can restart your server in a few minutes without having to reinstall everything.

See more high performance SDXC II microSD board

Recover HASS image for Raspberry Pi or other nano-PC

Go to this page to retrieve the image that corresponds to your platform. Currently the development team maintains the following images

  • Raspberry Pi 4 (2GB minimum recommended)
    • Model B – 32-bit (recommended) or 64-bit
  • Raspberry Pi 3
    • Model B and Model B+ 32-bit (recommended) or 64-bit
    • Model A is not supported officially
  • Other nano-PCs
  • Images for older generations (not recommended due to lack of power)
    • Raspberry Pi Zero W
    • Raspberry Pi 2
    • Raspberry Pi!
  • X86_64 / UEFI virtual machines
    • VMDK
    • VHDX
    • VDI
    • QCOW2
    • OVA

You can also retrieve the image of the latest release directly on GitHub.

There is no need to decompress the image

1 download hass home assistant raspberry pi image

Once the image is downloaded, you can use BelanaEtcher or Pi Imager to install the Home Assistant image on the micro-SD board.

1Click the Choose Image button located below Operating System. Scroll to the bottom of the list and choose Use Custom Operating.

start pi imagerpi imager use custom operating sustem hass

2Insert the microSD board into the reader, then click SD Card

pi imager copy home assistant image sd board

3Go to the download folder on your computer and select the previously downloaded HASS image. Start the copy by clicking on Write

The image weighing less than 300MB, the writing operation is very fast. At the end of the operation, the microSD board is automatically ejected.

4If the Raspberry Pi is connected via Ethernet to the local network, you can skip to the First start up step.

WiFi configuration

HASS does not offer any configuration tool for the WiFi connection. You have to go through a small configuration file that you will store on a USB key that you will have to plug in at the first start. It’s a bit special but for the moment it is the solution chosen by the developers. The procedure is detailed in step 4 here (not obvious !!).

1Connect a USB memory stick (or a microSD board). The key must

  • Name yourself CONFIG.
  • Be formatted in FAT32

2Rename the key and format it if necessary.

3Once ready, create a folder called network

4Open a text editor and paste this configuration. Several examples are available here.

5Change your connection parameters:

  • ssid indicate the name of the WiFi network to which HASS must connect
  • psk network password
[connection]
id=my-network
uuid=72111c67-4a5d-4d5c-925e-f8ee26efb3c3
type=802-11-wireless

[802-11-wireless]
mode=infrastructure
ssid=MY_SSID
# Uncomment below if your SSID is not broadcasted
#hidden=true

[802-11-wireless-security]
auth-alg=open
key-mgmt=wpa-psk
psk=MY_WLAN_SECRET_KEY

[ipv4]
method=auto

[ipv6]
addr-gen-mode=stable-privacy
method=auto

It is possible to assign a fixed IP address by replacing method = auto

method=manual
address=192.168.1.111/24;192.168.1.1
dns=8.8.8.8;8.8.4.4;

6Save the WiFi configuration in the network folder under the name my-network.

7Eject the USB memory stick.

Prepare the Raspberry Pi 4

Before turning on the power, connect the elements as follows:

  1. Connect keyboard and screen (optional)
  2. Insert the micro-SD board on which the Home Assistant image is installed in which board
  3. Network
    • Connect the USB key containing the configuration file (only on first start-up)
    • Or connect the Ethernet cable
  4. Finally turn on the power

 

install home assistant hass raspberry pi 4 wifi

 

Do nothing during startup, this phase lasts about a minute.

Access the administrator interface

Once the startup log no longer displays anything new, you can access the administration interface.

Although (almost) everything can be done from the WEB interface, HASS has a command line administration interface. It is easily accessed by tapping the Enter key on the keyboard.

When the command prompt appears, type root.

There is no password! Just the Enter key. You can modify it from the Web interface later

Retrieve the HASS IP address

Home Assistant broadcasts a machine name which is by default homeassistant. If however you prefer to use the IP address, here is how to retrieve it (in case it has not been assigned manually).

Once connected to HASS, enter the login command to access the system commands then ip a to display the network information.

The IP address is located in the WLAN0 info block.

First start of Home Assistant

At the first start, HASS automatically retrieves the last update. It all depends on your internet speed, but it can take around 20 minutes.

Open a browser and enter http://homeassistant: 8123 or http://IP_HASS: 8123 in the URL.

HASS indicates that the update is in progress.

preparing home assistant first boot

Once the update is complete, HASS will ask you a few questions.

As you can see HASS is based on the language used by the internet browser to translate the interface into your language (here in french for example). It’s really great !

Provide your name, login (user name) and password

hass first boot user identification

The scenarios can be triggered according to your address, you can configure it later.

hass first boot

HASS itself searches for home automation accessories that you own. You can add others manually. The list is just impressive!

hass first boot detect devices

Here it is, Home Assistant is ready!

Home assistant ready

And now what to do with Home Assistant?

Your home automation box is ready! Here are other tutorials to go further and why not develop your own home automation accessories based on ESP32 or ESP8266.

 

Click to rate this post!
[Total: 1 Average: 5]

Are you having a problem with this topic?

Maybe someone has already found the solution, visit the forum before asking your question
Ask your question

Share on facebook
Share on twitter
Share on linkedin
Share on pinterest
Share on email
Share on whatsapp

Did you like this project ? Don't miss any more projects by subscribing to our weekly newsletter!

We will be happy to hear your thoughts

      Leave a Reply

      DIY Projects