Pause_Resume Issue

M118 PS:{printer.pause_resume}

Basic Information:

Printer Model: Ender 3 S1 Pro
MCU / Printerboard: SonicPad
klippy.log
klippy.zip (302.4 KB)

Fill out above information and in all cases attach your klippy.log file (use zip to compress it, if too big). Pasting your printer.cfg is not needed
Be sure to check our “Knowledge Base” Category first. Most relevant items, e.g. error messages, are covered there

Describe your issue:

It seems even when my printer is paused, the Pause_Resume.Is_Paused returns False. I was attempting to modify my idle_timeout to account for pauses but it was acting like it never went into the true part of the if statement.

I added this code to my M600 macro and both times it prints False

[gcode_macro M600]
description: Starts process of filament change
variable_extruder_temp: 0
gcode:
   SET_GCODE_VARIABLE MACRO=M600 VARIABLE=extruder_temp VALUE={printer[printer.toolhead.extruder].target}
   M118 FCMac
   PAUSE
   M118 PS:{printer.pause_resume}
   UNLOAD_FILAMENT
   M118 PS:{printer.pause_resume}

This is by design: All variables / states in a macro are evaluated at the macro’s start. This means any changes to variables or states that the macro might execute will not be visible in this very macro call.

To work around this effect, you need to create another macro that does a new evaluation, e.g.

[gcode_macro EVAL_PAUSE]
gcode:
   M118 PS:{printer.pause_resume}

[gcode_macro M600]
description: Starts process of filament change
variable_extruder_temp: 0
gcode:
   SET_GCODE_VARIABLE MACRO=M600 VARIABLE=extruder_temp VALUE={printer[printer.toolhead.extruder].target}
   M118 FCMac
   PAUSE
   EVAL_PAUSE
   UNLOAD_FILAMENT
   EVAL_PAUSE

Ok that makes sense, then why would this act like it is always false?

[idle_timeout]
timeout: 600
gcode:
{% if printer.pause_resume.is_paused %}
wled_off
wleds_on
M118 Idle timeout while paused, turning off hotend
SET_HEATER_TEMPERATURE HEATER=extruder TARGET=0
{% else %}
M118 Idle timeout
TURN_OFF_HEATERS
M84
{% endif %}

Probably same logic: Instead of putting your gcode into the [idle_timeout] section, define a macro and call it from there.

Another useful hint: Whenever you resume, make sure to call a CLEAR_PAUSE, otherwise it might lead to strange effects.

So this is whats weird.
I start a print, run m600 and what you put above works and shows TRUE for both calls. I then let it sit until it times out, and it goes into the bottom section of that look, Idle Timeout, not the top, as if its no longer true, which is odd. I will try what you said and see.

And yes, I have the Clear_Pause in start and resume.