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:
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.
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
Two class 10 micro SD cards
An 8GB SD card is more than enough. Buy a major brand card with the mention class 10 minimum. You will get better performance with new generation SDXC type II V90 cards (90MB/s).
Choosing a quality SD card is crucial. On the one hand so that the system is fast and on the other hand to avoid breakdowns. SD cards were not designed for such intensive use (not like SSD flash drives).
Buy a second SD card and regularly clone the main SD card (after each update, every month). In case of failure, you can restart your server in a few minutes without having to reinstall everything.
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
You can also retrieve the image of the latest release directly on GitHub.
Once the image is downloaded, you can use BelanaEtcher or Pi Imager to install the Home Assistant image on the micro-SD card.
1Click the Choose Image button located below Operating System. Scroll to the bottom of the list and choose Use Custom Operating.
2Insert the microSD card into the reader, then click SD Card
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 card is automatically ejected.
4If the Raspberry Pi is connected via Ethernet to the local network, you can skip to the First start up step.
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 card). The key must
- Name yourself .
- Be formatted in
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:
- indicate the name of the WiFi network to which HASS must connect
- 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=188.8.131.52;184.108.40.206;
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:
- Connect keyboard and screen (optional)
- Insert the micro-SD card on which the Home Assistant image is installed in which card
- Connect the USB key containing the configuration file (only on first start-up)
- Or connect the Ethernet cable
- Finally turn on the power
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.
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.
Once the update is complete, HASS will ask you a few questions.
Provide your name, login (user name) and password
The scenarios can be triggered according to your address, you can configure it later.
HASS itself searches for home automation accessories that you own. You can add others manually. The list is just impressive!
Here it is, Home Assistant is 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.
- Home Assistant. Get started on Raspberry Pi 4. Procedure 2020
- ESP8266 + DHT22 + MQTT: make a connected object IoT and include it in Home Assistant
- How to Include RFLink Radio Home Automation Devices at Home Assistant (HASS)
- Include ESP8266 + DHT22 + Homie MQTT IoT in Home Assistant (HASS)
- How to include MySensors v2 IoT objects in Home Assistant (HASS)
- #Test: installing and Including the Xiaomi Smart Home Kit on Home Assistant (HASS)
- Soma Smart Shades, Wazombi Labs Solar Connected Curtain Motorization
- Install Home Assistant (HASS) on an Orange Pi running under Armbian
- Home Assistant. Get started on Raspberry Pi 4. Procedure 2020
- Install Domoticz on NAS Synology DS718+ with Docker or virtual machine under Debian Buster
- Install the MQTT Mosquitto broker on NAS Synology (DSM 6.2+) with Docker
- Use the plugins on Domoticz. Manual installation or via Python Plugin Manager
- #Hack of Sonoff S26 WiFi smart plug, Tasmota firmware installation