Skip to content

Home Assistant → PiHerder (HACS)

What this is

A HACS integration that runs on Home Assistant and observes your PiHerder fleet over /api/v1. It is not the same as HAOS hosts (PiHerder managing the appliance over SSH).

Arrow Where it lives What it does
Path 1 This PiHerder image SSH + ha CLI on an HAOS server
Path 2 (this page) Separate HACS repo HA polls PiHerder snapshots; Visit opens the herder

The plugin is not inside the PiHerder Docker image. GitHub: bjorngluck/piherder-ha. This page documents plugin 0.5.4, current with PiHerder v1.14.0 (0.5.3 first shipped beside v1.12.0). 0.5.4 needs Home Assistant 2024.7 or newer. It removes the unused root icon and logo copies. Home Assistant still reads brand/. It serves the dashboard card and logo from /piherder/ and does not copy them into config/www. It loads the card only as a Lovelace resource. 0.5.2 used that same folder and also registered a frontend extra module, which leaves the card missing on Home Assistant 2026.8 and newer. 0.5.1 copied those files off the event loop. Move, Files, and stop project stay the 0.5.0 behavior. 0.4.0 was the one-card pass. 0.4.1 adds Start and Stop for one compose service. 0.4.2 keeps the tab, the selected host, and open sections when the card redraws. 0.4.3 writes the update counts in full, colors a container name when an image update is due, and adds Restart and Update for that one service. 0.4.4 is that same card, with the resource query bumped. 0.5.0 adds Move, fleet-jail Files, and stop project. The card stays poll-only. It does not call a herder webhook. The public site piherder-docs.hacknow.info is built from PiHerder main. The 0.4.3 card pictures below were captured 2026-10-01. They do not show Move, Files, or Stop project. The 0.5.0 frames (Stop project, Move, and the Plugin sensor) were captured 2026-10-02. The Google Drive copy is a separate herder screen: Backups.

Agent tools (Cursor, Grok, Claude, Codex) are a different client of the same token API: hosted /mcp on the herder. bjorngluck/piherder-mcp is the optional stdio fallback. Agents (MCP).

Why it exists

YAML rest sensors against an API token already work. Path 2 is that, first-class: config flow, fleet sensors, one HA device per host. The door back to PiHerder on the device page is HA’s single Visit (the host page). Home Assistant only allows one Visit URL per device for custom integrations — Docker / Backups / Alerts / Audit are not extra Visit links there. Those shortcuts live on the PiHerder fleet Lovelace card. Status sensors are status only — not fake “open” / “press here” buttons (those opened HA history, not PiHerder).

Install (Slice 1)

Home Assistant 2024.7 or newer. 0.5.1 still runs on Home Assistant 2024.1 or newer. 0.5.2, 0.5.3, and 0.5.4 do not.

  1. In PiHerder: Settings → API management → create a token with read. Add jobs and edit if you want the confirm buttons and feature toggles. Set the IP allowlist to the HA host (HAOS ≈ appliance LAN IP; a container HA may egress as a Docker/bridge IP).
  2. HACS → Integrations → PiHerder.
  3. Add PiHerder: base URL (your herder origin, including scheme), token ph_…, TLS verify, poll interval. A bad URL or token keeps the fields filled (plugin ≥ 0.1.3).
  4. Confirm fleet Plugin is 0.5.4 after you redownload this build. The fleet Version sensor is the PiHerder app (1.14.0 on this tree, 1.13.0 on the published image). Device page Visit is still the host. Add the PiHerder card below. Memory, disk, and CPU load sensors sit on that same host device, plus one sensor per container and monitored service. The sensors stay status. Start, stop, restart, update, and stop project are on the card’s Host tab, under Containers, and only when the token has jobs and Docker is on. Move uses that same gate plus the herder Move flag. Files needs the files scope. Job buttons show only if the token has jobs.

After a new GitHub Release: HACS → Integrations → PiHerder → ⋮ → Redownload (pick the tag) → restart Home Assistant. Reload of the config entry is not enough for new files.

Token without read, a bad secret, or a mismatched allowlist fails closed.

What it reads

GET /api/v1/health, GET /api/v1/summary, GET /api/v1/servers, GET /api/v1/jobs?active_only=true, plus Slice 1b snapshots GET /api/v1/inventory and GET /api/v1/services. A herder older than this train answers 404 on those two; the plugin keeps the Slice 1 sensors.

Poll is database snapshots only. It never SSH’s the fleet on the HA interval. “Host down” is last_seen age, not a live ping.

