Multi Extruder Swapping - Request Current Active Extruder and Save it to file


The nozzle im using is the BTT 2in1out Hotend with a single heatbreak and heatzone.

I have check the documentation and i’m looking for a way ro request the current active extruder. I can find a way to ACTIVATE_EXTRUDER EXTRUDER=extruder. Im looking for a command along the lines of, GET_ACTIVE_EXTRUDER = x

My main goal is to use this and store it to the RPI as a save file. This is so when the printer gets power cycled it and recall this.

Furthermore for the T0 Macro to check with an if funtion:


The issue arrises when the slicer calls for T0 (T0 BIENG ACTIVE ALREADY)it will carry out the nozzle change script regardless, and when the wrong filament (filament 2, T1) is in the hotend after a firmware restart klipper automaticly resorts to T0 causing a filament jam.

I have little to no experiance with writing code so im weak on that front.

Any advice or guidance will be heavyily appriciated!

Many thanks,


klippy.log (13.1 KB)

I’ve got a 6-in-1-out setup, and the way I handle this is to always retract the filament from the hotend at the end of the print. That way the printer doesn’t have to remember which extruder is already loaded to prevent jams. It also makes it easy to remove and replace spools between prints since I don’t have to heat up the nozzle just to take a spool off.

Thanks for the reply, So I’ve managed to figure how to save which extruder is loaded in the file and recall it on start up, what I want to do now is try and implement an of fiction so when it calls for a tool change so see which filament is loaded and of the correct filament is loaded do nothing

I have a similar 2 in 1 out swapping extruder, and have been working on the same thing.

I have macros that do the tool changing, including recording to saved variables which extruder is currently loading, and knowing not to do anything if the correct one is already loaded. Also a couple macros to force the saved variables to be updated for which extruder is loaded, in case you changed it manually or something else messed up.

You can see my macros here: klipper-tronxy-x5sapro-skrpro/toolchanging.cfg at main · grantemsley/klipper-tronxy-x5sapro-skrpro · GitHub

Hey Grant,

just seen your post your GitHub is unavailable.

check out my config and let me know what you think:

hello you found the scriptright for 2 in 1 system?