Small klipper code help request

Need some help with some code. Basically I have console messages that report status notes for debug and info, but I’d like to suppress some of them during an active print. I only really need them when it’s not printing.

(Background: This in an IDEX printer, so I want to have the T0/T1 macros report when not printing, but not report when printing. There are other notices as well, but this is the main one).

Pseudo code:

If printer state = !printing 
then: RESPOND TYPE=echo MSG="Notice to Console" 
endif

It would be in a larger code block for a macro.

For the printer state, you can use idle_timeout.state != "Printing" For the rest of the macro, I would highly recommend you look at Macro Creation Tutorial .

[gcode_macro report_test]
gcode:
     {% if printer.idle_timeout.state != 'Printing' %}

       RESPOND TYPE=echo MSG="report test Idle"

     {% endif %}

printer.idle_timout.state was the trick I needed.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.