• Nov 18, 2026
  • 3 min read

From Solar Panel to Dashboard: A Self-Hosted IoT Platform

I had a temperature sensor on a Raspberry Pi. Then a Pico W measuring how well a wall holds heat. Then an ESP32 on a small solar panel. Then a water pump.

(That heat measurement once became an offer I never launched.)

Each one had its own firmware, its own idea of where the MQTT broker was, its own SQLite file and its own little UI. Sensing worked, and history kept piling up. Then the pump arrived with a question none of those dashboards could answer: what did the device do, and how do I tell it to do something?

Reading data is easy. Sending commands to hardware that sleeps most of the time, runs on a battery and controls water is a different problem. So I wrote a one-page requirements doc with one line at its core:

one broker -> one ingester -> one store -> one dashboard (read + command)

It wasn’t a greenfield project. It was a consolidation, with one rule: don’t lose the history, and don’t rewrite firmware that already works.

What it is now

flowchart LR
    P[Solar panel<br/>+ battery] --> D[ESP32 · Pico W<br/>Zigbee · Shelly]
    D --> M[MQTT<br/>EMQX]
    M --> I[Config-driven<br/>ingester]
    I --> S[(SQLite)]
    S --> W[Dashboard<br/>read + command]
    W -->|pump commands| M

Four layers, all built and run by one person:

LayerWhat’s there
HardwareESP32, DHT11, INA226, a 100k/10k panel voltage divider, a pump driver. Resistor values and power margins worked out on paper first.
FirmwareClock-aligned deep sleep, pump pulses capped at 10 s, the pump pin held LOW while asleep, LED quiet hours at night.
DataOne MQTT → SQLite service for ESP32, Pico W, Zigbee and a Shelly Pro EM. Old history migrated without losing a row; over a million rows now.
ProductA Next.js dashboard: live tiles, daily patterns, a temperature × humidity heatmap, pump control and scheduling, phone alerts.

No cloud, no subscription. My broker, my database, my backups.

Principles

  1. Boring beats clever. SQLite, not a time-series database. One container, not a cluster.
  2. Exactly one writer. The ingester writes; everything else reads.
  3. Config, not code. A new device is a few lines of JSON.
  4. The device protects itself. Pump safety lives in the firmware, not the UI.
  5. Measure before you claim. Where a number isn’t measured yet, the post says so.

The series

  1. The boring architecture that works: MQTT, one ingester, SQLite
  2. Migrating 395,931 rows and a Zigbee network without re-pairing
  3. The voltage divider is where software people get humble
  4. Controlling a pump without flooding the house
  5. 72 hours on battery, and the winter firmware that sleeps by the clock
  6. Reason 15: the Wi-Fi password that was right and wrong
  7. Home energy from a Shelly Pro EM: trust the counters
  8. The dashboard looked healthy. It wasn’t writing anything.

What it isn’t (yet)

It’s a working homelab system, not a product. The dashboard has no login, so it stays on the LAN. Wi-Fi details are compiled into the firmware. There are no over-the-air updates. The winter firmware’s battery life hasn’t been measured yet; when it is, it goes next to the 72-hour baseline from October.

Stack: ESP32 (Arduino core 3.3), EMQX, Zigbee2MQTT, Node.js ingester, SQLite (WAL), Next.js with shadcn/Radix and Recharts, ntfy, Docker Compose.