Bambu Lab Printer WLED Presets

I tried to use existing blueprints and it was not working at all or was working partially. E.g. my printer has never triggered lidar related states therefor light was not turned off during scanning. So I decided to make my own blueprint.

This blueprint is more flexible and much more powerful as allows user to set not only LED strip color, but also effects and even gives possibility to use segments of a LED strip. The downside of this approach is that this requires more actions from the user.

The main idea is to create corresponding presents for your WLED light and activate them according to print state, current stage and chamber light entities. Basically what you need to do is create presents for each print state and current stage sensors` states that you want to handle.

E.g. I created following presets for my WLED light:

  • auto_bed_leveling
  • failed
  • finish
  • idle
  • init
  • offline
  • pause
  • prepare
  • printing
  • running

Now when print state or current stage sensor changes its state to new one that has corresponding preset, this preset will be applied. If there is no corresponding preset then nothing is going to be changed.

Also WLED on/off state will correspond to chamber light entity. When you turn it on/off the WLED light will turn on/off too. In case printer is in a finish state turning off the chamber light or opening/closing enclosure door is going to switch preset to idle. This is configurable if you don’t want to wait for finish to idle timeout.

After printer finishes print job automation will wait for certain timeout and switch light to idle mode. You can set this parameter yourself, by default it is 1 hour.

Each present represents one of the states of the print state and current stage. Some of them possible can be duplicates, e.g. printing/running/idle. You can also create segments and save your present for specific segments in this case only part of a LED strip will represent printer’s state.

Make sure preset name correspond to a particular sensor state (not its representation, usually underscore lowercase, e.g. auto_bed_leveling and not Auto bed leveling as it is presented in UI).

Make sure you restart WLED integration each time you created/renamed a preset as these options will be loaded only after integration restart.

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

P.s. If you have reasonable suggestions, please do not hesitate to offer. PRs are also welcomed.

You can check all possible values for the sensors by inspecting their state in a Home Assistant Dev Tools. They have attribute called options with all possible state options. E.g.

Print status values:
{{ state_attr('sensor.bambu_lab_x1c_print_status', 'options') }}

Current stage values:
{{ state_attr('sensor.bambu_lab_x1c_current_stage', 'options') }}

Hi
I’ve been trying to get this automation to work for days. It doesn’t show me any status. I’ve restarted the HA several times. Nothing will change. What am I doing wrong? WLED can be controlled via HA .The color doesn’t change when heating or neviling. The only thing that works is that I can turn the light on and off via the printer.

@DerGnom

  1. Can you select presets manually from HA? The entity name should be called something like select.xxx_preset.
  2. Are you getting updates for Print status and Current stage sensors in HA? You can check history for corresponding sensor, something like sensor.bambu_lab_x1c_print_status and sensor.bambu_lab_x1c_current_stage.
  3. Did you name wled presets using exactly the same names (it is case sensitive) as available options of print_status or current_stage sensor? You should have at least idle (lights on) preset and possible running, but you can create more.

It was my mistake. Since my English is already 30 years old, I translated it incorrectly and thus used the wrong variable.

Great! So did you manage to make it work?

Yes, it works perfectly!!
Thanks.

Now I’m going to build a status bar to show the progress. An external LED column next to the printer or above it depending on your taste
0-10% red 1 LED
10-20% red 2 LEDs
20-30% red 3 LEDs
30-40% red 4 LEDs

40-50% orange 1 LED, etc.

up to 100% green LED

But first I have to figure out where to get the data from.

I think you can utilize sensor.bambu_lab_x1c_print_progress sensor )

Yes, that’s exactly the sensor I’d use. I just don’t have the knowledge to implement it. I’ll have to see about that first.

Hey DerGnom, thanks for the Blueprint. I have it installed and running and I was wondering if your blueprint could incorporate a progress bar for the printing preset.

I think it could work be setting the print pre-set to the ‘percent’ effect within WLED. The parameter of that effect sets the percent of the fill (see below).

That number could be set as follows using the ‘print progress entity’ of the bambu printer integration:

Which would set the WLED intensity value:

This code might work:

service: number.set_value
metadata: {}
data:
  value: "{{ states('your_printer_progress_entity') | float(0) }}"
target:
  entity_id: number.your_led_strip_intensity

The trigger would be whenever the print progress value changes.

Credit goes LenDizzle, his youtube video, explains how this works.

Not sure how to incorporate it into your blueprint but I thought I’d send the idea your way as a suggestion.

@currest2620 I thought about this, but this looks like a separate task. I’m using this blueprint to control my main chamber light. And of course I want it to be useful to light up the bed and model. So typically I use all of the leds for this purpose. I can divide strip into segments and control them independatly but in this case it’s really difficult to see progress bar status especially if it is pointing down towards the bed. So this should be separate strip attached somewhere towards the user. Then I thought: well there is a screen right in front of user witch has progress information. So why then I need something additionally. That’s it.

1 Like

No worries at all.

Would you be able to update the Blueprint to make the Door Sensor optional so that this will work with P1S printers?

I was skeptical at first. I have to say I appreciate this extra flexibility. This is excellent work. Thank you!

1 Like

Im confused, is this to control the built in led light or a 3rd party led light. And why?

This is not for the built in LED. The purpose of this blueprint is to enhance your 3D printer with customizable lighting and visual feedback. Many users modify their printers with brighter chamber lighting, such as [example] or [example]. This blueprint allows you to control those lights via Home Assistant (HA) while providing visual feedback. Among the available blueprints, this one is the most complex but also the most customizable. If your printer lacks a riser with lighting, this blueprint may not be suitable for you. However, you may want to consider adding a riser, as it significantly improves the printing quality of life.

2 Likes

Sounds neat, ill give it a try. I currently have my printers without a riser was looking to make one and add lights anyway. My current setup is 3D printer switch always on and connected to smart switch. The switch is then add to home assistant, aswell as a switch for their built in led, and the rtsp feed from the camera is ported over aswell via scrypted :slight_smile:

1 Like

I can try to do that optional. Let me see what I can do.

Can you try to re-import the blueprint? It should work without door sensor now. Just leave it blank.

The progress bar unfortunately isn’t working for me