Smart Home

How I built a smart home with Home Assistant using Zigbee, BLE, Wi-Fi and a bunch of automations


Today I want to share my experience building a setup on Home Assistant. I'm a developer, so most of the technical stuff clicked for me right away. But I clearly remember the moment I first figured out why some integration had been breaking my entire "smart" home for three days.

My home server slash smart home isn't something I planned out from day one β€” it just evolved naturally over time. Wi-Fi, Zigbee, and Bluetooth all live under the same roof, alongside a colorful mix of brands: Aqara, Xiaomi, Tuya, and more. The real power of Home Assistant is that it brings this whole zoo of gadgets together into one system. On top of that, it's dead simple to share access with family β€” everyone gets their own account with their own dashboard, notifications, and permissions. No need to explain YAML to anyone β€” just hand them access through the companion app.

HA

🧰 My Tech Stack: Why One Protocol Is Boring

I never tried (and frankly didn't know how) to build everything on a single protocol β€” I just liked experimenting. Home Assistant became the perfect "translator" for this zoo.

  • πŸ“‘ Zigbee2MQTT + Mosquitto β€” dozens of sensors, buttons, and bulbs through one coordinator, no proprietary hubs from each vendor
  • πŸ“Ά BLE / BTHome β€” thermometers, soil sensors. No cloud, no lag β€” data straight into HA
  • πŸ“» Wi-Fi β€” bulbs, smart plugs with energy monitoring, robot vacuum. Local control, minimal cloud dependency
  • 🎡 Media β€” TV, console, soundbar, media players β€” all in one interface with automation triggers

βš™οΈ System Flows: How My Smart Home Actually Works

Instead of just tapping buttons on my phone, I focused on automations that understand context and work for me, not through me.

1. Energy and Safety

In the current reality, this is priority number one. I have two portable power stations from different brands integrated into the system.

πŸ“‘ Remote monitoring. A lot of people don't know that some power stations only work over Bluetooth β€” no Wi-Fi at all. Checking the charge remotely? Impossible. I got around this with a custom HACS integration that pulls all the metrics via BLE from the Raspberry Pi and feeds them into HA. The second station connects through the manufacturer's official integration.

⚑ Power outage alerts. An automation watches the AC input on the power station. When nobody's home (presence toggle is off), the system instantly notifies me when power comes or goes. So I always know what's happening with electricity, even when I'm away.

πŸͺ« Critical charge. If any station drops below 25% β€” instant push notification. The automation runs in parallel mode, handling multiple triggers at once.

🚨 Air raid alert aggregator. Home Assistant monitors several air raid alert sources through a specialized integration. The automation fires when any source picks up a threat for my specific district (in Kyiv right now, this is very much a real need), sending a notification about a nearby threat. The push breaks through iOS silent mode (critical: 1, interruption_level: critical) and includes the latest message about the threat type. Three sources instead of one β€” redundancy that's absolutely worth it here. There's also the official Ukraine Alarm integration.

2. Physical Buttons

One thing I totally underestimated at first β€” wireless Zigbee buttons. Cheap, no wires, and via Zigbee2MQTT each one supports multiple actions: single press, double press, and long press.

Every room has its own button with its own logic:

  • Single press β†’ toggle main light
  • Double press β†’ all lights in the room (ceiling, desk lamp, LED strip)
  • Long press β†’ kill everything in the apartment

The "kill everything" action lives on every remote β€” it's my "leaving home" shortcut. One long press, and the apartment goes to sleep.

3. Lighting That Respects You

This is the trickiest automation layer. At its core is the Adaptive Lighting component, which gradually shifts brightness and color temperature throughout the day to mimic natural sunlight.

β˜€οΈ During the day β€” a cool, alert spectrum; πŸŒ™ at night β€” warm, dim light to wind down for sleep.

🚢 Auto-on by motion. Rooms have motion sensors with lux measurement. Lights only kick in when it's dark (illuminance < 100lux) and there's motion. No motion for 5 minutes β€” lights off. Super handy in the kitchen: walk in β€” lights on, walk out β€” lights off.

βœ‹ Manual Override. The biggest headache with any automation: it turns the lights on when you want darkness. I solved this by checking the event context. When I manually switch off a lamp, the system detects it through the missing parent_id in trigger.to_state.context β€” meaning the action came from a human, not an automation. The adaptive mode flag for that zone gets disabled, and the automation backs off. Turn the light back on manually β€” the flag resets, automation kicks back in. This pattern is used in every room. It's elegant because it doesn't need extra buttons or modes β€” the system just "gets" whether the action was mine.

πŸ”„ Fallback logic. If the main light goes unavailable for whatever reason (say, the bulb got unplugged), the automation switches on a backup USB desk lamp instead of leaving the room in the dark.

🎬 Media mode. TV turns on β€” adaptive lighting turns off. Console or media player starts playback β€” all lights in the room go dark. Turn off the TV β€” adaptive mode comes back. Zero manual effort.

HA

4. Household Helpers

πŸ‘• Laundry tracking. Through a smart plug with power monitoring, the system tracks the washing machine's cycle. Consumption goes above 2W for over a minute β€” laundry started. Power drops below 1W for a minute β€” it's done, push notification: "Don't forget to grab the clothes!" A simple flow that saves a lot of forgotten laundry sitting in the drum.

πŸ’¨ Smart humidifier. My humidifier has no water level sensor β€” a classic budget device problem. The automation kicks in 2 hours after sunset (when the air is driest), but only if humidity from the BLE thermometer reads below 40%. Then:

  1. πŸ’Ύ Current humidity is saved
  2. ▢️ Humidifier turns on at medium
  3. πŸ” After 5 minutes β€” check: if humidity hasn't gone up, the water tank is empty. Device shuts off, notification sent
  4. βœ… If humidity is climbing β€” the system waits for 50%, then turns off the humidifier and reports the result

All the logic lives in one automation, no extra scripts.

πŸ€– Robot vacuum. Integrated via HACS with full room map support. The dashboard shows the vacuum's position, lets you start cleaning specific rooms, and track consumable wear.

🌱 Plants under control. BLE soil moisture sensors hooked up for houseplants. When moisture drops below the threshold β€” my wife gets a notification. No plant goes forgotten, and I don't hear "you could've reminded me."

5. Presence System

The core piece β€” a boolean presence toggle. It's a manual switch (not automatic GPS tracking), because the neighboring shithole country regularly launches ballistic missiles and GPS in the city drifts you kilometers off.

When I flip the state:

  • 🏑 "Home" β€” a script runs: the right lights come on, adaptive modes are restored
  • πŸšͺ "Away" β€” another script: all lights off, unnecessary devices shut down, music or TV stops

6. Safety: Sensors

πŸ’§ Water leak sensors β€” placed in risky spots. When triggered β€” critical alert. Plus devices in the affected rooms get shut off. I dream of owning a house where I could fully control the water supply β€” automations would go way further in that case.

7. System Monitoring

πŸ”„ Restart notifications. When Home Assistant boots up, a push arrives: "The house is smart again!" A useful signal: if I get this unexpectedly β€” either there was a power outage, or the server rebooted on its own. Worth investigating.

πŸ”‹ Batteries. All battery-powered Zigbee devices are monitored automatically. When the charge drops below threshold β€” a notification comes in with the exact device name. No need to manually check dozens of sensors and buttons β€” the system tells you which one needs a fresh battery.

8. AI Automations

πŸš— "Should I wash the car?" Using an AI agent plus the local weather forecast, I get an answer on demand: is it worth washing the car today. The agent checks the forecast for the next few days β€” if rain's coming, it says wait. If it's sunny ahead β€” green light. Simple integration, but saves time and money.

πŸŽ™οΈ Voice deep research. I set up a pipeline where I dictate a research topic or random thoughts by voice. The system transcribes the audio via Whisper, processes the text, fires off a deep research through an AI agent, and once it's done β€” sends a structured result to Telegram based on my prompt. Basically a voice-to-research pipeline running entirely on the local server. Dictate a thought on the go β€” get a full breakdown in the messenger.


What Else Is Under the Hood

Running on a Raspberry Pi 5 (8 GB RAM).

πŸ”Œ Add-ons:

  • Zigbee2MQTT + Mosquitto broker β€” the backbone of the Zigbee network
  • Cloudflared β€” secure tunnel for remote access, no open ports needed
  • MQTT integration for gaming console β€” control via MQTT
  • Whisper + Piper β€” local speech recognition and synthesis (Wyoming Protocol), works offline. The local LLM is used purely for text transcription β€” 8 GB of RAM on the Raspberry Pi 5 is barely enough for that alone
  • Node-RED β€” for complex flows that are painful to write in YAML
  • Terminal & SSH β€” remote server access
  • File editor β€” editing configs from the browser
  • Google Drive Backup β€” automatic cloud backups

🌑️ Climate & Environment:

  • AC control via IR integration
  • Scheduled power outage charts
  • Local air quality monitoring
  • Weather forecast
  • Sun state (sunrise, sunset) for automation triggers

🧠 AI & Communication:

  • Google Gemini + OpenAI β€” for event analysis and experiments
  • Telegram bot β€” alternative notification channel
  • Google Translate TTS β€” speech synthesis for voice alerts
  • Google Calendar β€” schedule integration into automations

πŸ”§ Helpers:

15 helpers in total β€” the "glue" between automations:

  • Sensor groups β€” aggregated light, humidity, and temperature readings across the apartment
  • Mode flags β€” manual override control for each zone
  • Device states β€” tracking work cycles and power
  • Text input for AI experiments

🎨 Visualization:


🏁 Wrapping Up

A smart home isn’t a finished product β€” it’s a living system that grows with you. I started with a single smart bulb, and now I have dozens of devices, automations that think for themselves, and an AI agent I can talk to by voice. Some of it took an evening to set up, some of it took weeks of debugging YAML at 2 AM.

The main takeaway: you don’t need to plan everything upfront. Start small, automate what actually annoys you, and the system will evolve on its own. Home Assistant gives you the freedom to build exactly the setup you need β€” not the one some vendor decided to sell you.

Still have questions? Then feel free to leave a comment β€” I’ve finally gotten around to enabling them. πŸ’¬


← Back to all posts
Smart Home Β· sonikbro.dev