Feature request: power on a Klipper/Moonraker printer when a print is sent (Moonraker power devices)
Hi Chris,
Thanks for 0.24.9: "Files on the printer", timelapses and deleting files are nice additions for my Klipper printer. I have one more request for Klipper/Moonraker printers.
Setup
- Agent 0.24.9 (Docker, self-hosted), Android app (latest)
- Tronxy X5S with Klipper v0.13.0 and Moonraker
- The Raspberry Pi is always on. The printer itself (PSU and mainboard) is on a smart plug, which Moonraker controls as a power device ([power x5s], type homeassistant, restart_klipper_when_powered: True).
What happens today
When the printer is switched off, the agent shows it as offline (Klipper is in "shutdown" without the mainboard). If I send a print anyway, the upload to /server/files/upload works, because Moonraker is running on the Pi, but /printer/print/start fails because Klipper is not ready. So I first have to switch the printer on in Mainsail or Home Assistant, wait about 15 seconds and then send the print from the app.
Request
Support Moonraker power devices (/machine/device_power/devices, /machine/device_power/device?device=...&action=on|off):
1. Show the power state of the printer and an on/off button on the printer card, for the devices Moonraker lists.
2. When a print is sent to a printer that is powered off: switch the power device on, wait until Klipper reports "ready" (/printer/info, state ready), and then start the print. If Klipper is not ready within a time limit (for example 60 s), show an error instead.
3. Optional: a setting "Power off after print" that switches the device off when the print is finished and the hotend has cooled below about 50 °C.
Alternative
Upload with print=true and let Moonraker's job queue start the print. With on_when_job_queued: True, Moonraker then powers the printer on and starts the job itself when Klipper is ready. This requires [job_queue] in moonraker.conf, so it would probably need to be an option per printer.
Thanks also for "Files of this model" / "All on one plate" (0.24.6). What I still miss from my last message: more than one plate in "Edit plate", and plates created automatically when the parts do not fit on one plate.
Thanks!
/Burnie