Directly via Moonraker, without Home Assistant
If you have a Klipper printer (Fluidd/Mainsail) but don’t run HA as an automation hub — you can skip it entirely. Moonraker exposes the print status over WebSocket itself (the same protocol used by Fluidd, Mainsail, and Spoolman), and our example script listens to it and directly calls PUT /print-jobs/{id}.
3D Print Pricing ◄──PUT /print-jobs/{id}── moonraker-order-watcher.py ◄──WebSocket── Moonraker (Klipper)The script finds the order id right in the G-code file’s name — when exporting from the slicer, name the file <order id>.gcode (the id comes from the order card or the sandbox on the REST API page). The script then watches print_stats.state and changes the status: printing → print started, complete → done, error → print_error, cancelled → cancelled.
pip install websockets
python3 moonraker-order-watcher.py \
--moonraker-ip 192.168.1.50 \
--api-base https://3dprintpricing.pro/api \
--token pat_xxxxxxxxxxxxxxxxxxxxxxxx