f
freude
Home lab · Automation · Linux

Smart home tinkering, one YAML file at a time.

Notes from an ongoing home lab: a Home Assistant setup that's grown over many months, a small fleet of Raspberry Pis doing quiet jobs around the house, and the Linux underneath all of it.

Automation

Home Assistant

Dashboards styled with card_mod, Jinja2-templated automations, and Telegram alerts for the things worth knowing about immediately.

See the setup →
Hardware

Raspberry Pi

What's running where, the bash menu that makes headless admin bearable, and lessons learned from Pis doing jobs they probably weren't sized for.

See the fleet →
Operating systems

Ubuntu & Raspberry Pi OS

Picking the right OS for the right board, keeping headless installs sane, and the small habits that save a reflash later.

Compare the two →
Volunteering

Thames Valley OPCC & ICV

The official scheme page for Independent Custody Visiting, plus current volunteer vacancies with the Office of the Police and Crime Commissioner.

ICV scheme page → Current vacancies →

What's on this site

This is a small personal reference, not a project blog with dates and screenshots — just the patterns, gotchas and commands worth keeping somewhere more permanent than chat history or a scribbled note. Three pages, each focused on one part of the stack.

Automation

Home Assistant

A long-running setup that leans on YAML automations, Jinja2 templating, and a fair amount of CSS to make the dashboards look less like a spreadsheet.

YAML Jinja2 card_mod Telegram ApexCharts Blueprints

Dashboards with card_mod

Default Lovelace cards are fine, but card_mod gets dashboards closer to how they should look — custom styling on entity, tile, gauge and horizontal-stack cards rather than accepting the defaults.

Gotcha: card_mod on a horizontal-stack has to be applied to each child card individually — styling the stack itself does nothing. Some tile-card shadow-DOM styling is still easier with the browser dev tools open than guessed blind.
card_mod:
  style: |
    ha-card {
      border-radius: 14px;
      background: rgba(20, 24, 34, 0.9);
    }

Automations & notifications

Most automations are plain YAML with Jinja2 templates doing the formatting — ordinal date suffixes, friendly names for zones, that kind of thing — and a Telegram bot for anything that deserves an immediate ping: alarm zone activity, battery state-of-charge, and the odd database-size alert when something's growing faster than expected.

- alias: Telegram – Zone Alert
  trigger:
    - platform: state
      entity_id: binary_sensor.alarm_zone_1
      to: "on"
  action:
    - service: telegram_bot.send_message
      data:
        message: >-
          {{ zone_names[trigger.entity_id] }} triggered at
          {{ now().strftime('%H:%M') }}

Energy & battery monitoring

A solar/battery inverter integration feeds ApexCharts for the day-to-day graphs, alongside speedtest monitoring for the network side of things. The more interesting work has been in the automations around charge scheduling — getting AC-charge rate, discharge rate and time windows all pulling in the same direction rather than fighting each other.

Lesson learned: Home Assistant's logbook timestamps are UTC, while some third-party inverter exports and schedule entities report local time. Worth converting explicitly before trusting a timeline that spans both.
Hardware

Raspberry Pi

A handful of Pis, each doing one quiet job rather than one Pi doing everything — easier to reason about, and a lot easier to recover when something needs a reflash.

Headless SSH GPIO Bash Home network

One job per Pi

Splitting roles across boards — Home Assistant on one, network tools on another — means a crash or an update gone wrong is contained to a single service instead of taking the whole setup down. It also makes it obvious, at a glance, which board does what.

Admin, the lazy way

A small bash menu script runs on each Pi for the common admin tasks — updates, service restarts, log checks — with a reboot warning baked in so a scheduled reboot doesn't take anything by surprise.

A simple admin menu

Nothing fancy — a select loop and a case statement — but it beats remembering fifteen different one-liners across fifteen different SSH sessions.

#!/bin/bash
PS3="Choose an option: "
options=("Update system" "Restart service" "Check disk space" "Reboot" "Quit")
select opt in "${options[@]}"; do
  case $opt in
    "Update system") sudo apt update && sudo apt upgrade -y ;;
    "Restart service") sudo systemctl restart home-assistant@homeassistant ;;
    "Check disk space") df -h / ;;
    "Reboot")
      echo "Rebooting in 10 seconds — Ctrl+C to cancel."
      sleep 10 && sudo reboot ;;
    "Quit") break ;;
    *) echo "Invalid option" ;;
  esac
done

Networking role

One board sits on the home network doing the unglamorous jobs — DNS-level ad blocking, basic uptime checks, the odd speedtest cron — on a wired connection rather than Wi-Fi, since reliability matters more than convenience for anything infrastructure-adjacent.

Operating systems

Ubuntu & Raspberry Pi OS

Two solid choices for the same hardware, and picking between them is really about what the board's job is.

Ubuntu Server Raspberry Pi OS Lite systemd apt

Raspberry Pi OS

Debian-based, tuned specifically for Pi hardware, with the broadest GPIO and camera library support. The default choice for anything that touches the board's own hardware directly.

Ubuntu Server

Heavier, but a more standard base when a project is likely to move between a Pi and a regular VM or cloud box later — same package set, same systemd behaviour either way.

Headless setup, done once properly

Both images support dropping an empty ssh file (or a userconf.txt/cloud-init config) onto the boot partition before first boot, so there's never a need to attach a keyboard and monitor just to get a Pi onto the network.

# Raspberry Pi OS: enable SSH before first boot
touch /boot/ssh

# Ubuntu: set hostname + wifi via cloud-init before first boot
# edit /boot/network-config and /boot/user-data

Keeping it boring

The habits that save the most time later are unglamorous: a static DHCP reservation per board so it's always reachable at the same address, unattended security updates turned on, and a known-good SD card image kept to one side before anything risky gets attempted.

Worth doing early: swap out the SD card for an SSD or at least a good-quality card where the board allows it — most Pi reliability complaints trace back to a tired SD card, not the board itself.