Moonraker / Klipper 3D Printer Driver for Hubitat
Author: jdthomas24 | Version: 1.0.45 | Available via Hubitat Package Manager
Moonraker/Klipper 3D printer driver for Hubitat. Works with any Klipper printer running Moonraker — including Creality Sonicpad multi-printer setups and standard installs on Raspberry Pi, BTT Pi, CB1, and similar.
What It Does
Monitor and control your 3D printers directly from Hubitat with two dashboard tiles and full automation support.
aa Status Tile
Live printer dashboard showing:
- Printer name, hostname, online status, and Klipper state
- Current print state and filename
- Hotend and bed temps vs target (side by side)
- Progress bar with percentage
- Elapsed time, time remaining, and ETA
- Fan speed, filament status, and filament used
- Red error banner when the printer reports an error
files List Tile
Recent prints browser showing:
- Top 20 most recently printed files sorted by actual print history
- Currently printing file pinned green at #1
- Last completed print highlighted at the top
- File numbers for use with the
startPrintcommand
Installation
Via Hubitat Package Manager (Recommended)
- Open Hubitat Package Manager
- Click Install → Search by Keywords
- Search
Moonraker Klipper Printer- Select and install
Manual
- Drivers Code → New Driver — paste the driver code and Save Groovy
https://raw.githubusercontent.com/jdthomas24/Hubitat-Apps-Drivers/refs/heads/main/Moonraker%20Klipper%203D%20Printer/Raw%20Code/Moonraker%20Klipper%20Printer.groovy
Setup
Name your Hubitat device BEFORE saving preferences — the name shows in the status tile as your printer name.
- Devices → Add Device → Virtual
- Name it to match your printer (e.g.
3D - CR10 Pro 1)- Set Type to
Moonraker Klipper Printer→ Save Device- Fill in preferences → Save Preferences → Initialize
Repeat for each printer.
Sonicpad
All printers share one IP — create one Hubitat device per printer with the same IP and a different port:
Sonicpad USB Port Moonraker Port Port 1 7125 Port 2 7126 Port 3 7127 Port 4 7128 Standard Install
Each printer has its own IP. Use the port configured in your
moonraker.conf— this varies by install, but 7125 is the most common default. Check your config if unsure.
Adding Tiles to Your Dashboard
- Open your Hubitat Dashboard
- Add a new tile → select Attribute
- Pick your printer device
- Select
aaStatusTileorfilesListTile- Save
Automation and Rules
Automations & Rules
These attributes are available for use in Rule Machine or any Hubitat automation:
Attribute Values Example Use printStateprinting,complete,paused,error,cancelled,standbyNotify when print completes filamentDetectedtrue,false,unknownAlert on filament runout errorerror message or nonePush notification with error details filenamecurrent print filename Log what was printed lastPrintlast completed filename Trigger post-print actions chamberTemp (°C)temperature Monitor enclosure temp Example rules:
printState=complete→ turn off printer smart plug (with 5 min delay)filamentDetected=false→ send push notification "Filament runout on 3D - CR10 Pro 1"printState=printing→ turn on printer lightserror!=none→ send push notification with error message
Trouble shooting
Troubleshooting
| Issue | Fix |
|---|---|
| "klipper: unknown" in tile | Hit Initialize on the device |
| Temps in wrong unit | Preferences → set Temperature Unit → Save Preferences |
| File list not updating | Hit Initialize on the device |
| Printer shows offline but is on | Hit Initialize |
filePathCache in State Variables |
Normal — used internally by startPrint |
Questions or issues? Drop them below. Happy printing! ![]()