Host hardware, OS, CPU, memory, and disk come from PiHerder System Info (v1.6 host-facts). That snapshot exists so HA does not SSH: the herder writes columns on a ~15 minute job (or the System Info refresh icon), then HA and the fleet card read SQL. Recreate web so Alembic 044 and 045 apply, then refresh System Info once per host (or wait ~15 minutes).

Fleet card (dashboard)

The built-in HA device page only has one Visit link. For fleet totals and per-host shortcuts, add the PiHerder fleet Lovelace card:

  1. HACS plugin 0.5.4, restart Home Assistant, then hard-refresh the browser (Ctrl+Shift+R). Reload of the config entry is not enough.
  2. Dashboard ⋮ → Resources. Delete any /api/piherder/… or /local/piherder-dashboard-card.js URL, including ?v=0.2.2, ?v=0.2.3, ?v=0.2.4, ?v=0.3.0, ?v=0.4.0, ?v=0.4.1, ?v=0.4.2, ?v=0.4.3, ?v=0.4.4, ?v=0.5.0, ?v=0.5.1, ?v=0.5.2, or ?v=0.5.3. You want one resource:

  3. URL: /piherder/piherder-dashboard-card.js?v=0.5.4

  4. Type: JavaScript module (not JavaScript)

Do not also add that URL under frontend extra_module_url.

The integration serves that file from its own folder. It does not write config/www. Copies left at config/www/piherder-dashboard-card.js and config/www/piherder-logo.png from 0.5.1 can be deleted. On the next setup it rewrites one existing card resource to the new URL.
3. Dashboard → Add card → Manual YAML (the picker may still not list it):

type: custom:piherder-dashboard-card

The custom-tag field (if you use it) wants piherder-dashboard-card without the custom: prefix.
4. Hard-refresh again. “Custom element doesn’t exist” means the resource is missing, still type “JavaScript” (not module), the same URL is also a frontend extra module, or the browser has a cached /api/piherder/… URL.

The card header is the PiHerder logo and the name PiHerder, then tabs for Fleet, Host, and Updates. Fleet shows hosts, CPU cores, containers, memory %, disk %, then one row per host with a model icon and an OS icon. Click a row to open that host. Open host goes to PiHerder. Docker, Backups, Alerts, and Audit are under Also. On Host, Containers lists the last inventory. A container with an image update has a gold name. Start, Stop, Restart, and Update each confirm, then run docker compose for that one service. Update pulls and recreates it. A 1.7 herder does not have those job types. The fleet picture is that tab.

Numbers come from the same System Info snapshot the herder modal shows (CPU cores, memory, disk). Recreate web so Alembic 045 is applied, then the System Info refresh icon once per host (or wait for the scheduler). Empty CPU/memory/disk on the card means the herder has not stored a resource snapshot yet — not a card bug.

HACS config

Config flow — herder base URL and a read token (mask the token in any copy of this shot).

PiHerder fleet card

Fleet tab on plugin 0.4.3. Totals, then one row per host with a model icon and the OS. Click a row to open that host.

HA devices

Fleet device on plugin 0.4.3. Hardware reads plugin 0.4.3, the Plugin sensor reads 0.4.3, and Visit opens the herder. Connected hosts are listed under the sensors.

Visit opens the host page

Device **Visit** opens that host in PiHerder. One link, no extra buttons.

Host snapshot sensors

Container, service, and disk sensors on the host device. Status only — no start/stop.

What you see in HA

Surface Meaning
Fleet device Counts, herder version, Plugin version, Visit = herder origin
Host device One per PiHerder server. Visit = host page only. Hardware / OS from the stored snapshot
Lovelace card Fleet, Host, and Updates tabs. Host strip, model and OS icons. Click a stat for Home Assistant history. Containers starts, stops, restarts, or updates one service, and can stop a project. Move and Files (fleet jail) are on the Host tab when the token allows them
Sensors OS, features, alert, last seen, reboot, last backup, memory %, disk %, CPU load, plus one sensor per container (running / image / uptime text) and one per monitored service (up/down). All on the host device. Tapping a sensor opens HA history, not PiHerder

The card (plugin 0.5.4)

