A hallway light that comes on at sunset is a small thing. A house full of devices that still makes sense when somebody changes phones is a much better project. Home Assistant gives you a place to bring those devices together, and a Raspberry Pi makes a compact, always-on host.
The best first build is deliberately modest: one room, one light, one automation you can explain in a sentence. Get that working reliably before adding the rest of the house.
Choose the right starting point
Use a Raspberry Pi 4 or 5 with at least 2 GB of RAM, a reliable power supply, Ethernet, and a microSD card of at least 32 GB. Home Assistant recommends an A2-rated card. This guide uses Home Assistant OS, its recommended installation for most people, on a dedicated Pi.
Home Assistant OS replaces the operating system on the selected drive. It is not an application you install over an existing Raspberry Pi OS setup. Back up that drive first, and disconnect other removable drives while choosing the imaging target.
Install and open your dashboard
- Install Raspberry Pi Imager on your computer and choose your Pi model.
- Select the Home Assistant OS image for that board from the home automation category.
- Choose the intended microSD card, write the image, and let verification finish.
- Insert the card into the Pi, connect Ethernet to your router, and power it on.
- Open
http://homeassistant.localfrom a device on the same network. If needed, tryhttp://homeassistant.local:8123or your Pi's IP address with port 8123.
Complete onboarding and create your owner account. Add one supported light through Settings → Devices & services. Give it a useful room and name; “Hallway lamp” will make much more sense than a factory model number six months from now.
Make one automation worth keeping
In Settings → Automations & scenes, create an automation. You can use the visual editor or switch that automation to YAML. This example turns on a light at sunset; replace the entity ID with the actual light from your installation.
alias: Hallway light at sunset
description: Turn on the hallway lamp when the sun sets.
triggers:
- trigger: sun
event: sunset
conditions: []
actions:
- action: light.turn_on
target:
entity_id: light.hallway
mode: single
First run the action manually. That tests whether the light is reachable and the entity name is correct. Then inspect the automation trace after an actual sunset trigger. These are different tests: a successful manual run does not prove your location or trigger is right.
Design for the people who live there
Keep a physical way to operate the light. An automation should make a normal action easier, without making the household dependent on a dashboard. Write down what happens if the Pi is off, if the light loses power, and if the internet connection disappears.
Add changes one at a time. If you install several integrations and a new radio adapter together, a failure becomes much harder to isolate. A short project log with dates, device names, and the last working behavior is surprisingly useful.
Back up before the project grows
Create a backup from Home Assistant's backup settings and download a copy to another device. Keep any recovery material alongside it in a secure location. A backup stored only on the same microSD card cannot rescue a failed card.
Home Assistant OS has a different management model from Raspberry Pi OS. Do not paste ordinary apt or systemd instructions into its console. Use Home Assistant's own administration tools; an SSH add-on is not automatically equivalent to full host access for a Pi management app.
When something does not respond
If the dashboard does not open, check your router's device list and use the Pi's IP address. Guest Wi-Fi can prevent devices from seeing one another. If a light works manually but not automatically, inspect the trace, location, time zone, and entity ID before reinstalling anything.
Your next useful improvement is a second automation with a clear purpose, such as a bedtime scene. Once you want custom sensor messages, explore our local MQTT project.
Sources and further reading
- Home Assistant: Raspberry Pi installation
- Home Assistant: automation editor
- Home Assistant: automation triggers
Researched from the official documentation linked above on September 10, 2026. Setup examples are starting points and have not been hardware-tested by Open Pi. Check your board, OS, and the project’s current instructions before installing.