Home Assistant Installation - Raspberry Pi (Part 1)
This covers the basic installation steps to get Home Assistant running on the Raspberry Pi.
Head ove
r to https://www.raspberrypi.com/software/ and get the Raspberry Pi Imager installed for your OS. At the time of writing the latest version is 1.7.5.
Run the application and select "Choose OS", work through the menu "Other specific-purpose OS", "Home assitants and home automation" and scroll down for "Home Assistant", select the either RPi3 or RPi4 depending on your hardware.
Ensure you use a good quality SD memory card, A2 (Application Performance Class) are recommended. I perfer the SanDisk, either Extreme or the Pro series of cards.
Once the card has finished writing, eject the card and insert into the Raspberry Pi and power on.
The Pi will now boot and go through setting up the filesystem to the correct size for the SD card, all this it automatic and requires no interaction, it will however take a few minutes to complete.
Once everything has finished you should end up at a Home Assistant command line, and assuming you have connected a network cable it should have picked up an IP address via DHCP.
Open a web browser and head over to http://homeassistant.local:8123 (or use the ip address listed by IPv4 address for eth0) where you should see home assistant busy setting itself up. 8123 is the default port home assistant runs the web interface on.
Give it some time to work its magic, once this is complete you will be asked to create a user account and asked for the installation name, location, timezone etc. Complete the steps to finish the installation, Home Assistant will also look for any common devices (Hue, Chromecasts etc) and offer to set these up at the end of the installation.
Home Assistant will start you on the dashboard page with some basic weather information based on your location.
Before we go any further, its best to ensure the system has a static IP address, if the address starts changing later, your devices will struggle to communicate properly.
We can do this simply in one of two ways. Either login to your router and assign a static IP to your Raspberry Pi or manually assign an IP address in the Home Assistant settings. I'll cover setting the IP in the system.
To get to this in Home Assistant, open the "Settings" menu at the bottom left, and then go through the "System" and "Network" options. On the network page, we can then chose the network interface we want to use - "ETH0" will be the wired connection and "WLAN0" is the WiFi, if you want to use wireless, leave ETH0 on automatic, and select "WLAN0", you can use the bottom "Wi-Fi" panel to scan for your home network and join it. Once complete, use the IPv4 section to enter the IP you want to use (ensure it's outside of your routers DHCP range or has been reserved in the router so it will not be issued to other devices).
Hit "SAVE" and then open the new address in your web browser (http://ip-adress:8123), you should be greeted with the login page.
Next lets move on to installing MQTT to enable our IoT devices to send messages and communicate with Home Assistant.