Monitoring a 13-Node Homelab Fleet and 4 UPSes on a 16×16 Unicorn HAT HD

By | December 1, 2026

Unicorn HAT HD displaying the 13-node fleet and 4-UPS status matrix

Dashboards are great when you are sitting at a browser, but when you walk past a homelab rack, nothing beats a 16×16 RGB LED matrix that tells you in half a second whether every server, Raspberry Pi, ClusterHAT node, and UPS is healthy.

In our earlier Weave Scope post, we connected four x86_64 servers (nas1 through nas4) into a central Scope topology over Tailscale. Since then, the fleet grew to 13 nodes—adding rpi-1, rpi-4, rpi-5, rpi-rack (which also hosts a USB-attached UPS via NUT), and a ClusterHAT (cbridge + four Pi Zero nodes p1–p4).

Instead of letting rpi-1‘s Pimoroni Unicorn HAT HD sit idle or only scroll Bitcoin prices, we turned it into an always-on systemd display (homelab-matrix.service) that alternates between:

  1. A 13-node Fleet & 4-UPS Status Grid (10 seconds)
  2. A Soporului Home Assistant Ambient Ticker (office, server rack, balcony outdoor temperature, and CO₂ concentration)

Architecture: 256 Pixels, Three Data Sources

Every 10-second cycle, homelab_matrix.py pulls live telemetry from three places:

  1. Weave Scope (https://<hub-ip>:4040/api/topology/hosts): Returns every active host reporting into our central Scope hub (nas3). All Raspberry Pis—including the armv6l ClusterHAT Pi Zeros (p1–p4) and armv7l nodes (cbridge, rpi-1, rpi-4, rpi-5, rpi-rack)—run cross-compiled standalone weavescope probe binaries (--mode=probe --probe.ebpf.connections=false) with zero Docker overhead.
  2. Network UPS Tools (NUT, port 3493): Queries four UPSes directly over TCP (GET VAR <ups> ups.status) with a Home Assistant sensor fallback:
  3. rack_ups on rpi-rack
  4. volt_ups on nas3
  5. rack_ups_1 and rack_ups_2 on nas1 (reached directly over Tailscale once tailscaled is up on rpi-1)
  6. Home Assistant REST API (http://<ha-ip>:8123/api/states/...): Fetches Soporului indoor/outdoor temperature and CO₂ sensors.

Pixel Layout on the 16×16 Grid

  • Top 12 rows (13 × 2×2 blocks): Each of the 13 hosts (nas1–nas4, cbridge, p1–p4, rpi-1, rpi-4, rpi-5, rpi-rack) lights up green when present in /api/topology/hosts or red if missing.
  • Bottom 2 rows (4 × 3×2 bars with a 1-pixel gap): Each bar represents one of the four fleet UPSes:
  • Blue: OL (Online / Utility Power)
  • Flashing Red: OB (On Battery — also interrupts the ambient ticker with UPS ON BATTERY!)
  • Amber: Offline / upsd unreachable
  • Ambient Ticker: Scrolls OFF <temp>C RACK <temp>C OUT <temp>C CO2 <ppm> using PIL and FreeSansBold.ttf, colored green (< 800 ppm), yellow (800–1200 ppm), or red (> 1200 ppm).

Hardware & OS Gotchas We Hit Along the Way

Getting rpi-1 and the Unicorn HAT HD to this state turned up four real-world pitfalls worth documenting:

  1. A Bad USB SD Card Reader (14cd:1212): Three consecutive microSD flashes through a cheap 14cd:1212 USB reader ended in Attempted to kill init! exitcode=0x0000000b or Inode ... contains garbage on resize2fs. Switching to the laptop’s built-in SD controller (/dev/mmcblk0) passed all five e2fsck -fn passes on the first try at 18.7 MB/s.
  2. Unicorn HAT HD Needs a Cold 5V Power-Cycle After Enabling SPI: Enabling dtparam=spi=on via raspi-config and soft-rebooting (sudo reboot) left /dev/spidev0.0 active and GPIO 9/10/11 in ALT0, yet the LEDs stayed dark. Pulling the 5V power cable for 5 seconds reset the HAT’s onboard STM32 controller, and the display lit up immediately.
  3. Compete-Free SPI Ownership: Our old show_btc.service was still enabled in auto-restart mode; every time it exited, unicornhathd‘s atexit handler wiped the matrix. Disabling show_btc.service before starting homelab-matrix.service eliminated the flicker.
  4. Stale NUT upsd Accept Queues: Two UPS bars stayed amber even though the USB cables were plugged in—ss -tln showed Recv-Q=17 / Send-Q=16 on port 3493 because upsd had deadlocked on a stale driver poll. Restarting nut-driver@* and nut-server brought all four UPSes back to OL.

Running It as a systemd Service

Store the Home Assistant long-lived token and Weave Scope basic-auth password in /etc/homelab_matrix.env (chmod 600):

HA_TOKEN=<your-home-assistant-token>
SCOPE_PASS=<your-weavescope-password>

And create /etc/systemd/system/homelab-matrix.service:

[Unit]
Description=Homelab Fleet + Ambient Matrix on Unicorn HAT HD
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
EnvironmentFile=/etc/homelab_matrix.env
ExecStart=/usr/bin/python3 /opt/homelab-matrix/homelab_matrix.py
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

Enable and start it with:

sudo systemctl disable --now show_btc.service 2>/dev/null || true
sudo systemctl daemon-reload
sudo systemctl enable --now homelab-matrix.service

With homelab_matrix.py running in rotation(270) to match the rack mounting, a single glance at rpi-1 now confirms all 13 hosts, all 4 UPSes, and Soporului room/rack/outdoor comfort without opening a single tab.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.