Keeps idle inkjet printers from clogging by printing a small colour page on a schedule.
- Works with AirPrint / IPP Everywhere printers with no drivers, and with printers shared by another CUPS server. USB and driver printers are coming.
- Finds the printers on your network for you, with no host networking needed
- Handles several printers, each with its own schedule
- Optional: skip the test page when the printer was used recently, using its page counter
- Ink-low alerts by webhook and in Home Assistant
- Prints when the last successful print is older than N days, so a print missed while the printer was off happens as soon as it's back; a newly added printer prints its first page N days after it's added
- Never prints twice: jobs are tracked to completion and cancelled before any retry
- Web admin: add and edit printers, choose any interval, see ink levels and history
- Choose how much ink each print uses: light, standard, heavy or a full page
- Ten test page designs (chevrons, honeycomb, sunburst…) to rotate through, or plain bars. Each uses exactly the same ink as the bars at the chosen level and ends with a solid strip for spotting clogs
- Epson nozzle check and head cleaning from the web admin, over the network, and an optional nozzle check after every Nth test page
- Home Assistant app, opened from the sidebar, with a device per printer over MQTT: status, last print, next due, ink levels and a Print button
- REST API, webhook and MQTT
Status: phase 3 (Home Assistant app). See docs/PLAN.md.
Needs Home Assistant OS or a Supervised install. Click the button above, or go to Settings > Apps > App store, open the ⋮ menu, choose Repositories and add https://github.com/partytimeexcellent/clogbot. Then install ClogBot, start it, and open it from the sidebar. Setup is in the app's Documentation tab (ha-app/DOCS.md).
For any Docker host, including Home Assistant Container or Core installs. Images are built for amd64 and arm64 (for example a Raspberry Pi).
mkdir clogbot && cd clogbot
curl -fsSLO https://raw.githubusercontent.com/partytimeexcellent/clogbot/main/docker-compose.yml
echo 'CLOGBOT_ADMIN_PASSWORD=choose-a-long-password' > .env
docker compose up -dEdit TZ in docker-compose.yml to your timezone first. To update, run docker compose pull && docker compose up -d. To pin a version, change latest to a release such as 0.2.0.
To build from source instead, clone the repo, swap the image: line for build: . in docker-compose.yml, and run docker compose up -d --build.
Open http://<server>:8080, sign in, and add your printer: Find printers on my network lists the ones it finds, or type its IP address. "Check printer" talks to the printer without printing anything.
You can also write config/printers.yaml by hand while ClogBot is stopped; see config.example/printers.yaml.
On first start ClogBot creates an API token in config/api_token. The file belongs to root (the container runs as root for CUPS), so read it through the container:
TOKEN=$(docker compose exec clogbot cat /config/api_token)
curl -H "Authorization: Bearer $TOKEN" http://localhost:8080/api/status
curl -X POST -H "Authorization: Bearer $TOKEN" "http://localhost:8080/api/printers/ecotank/print?wait=true"| Method | Path | What it does |
|---|---|---|
| GET | /api/health |
Liveness check (no token needed) |
| GET | /api/status |
All printers: last print, next due, ink levels |
| GET | /api/printers/{id} |
One printer |
| GET | /api/printers/{id}/history |
Past prints, newest first |
| POST | /api/printers/{id}/print |
Print now. Add ?wait=true to wait for the result. |
| POST | /api/printers/{id}/refresh |
Re-read the printer's status and ink levels |
| POST | /api/printers/{id}/identify |
Make the printer flash or beep |
| GET | /api/printers/{id}/page.pdf or page.svg |
Preview the test page |
| POST | /api/printers |
Add a printer (JSON, same fields as printers.yaml) |
| PUT | /api/printers/{id} |
Change a printer's settings (only the fields you send) |
| DELETE | /api/printers/{id} |
Remove a printer |
| POST | /api/check |
Test {"mode", "uri"} without printing |
| GET | /api/scan |
Networks worth searching for printers |
| POST | /api/scan |
Find printers in {"network": "192.168.1.0/24"} (private networks, /22 or smaller) |
| POST | /api/printers/{id}/nozzle-check |
Epson only: print a nozzle check pattern |
| POST | /api/printers/{id}/clean-heads |
Epson only: clean the print head (at most 2 per 6 hours) |
Set CLOGBOT_WEBHOOK_URL to receive a JSON POST for these events:
printed,failed: a test page printed, or couldn't be printed (a failure is sent once, not every hour while the printer stays off)overdue: no test page foroverdue_after_dayspast its due dateskipped: a test page wasn't needed because the printer was used (only with skip-if-used turned on)nozzle_check: a scheduled nozzle check printed, so it's time to look at the patternink_low: an ink reached the printer's own "low" level; sent once per ink, and again after a refill
{"event": "printed", "printer_id": "ecotank", "printer_name": "EcoTank ET-2800",
"time": "2026-11-23T10:00:00-05:00", "reason": "printed", "trigger": "schedule", "job_id": 12}
{"event": "ink_low", "printer_id": "ecotank", "printer_name": "EcoTank ET-2800",
"time": "2026-11-23T10:00:00-05:00", "reason": "Black ink is low (12%)",
"inks": [{"name": "Black ink", "level": 12, "low": 15}]}Off by default. Turn on Skip the test page if the printer was used for a printer, and ClogBot reads its total page counter over SNMP every hour. If the count went up by more than ClogBot's own pages, someone printed, and the timer starts again from then. The counter can't tell colour pages from black-only ones, so this suits printers that are used for colour now and then. Check printer says whether the printer shares its counter; most network printers do, with SNMP left on.
ClogBot can create the same Home Assistant device and entities from Docker. Point it at your broker:
environment:
- CLOGBOT_MQTT_HOST=192.168.1.10
- CLOGBOT_MQTT_USERNAME=clogbot
- CLOGBOT_MQTT_PASSWORD=${CLOGBOT_MQTT_PASSWORD:-}Also available: CLOGBOT_MQTT_PORT (1883), CLOGBOT_MQTT_TOPIC (clogbot) and CLOGBOT_DISCOVERY_PREFIX (homeassistant).
uv sync
uv run pytestTests marked simulator use CUPS's ippeveprinter (included with macOS and the cups-ipp-utils package) to exercise real IPP print jobs.