Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-power off printer when connected to wifi power plug #2

Open
stephbellemare opened this issue Mar 12, 2022 · 2 comments
Open

Auto-power off printer when connected to wifi power plug #2

stephbellemare opened this issue Mar 12, 2022 · 2 comments

Comments

@stephbellemare
Copy link

Thought it would be a good addition to your macro-set.
my printer is connected in a tp-link wifi power plug (you can use anything moonraker supports).
this will; auto turn-off the printer after idle delay of 15 min

in printer.cfg you need to add this:

[delayed_gcode delayed_printer_off]
initial_duration: 0.
gcode:
   {% if printer.idle_timeout.state == "Idle" %}
      POWER_OFF_PRINTER
   {% endif %}

[idle_timeout]
timeout = 900
gcode:
   M18  
   TURN_OFF_HEATERS
   UPDATE_DELAYED_GCODE ID=delayed_printer_off DURATION=60

in the setup_macro file, i've added this

# Turn printer off
[gcode_macro POWER_OFF_PRINTER]
gcode:
   {action_call_remote_method("set_device_power", device="printer", state="off")}
@strayr
Copy link
Owner

strayr commented Mar 12, 2022 via email

@stephbellemare
Copy link
Author

NP, just trying to help ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants