Possibility to recreate the "Lights dimm down when user not there" function from Prusa

Is it possible to create that feature?

basically there would be two triggers:

  1. do Macro A after y seconds.

    • that one is easy, UPDATE_DELAYED_GCODE should do the trick. I do some similar stuff for a Case-Fan which gets turned off delayed after a print finished.
  2. reset the timer for Macro A and do Macro B whenever the user makes any Input to the UI (every Button-Press, every klick on the Printers LCD etc.)

    • for that “reset timer” functionality I know that this is possible as I also do this in my delayed-fan function
    • But the first part (user interaction detection) I’m not sure if this is actually possible. At least I couldn’t think of any way.

Any ideas?

  • cad435

Hi @cad435 ,

I think idle timeout is what you’re looking for. You can dim the display when the printer is idle for an arbritary duration of time.

Oh that’s cool.
Thanks for pointing this out!

I somehow confused that with Stepper IDLE timeout.

Does someone know if this will also fire when a print is in progress?

  • cad435

The idle timeout wouldn’t go during a print. It might go during a pause, though.

OIK, as far as I can tell this would not allow to recreate the desired effect, because the [idle_timeout] “timer-reset” is only performed when a actual CGODE is processed. Not when the user is touching a button.

Also, there is no event fired in to “disable” the timeout. (e.g. when the user is pressing a button)

So If I’m not mistaken, [idle_timeout] is intended to be a security-feature to turn off any heaters when the printer is just not doing anything physical.

It does not tie to the user input things (take “upload a gcode” for example or “browsing the Klipper-Screen”)

  • cad435