[No Longer Maintained]Bambu Labs 3D Printer Integration

What is this?

A device driver for integrating Bambu Labs 3D Printers

Preview

INSTALLATION
Can be installed using HPM; just search for "Bambu Labs Printers".

Manual installation requires the parent and child drivers. All code can be found in my GitHub repo .

SETUP
Pretty straightforward.

  • Install the driver.
  • Create a virtual device using the "BambuLabs" device type.
  • On the device page, enter your IP address and access code* for the printer, and hit Save.

* The access code can be found on the network settings page on the printer. You may need to toggle "LAN mode" on to generate the code, but it can be turned back off.

The driver will connect to the MQTT server on the printer and automatically pull attribute information. The attributes are updated based on the set polling frequency using the "Attribute Update Schedule" command.

COMMANDS

  • Set chamber fan speed
  • Set aux fan speed
  • Set part cooling fan speed
  • Set nozzle temperature
  • Set the bed temperature
  • Toggle the bar light on/off (X1/X1C)
  • Toggle the toolhead logo light on/off
  • Unload filament

ATTRIBUTES

The following will be populated:

  • Bed temperature
  • Nozzle temperature
  • Fan speeds

EXTRAS

  • Can be used with [Project] Device Health Status [Tuya, Aqara, Ikea, Sonoff, Lidl and others] to monitor connectivity status.
  • Has the presence/healthStatus attributes for monitoring the connection status in Rule Machine.
  • An option to automatically attempt to reconnect. This will run every few seconds, but there's a 1 minute timeout built into the MQTT connection. So, the reconnection attempt will happen every ~1 minute. Advised to disable this option if you plan to kill power between prints.
  • All commands can be used through Rule Machine using the "Custom Action" and "Actuator" capability. Anything that takes a parameter (fan speeds, temps) are 'type' of 'number'.
My Other Things

[No Longer Maintained] Energy Cost Calculator
[No Longer Maintained] Sensor Groups+
[No Longer Maintained] Window Tracker
[No Longer Maintained] IoTaWatt+ [BETA]

6 Likes

Known Issues

  • I don't own an AMS and have only tested this with my X1C.

To-do List

  • Figure out a to-do list.

Feature Requests (Not Guaranteed)

  • None.

Relevant Links

oh you tease.

2 Likes

Not anymore.

2 Likes

All good here setting up and connecting to the printer! I'll have to play around with it a little more later to learn all the functions/states

1 Like

Do you know if the mqtt interface exposes job status - % complete and similar to what octoprint mqtt plugin supplies?

Version 0.1.2 Released

  • Added print percent complete
  • Added print time remaining
  • Added current print file name
  • Added rounding for the fan speed readings.

@ccoupe

1 Like

Thanks. I have a home built notification scheme for my other printers. I can modify your driver with a few lines. I'll send a pull request in a few days and you can decide whether you like the mod or not.

2 Likes

Looking pretty good from an update stance on my side. Set my update schedule to 60 seconds. The other two devices are phones with the Life360 handler

image

[quote="FriedCheese2006, post:2, topic:117942"]
I don't own an AMS and have only tested this with my X1C.
[/quote],

I do have an AMS. The driver works OK without dealing with one or more of them. I don't think we need to replace Bambu Studio or Orca Slicer with Hubitat controls to unload the filament, for example.

You're free to not use them, but I'll keep the current functionality and look to add support for others as I can.

That is good information for me to know. I had the same issue with the 'common' HE octoprint drivers. My requirements are just status reporting - everything else just gets in the way - for me. I'll write my own driver instead of trying to fit into yours. Thanks.

You could easily just modify my code to remove what you don't like or feel free to write your own. You could also, easily, just ignore the commands.

Oh, I'll start with yours and make the changes I want. It probably won't be merged back into your codebase though. We'll see.

What is the use-case for adding the Notification capability?

I have three devices I built that display text messages on small lcds. They get the text from individual MQTT topic. There are HE device drivers for sending the notification to mqtt. Also on HE, there is a app and child app that accepts one notification and broadcasts it to multiple recipients. I have hubitat rules/devices that send notifcations and I have other processes on other computers that also send small messages to the display devices. Quite handy. For example when Ender 3's printers throw a fit. Restricting notifications to cell phones is very limiting, for no reason.

The printer doesn't need the notification capability to be used in notifications for other devices.

You are correct. I wonder why I had it? It's definitely working without the notification capability.

[Edit]
Unless I need it for selection (find all things that send notifications). Rule machine for example.

That function is for devices to receive notifications like phones, TTS devices, etc.

I do like your idea for suppressing events that aren't changes in the attribute values. I'll implement that part.

Finally sat down to look at deduping the events, but I see that the Hubitat platform appears to already be doing that for us:

Note that the only events are when the value changes. Are you seeing something different?