One card, three tabs: Fleet, Host, Updates. The same file still registers the 0.3.0 names, so an existing dashboard does not go blank. Dashboard ⋮ → Resources: one URL, /piherder/piherder-dashboard-card.js?v=0.5.4. Delete an older /local/ or /api/piherder/ entry, including ?v=0.3.0 through ?v=0.5.3, if it is still there. 0.5.4 serves that file from the integration folder and does not register a frontend extra module. Move, Files, and stop project stay the 0.5.0 behavior. Restart Home Assistant, then hard-refresh. The card keeps the tab, the selected host, and open sections across its own redraw. The pictures below were captured on 0.4.3. The logo in the card is /piherder/piherder-logo.png.

type: custom:piherder-dashboard-card
type: custom:piherder-host-card
server_id: 1
type: custom:piherder-updates-card
type: custom:piherder-resources-card

Leave server_id off to get the host strip. Set it to pin one host and hide the strip. piherder-resources-card opens on the Host tab at the bars.

The host chip shows a Raspberry Pi icon with a short model (5, 4, 400, Zero, CM4, CM5) when the stored hardware string says so, and an OS icon for Ubuntu, Home Assistant, or Debian / Raspberry Pi OS. Anything else is a plain server and a Linux icon.

Click memory, disk, or CPU load and Home Assistant opens that sensor’s history. The card draws a thin 24-hour sparkline from those same sensors (about every 15 minutes, not a live SSH chart). The sparkline stays empty until the recorder has points. Reboot and last backup open the same way when those sensors exist.

Backup is the button on the face. Actions holds Retention, Check OS, Check containers, Patch OS, Patch containers, and Restart host. Restart names the host and reboots the machine. It will not start while an OS patch, a container patch, or a backup is already running. Containers lists the last inventory. The summary shows how many need an update, and those names are gold. A running service has Stop and Restart. A stopped service has Start. A service with an image update also has Update, which pulls and recreates that service only. Each asks first. Other containers in the project stay as they are. A row with no compose directory or service name has no button. This needs the v1.8 herder. A 1.7 herder answers 400. Features (backup, OS patch, Docker) is collapsed. Turning one off asks first. Open host is the link. Docker, Backups, Alerts, and Audit are under Also.

Updates is one row per host. The counts are written out (for example 2 OS updates and 1 container update), in gold when something is due, or Up to date. The row opens that host and does not repeat the buttons.

Host card

Host tab on plugin 0.4.3. The strip picks the host. A gold pill names the OS updates. Containers is open: a running service has Stop and Restart. This frame has no container waiting on an image update, so no name is gold.

Updates card

Updates tab on plugin 0.4.3. Each row writes the count out: Up to date, OS updates, or container updates. Gold means something is due. The row has no buttons.

Resources card

Memory, disk, and CPU load on the Host tab, with the 24-hour sparkline.

CPU load history

Click CPU load and Home Assistant opens that sensor’s history. Memory and disk open the same dialog.

A token with only read keeps the fleet card and the sensors and shows no buttons. jobs shows the confirms, including Start, Stop, Restart, Update, Stop project, and Move. files shows the fleet jail. edit shows the toggles. feature:os is required for patch, OS check, and host restart. feature:backup for backup and retention. feature:docker for container check, patch, the one-service buttons, Stop project, and Move. The host’s own feature flag must be on as well. Move also needs the herder flag (service_migrate on health).

Stop project asks first. It runs docker compose stop for that compose directory (docker_stack_stop). It does not remove containers or volumes.

Stop project and Move

Host tab on plugin 0.5.0. Containers lists Stop project for a compose project, and Stop or Restart for one service. Move is open under that: pick a project and a destination, then Move. A finished Move has no Undo.

Plugin 0.5.0

Fleet device on 2 October 2026. The Plugin sensor reads 0.5.0. The Version sensor reads 1.8.1. Device info Firmware on this frame reads 1.8.0.

Move asks first, then stops the project on this host, copies it, and starts it on the destination. The source is left stopped. A finished Move has no Undo on the card. The card does not remove the source project. The panel is in the frame above. The herder wizard is on Move a service.

Files is the fleet jail only. The same token scope as the Files API. Delete asks first and removes one file or an empty directory. It does not install Home Assistant /config, and it does not open a privileged path.

The buttons call Home Assistant services (piherder.trigger_job, piherder.set_features, piherder.start_move, and the files actions). The token stays on the integration. An automation can call those services without the card’s confirm dialog.

What it will not do

No console, no compose editor, no token admin, no nmap, and no herder webhook. Job-finished events still come from the poll. Files stay in the fleet jail. Stop project is not docker compose down. The sensor list still only reads the last inventory. YAML rest: remains possible. The poll still reads stored snapshots and does not SSH.