-
Notifications
You must be signed in to change notification settings - Fork 0
/
macros-printer_power.cfg
49 lines (45 loc) · 1.92 KB
/
macros-printer_power.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#####################################################################
# Printer Power Management
#####################################################################
[gcode_macro ACTIVATE_POWER_OFF]
gcode:
UPDATE_DELAYED_GCODE ID=POWER_OFF_PRINTER_CHECK_ACT DURATION=60
[gcode_macro DEACTIVATE_POWER_OFF]
gcode:
UPDATE_DELAYED_GCODE ID=POWER_OFF_PRINTER_CHECK_ACT DURATION=0
[delayed_gcode POWER_OFF_PRINTER_CHECK_ACT]
gcode:
{% if printer.idle_timeout.state == "Idle" or printer.idle_timeout.state == "Ready" %}
UPDATE_DELAYED_GCODE ID=POWER_OFF_PRINTER_CHECK DURATION=30
{% else %}
UPDATE_DELAYED_GCODE ID=POWER_OFF_PRINTER_CHECK_ACT DURATION=60
{% endif %}
[delayed_gcode POWER_OFF_PRINTER_CHECK]
gcode:
{% if printer.idle_timeout.state == "Idle" or printer.idle_timeout.state == "Ready" %}
{% if printer.extruder.temperature < 50.0 and printer.heater_bed.temperature < 50.0 %}
{% if printer.extruder.target == 0.0 and printer.heater_bed.target == 0.0 %}
UPDATE_DELAYED_GCODE ID=POWER_OFF_PRINTER_CHECK DURATION=0
_POWER_OFF_PRINTER
{% else %}
UPDATE_DELAYED_GCODE ID=POWER_OFF_PRINTER_CHECK DURATION=2
{% endif %}
{% else %}
{% if printer.idle_timeout.state == "Printing" %}
UPDATE_DELAYED_GCODE ID=POWER_OFF_PRINTER_CHECK DURATION=0
{% else %}
{% if printer.extruder.target == 0.0 and printer.heater_bed.target == 0.0 %}
UPDATE_DELAYED_GCODE ID=POWER_OFF_PRINTER_CHECK DURATION=2
{% else %}
UPDATE_DELAYED_GCODE ID=POWER_OFF_PRINTER_CHECK DURATION=0
{% endif %}
{% endif %}
{% endif %}
{% endif %}
[gcode_macro _POWER_OFF_PRINTER]
gcode:
M107
{action_call_remote_method("set_device_power",
device="printer",
state="off")}
#####################################################################