Small middleware to push status changes from your Bambu Lab 3D Printers in LAN mode to a NTFY server
334
Full details on the Website
A self-hosted push-notification bridge for Bambu Lab printers. It watches a printer's local MQTT status feed and sends a notification through your own or public ntfy server whenever:
Bambu Handy does not work when the printer is in LAN Only / Developer Mode is enabled. Bambu Lab printers also run a local MQTT broker over TLS with a rich status feed but nothing to turn it into a notification unless you're watching the screen. Bambu-ntfy stays connected to that feed, diffs each status report against the last known state, and pushes a notification for anything worth knowing, entirely over your own network.
Bambu printer(s) --MQTT/TLS, bblp + access code--> bambu-ntfy --HTTP POST--> your ntfy server
1. Enable LAN mode on the printer
Settings → Network → LAN Only Mode (or Developer Mode on some firmware). This reveals the 8-digit access code used as the MQTT password, and the printer's serial number. You'll also need the printer's IP address.
2. Run the container
docker run -d \
--name bambu-ntfy \
-e NTFY_URL=https://ntfy.example.com \
-e NTFY_TOPIC=bambu-printer \
-e PRINTER_IP=192.168.1.50 \
-e PRINTER_SERIAL=00M00A000000000 \
-e PRINTER_ACCESS_CODE=12345678 \
-e PRINTER_NAME="Bambu X1C" \
pocketsized/bambupushnotifier
No ports need to be published as the container only makes outbound connections to the printer and to ntfy.
3. Subscribe with a ntfy client
ntfy subscribe https://ntfy.example.com/bambu-printer
services:
bambu-ntfy:
image: pocketsized/bambupushnotifier
container_name: bambu-ntfy
restart: unless-stopped
environment:
# --- ntfy (shared across all printers) ---
NTFY_URL: "https://ntfy.example.com"
NTFY_TOPIC: "bambu-printer"
NTFY_TOKEN: "" # or use NTFY_USERNAME / NTFY_PASSWORD
# NTFY_USERNAME: ""
# NTFY_PASSWORD: ""
# --- Single printer ---
# PRINTER_IP: "192.168.1.50"
# PRINTER_SERIAL: "00M00A000000000"
# PRINTER_ACCESS_CODE: "12345678"
# PRINTER_NAME: "Bambu Printer"
# PRINTER_PORT: "8883"
# --- Multiple printers (numbered format) ---
PRINTER_1_IP: "192.168.1.50"
PRINTER_1_SERIAL: "00M00A000000000"
PRINTER_1_ACCESS_CODE: "12345678"
PRINTER_1_NAME: "X1C Upstairs"
PRINTER_2_IP: "192.168.1.51"
PRINTER_2_SERIAL: "00M00B000000000"
PRINTER_2_ACCESS_CODE: "87654321"
PRINTER_2_NAME: "P1S Garage"
# Add PRINTER_3_*, PRINTER_4_* ... PRINTER_9_* as needed
LOG_LEVEL: "INFO"
Both the single-printer and numbered variables can be set at the same time. They all run side by side, each on its own thread.
| Variable | Required | Description |
|---|---|---|
NTFY_URL | yes | Base URL of your ntfy instance. |
NTFY_TOPIC | yes | Topic to publish notifications to. |
NTFY_TOKEN | no | Bearer token for ntfy, if your instance requires auth. |
NTFY_USERNAME / NTFY_PASSWORD | no | Basic auth for ntfy, used if no token is set. |
PRINTER_IP | for single printer | LAN IP address of the printer. |
PRINTER_SERIAL | for single printer | Printer serial number. |
PRINTER_ACCESS_CODE | for single printer | 8-digit access code from the printer's network screen. |
PRINTER_NAME | no | Friendly name shown in notifications. Defaults to "Bambu Printer". |
PRINTER_PORT | no | MQTT port for the single printer. Defaults to 8883. |
PRINTER_1_IP … PRINTER_9_IP (+ _SERIAL, _ACCESS_CODE, _NAME, _PORT) | for multiple printers | Numbered variables, one set per printer, up to nine. |
LOG_LEVEL | no | Python logging level. Defaults to INFO. |
At least one printer (single or numbered) and NTFY_URL/NTFY_TOPIC are required. Failure to set required variables will cause the container to exit at startup.
| Event | Priority | Trigger |
|---|---|---|
| Monitor started | 2 (low) | Once, when the container connects to a printer for the first time. |
| State changed | 2–5, varies by state | The printer's gcode_state changes. Idle/finished are low-key; paused is higher; failed is urgent. |
| Print error | 5 (urgent) | The printer reports a non-zero print error code. |
| HMS error raised | 5 (urgent) | A new Health Management System condition appears. |
| HMS condition cleared | 3 (default) | A previously active HMS condition is no longer reported. |
| Connection lost | 4 (high) | The MQTT connection to a printer drops. It keeps retrying with backoff. |
| Connection restored | 3 (default) | A previously lost connection reconnects. |
HMS codes are decoded into a severity (fatal/serious/common/info) and, for a handful of common conditions (AMS communication errors, filament runout, nozzle/heatbed temperature abnormalities, nozzle clogs, toolhead communication errors), a friendly description. Unrecognized codes still notify with their raw code (look them up at wiki.bambulab.com/en/hms).
python:3.13-alpine3.24.paho-mqtt and requests.Content type
Image
Digest
sha256:67d8cb0e2…
Size
25.6 MB
Last updated
18 days ago
docker pull pocketsized/bambupushnotifier