Journal

Installing a Smart Home System with Raspberry Pi 5: Step-by-Step Guide with Real Automation Examples

ติดตั้งระบบ Smart Home ด้วย Raspberry Pi 5 ทีละขั้นตอนพร้อมตัวอย่าง Automation จริง

May 16, 2026 · 1 min read
Installing a Smart Home System with Raspberry Pi 5: Step-by-Step Guide with Real Automation Examples

Why Is Raspberry Pi 5 Still the Best Smart Home Choice in 2026?

The hub market has many options, but RPi5 at 3,500-5,500 THB remains the best value because:

  • BCM2712 Cortex-A76 2.4 GHz: 2-3x faster than RPi4, runs Home Assistant with Frigate NVR without stuttering
  • 4-16 GB RAM: supports hundreds of devices and dozens of simultaneous add-ons
  • PCIe 2.0: connects NVMe SSD instead of SD Card for dramatically better speed and durability
  • Wi-Fi 5 (802.11ac) + BT 5.0: connects without additional USB adapters

Prepare Hardware Before Installation

Required hardware:

  • Raspberry Pi 5 4 GB RAM (sufficient for typical homes) or 8 GB (for device-heavy homes + Frigate)
  • MicroSD Card 32 GB Class 10 (for initial boot) or NVMe SSD via PCIe adapter (recommended)
  • Official RPi5 Active Cooler or heatsink+fan, 350-500 THB
  • Sonoff Zigbee 3.0 USB Dongle Plus (~500 THB) for Zigbee devices
  • Coral USB Accelerator (~2,500-3,500 THB) if using Frigate AI CCTV

Step 1 — Install Home Assistant OS

  1. Download Home Assistant OS image for Raspberry Pi 5 from github.com/home-assistant/operating-system/releases
  2. Open Raspberry Pi Imager → select 'Use custom image' → choose downloaded file
  3. In settings, pre-configure Wi-Fi SSID/Password (saves time)
  4. Write image to MicroSD or SSD → insert into RPi5 → connect power
  5. Wait 5-10 minutes → open browser at http://homeassistant.local:8123
  6. Complete onboarding wizard: name your home, create account, select Bangkok timezone

Step 2 — Connect Zigbee

In HA go to Settings → Devices & Services → Add Integration → Zigbee Home Automation (ZHA) → select Sonoff dongle serial port (typically /dev/ttyUSB0) → Submit.

Then pair Zigbee devices: press pair button on Smart Bulbs, Smart Switches, Air Quality Sensors to enter pairing mode → in ZHA click 'Add Device' → devices appear automatically in HA.

Step 3 — Set Up Security and Air Automation

First bedroom automation:

yaml
Automation: Fresh Air when CO2 high
Trigger: co2_sensor > 900 ppm
Action:
  - service: fan.set_percentage
    entity_id: fan.fresh_air_system
    data: {percentage: 75}
  - service: notify.line
    data: {message: "Bedroom CO2 {{states('sensor.co2')}} ppm - fresh air activated"}

Security automation: when front door camera detects a person → send LINE snapshot immediately.

Step 4 — System Security

Enable Two-Factor Authentication in HA Settings → use an Authenticator app — critical for remote access. Set passwords at least 16 characters long. Update HA every major release (every 3-4 months) via Settings → System → Updates. For remote access from outside, use Nabu Casa Cloud or VPN rather than opening ports directly.

RPi5-Based Smart Home vs Commercial Hubs

Commercial Smart Home hubs like Samsung SmartThings or Hubitat cost 4,000-8,000 THB but are constrained to their brand ecosystems. RPi5 + HA supports every protocol and brand, costs less, and as open source offers maximum customization flexibility — significantly higher long-term investment value.

Questions & answers

Do I need a monitor and keyboard to install Home Assistant on RPi5?
No. If you pre-configure Wi-Fi in Raspberry Pi Imager before writing the image, HA boots and connects to Wi-Fi automatically. Access it via browser on any computer or smartphone on the same network.
What is the difference between MicroSD Card and NVMe SSD for HA?
SD Cards are slower and have limited write cycle lifespans — they can corrupt when HA restarts frequently. NVMe SSD is 5-10x faster and dramatically more durable. A 256 GB NVMe at approximately 600-1,200 THB is well worth the investment long-term.
How many Zigbee devices does the Sonoff Zigbee 3.0 USB Dongle Plus support?
The Sonoff Zigbee 3.0 Dongle Plus with EFR32MG21 chip theoretically supports over 200 Zigbee devices. In practice, 50-100 devices in a mid-sized home work excellently. Devices acting as Zigbee routers (like always-plugged smart plugs) extend the mesh network coverage.
How do you set up Two-Factor Authentication in Home Assistant?
Go to Settings → People → select user → scroll to Multi-factor Authentication modules → enable 'Time-based One-Time Password (TOTP)' → scan QR code with Google Authenticator or Authy → enter verification code. Once enabled, every login requires a 6-digit code from the app.
Can HA work with Xiaomi and Dyson Air Purifiers simultaneously?
Yes. HA supports Xiaomi Mi Home integration for Xiaomi purifiers and the Dyson integration for Dyson products, running simultaneously in the same system. You can create automations that control both purifiers together based on sensor data.

Related reading