This is an add-on for julianschill/klipper-led_effects that allows defining and controlling LED chains across multiple toolheads. It provides tool-specific mapping and targeting (Active tool, Inactive tools, All tools, or Specific tools).
This is work in progress and currently in "beta" state. I don't take any responsibility for any damage that happens while using this software.
If you found a bug or you want to file a feature request open an issue.
The module can be installed into an existing Klipper installation with an install script.
cd ~
git clone https://github.com/AcrimoniousMirth/multitool_leds.git
cd multitool_leds
./install-multitool_leds.sh
If your directory structure differs from the usual setup you can configure the installation script with parameters:
./install-multitool_leds.sh [-k <klipper path>] [-s <klipper service name>] [-c <configuration path>]
- Clone the repository:
cd ~git clone https://github.com/AcrimoniousMirth/multitool_leds.git - Stop Klipper:
sudo systemctl stop klipper - Link the file (adjust paths as needed):
ln -sf ~/multitool_leds/src/multitool_leds.py ~/klipper/klippy/extras/multitool_leds.py - Start Klipper:
sudo systemctl start klipper
Define which LEDs belong to which tool using [multitool_leds] sections.
[multitool_leds tool_0]
tool: T0 # The tool name (case-insensitive)
leds: neopixel:sb_leds_t0 # The physical LED chain
logo: 1 # Group name: list of 1-indexed LED positions
nozzle: 2,3 # Group name: list of 1-indexed LED positionsIn your [led_effect] sections, reference the tool groups using the multitool_leds prefix followed by the group name and an optional targeting mode.
Targeting Modes (Case-Insensitive):
multitool_leds:group_name: Targets all tools (default).multitool_leds:group_name:Active: Targets only the currently active tool.multitool_leds:group_name:Inactive: Targets all tools except the active one.multitool_leds:group_name:All: Explicitly targets all tools.multitool_leds:group_name:T0: Targets a specific tool (e.g., T0).multitool_leds:group_name:Selection: Dynamic target controlled by command.
[led_effect logo_printing]
leds:
multitool_leds:logo:Active
layers:
static 1 1 top (1,1,1)Use the SET_TOOL_LED_SELECTION command to change what the :Selection suffix targets at runtime.
SET_TOOL_LED_SELECTION GROUP=logo MODE=Active # Future effects using :Selection target active tool
SET_TOOL_LED_SELECTION GROUP=logo MODE=T0 # Future effects using :Selection target T0To simplify your macros, use a helper macro to set the selection for all groups at once.
[gcode_macro _SET_LEDS_TOOL]
gcode:
SET_TOOL_LED_SELECTION GROUP=logo MODE={params.TOOL|default("Active")}
SET_TOOL_LED_SELECTION GROUP=nozzle MODE={params.TOOL|default("Active")}
[gcode_macro STATUS_PRINTING]
gcode:
_SET_LEDS_TOOL TOOL={params.TOOL|default("Active")}
SET_LED_EFFECT EFFECT=sb_logo_printingRemove all relevant definitions in your Klipper configuration and the updater section in the Moonraker configuration. Then run the script to remove the link: cd ~/multitool_leds ./install-multitool_leds.sh -u
If your directory structure differs from the usual setup you can configure the installation script with parameters:
./install-multitool_leds.sh -u [-k <klipper path>] [-s <klipper service name>] [-c <configuration path>]
If that fails, you can delete the link in Klipper manually:
rm ~/klipper/klippy/extras/multitool_leds.py
Delete the repository (optional):
cd ~
rm -rf multitool_leds