Bambulab to Home Assistant NodeRed Configurator

Bambu Lab Guides Published Feb 9, 2023
Updated Jan 29, 2024
🚩
Latest Version: 2.0.11 / 2024-01-29
Now with experimental A1, A1 Mini & X1E Support!
🚩
Important! X1C firmware 01.05.02.00 no longer sends information over MQTT for the following: AMS True Humidity %, Calculated PA value, Bed Mesh data. If you want these from these guides, I recommend downgrading to 01.05.01.00.

Check out a list of features my integrations can provide here!

Bambulab HomeAssistant Featurelist
A checklist of features that my various bambulabs guides offer for the homeassistant, nodered, mqtt integration.

Basic Implementation

Requirements

  • Home Assistant (Core or HassOS, either works)
  • MQTT Broker Connected to Home Assistant
  • NodeRed (No extra palettes needed)

First, fill out the following form below appropriate for your printer. Click Generate and it will download the NodeRed flow for your specific printer.

You can find the Serial Number in your printer's touchscreen, Bambu Studio or the Bambu Handy App. I also recommend setting a static IP for your printer in your router's settings. While on your printer, also get your LAN Access Code.

For the HomeAssistant MQTT server details, this will depend on your HA setup (Using Hassio with addons, in a docker container, running HA-Core in a docker etc). If using Hassio with the Mosquitto MQTT addon, your default username and password are your HomeAssistant credentials. If that doesn't work, check the configuration tab of the MQTT addon for a really long password, and then your username is default homeassistant, unless otherwise configured. Your ip/host is localhost.

For other setups where your MQTT broker is external, such as in HA-Core docker, you will need to enter in the appropriate settings for your setup. If you don't know or do not have it setup, I recommend following some tutorials for setting up MQTT or mosquitto mqtt containers for homeassistant (avoid any that say "addon").

Note: Your printer-name must be unique and if you choose to do the other configurators from my guides, must remain consistent when generating for that specific printer.

💡
This form data is processed in your browser and does not send to any servers or logs.

If you are using a P1P/P1S/A1 Mini/A1, there might be limitations. If you run your printer in LAN mode, then select "No" in the dropdown that appears in the configurator and that is it.

Otherwise if you have cloud enabled (so you can access camera for example) and are running firmware 01.02.02.00, select "Yes" and import a second flow (download below) into NodeRed.

If your P1 Series firmware is greater than or equal to 01.02.03.00, the bug of no LAN-MQTT access was fixed, so you can run cloud mode and still use local LAN. However, if in the Advanced flow later you wish for the 3mf's to download via Bambu's cloud server instead of FTP (Some users report FTP on P1P can cut out after a few kb and die off), you must select "Yes" in the dropdown and import/setup the second flow as per below.

Final note: If you do use the cloud server with the P1P and use the dashboard setup, you may not have start/end times or layer information.

You can change this setting without re-importing the node at any time by changing the variable in this image back and forth from true/false. I recommend experimenting if using the advanced flow which is more reliable for you.



While I could make this configurable, because it requires your BambuLab email and password, even though this website does not log anything, I do not feel comfortable asking strangers to input that data here. Instead, follow these steps:

1) Import the downloaded Login Flow into NodeRed (see steps below for general import instructions)

2) Click on the NOTES node and give it a read for detailed instructions

3) Click on the Config node and edit your email and password for your bambu account

If you log in via a third party, such as Google, simply go to the Bambulab website, log out if logged in and then select "Forgot" your password. Complete the reset process with your linked email to create a new password. Now you have both a email/password login and your third party login still works.

4) Deploy this flow when saved then continue with the steps below for the main NodeRed flow.

You will only need to do this once regardless of now many flows/printers you have setup. If you have P1Ps and X1Cs, it will work fine and the X1C configs will still do local MQTT.


NodeRed Import

Next, import it into NodeRed.

Then click the big red Deploy in the top right. This is how NodeRed "saves" and deploys the flows. Any changes are not done until it is deployed.

If you have multiple printers, repeat the configurator and in NodeRed, create a new empty flow to import it in. When you import the flow, please ensure you click Import Copy when it complains about duplicate nodes.

Duplicates of the same flow-group import are not meant to be on the same flow-tab, treat each flow-tab as separate for each printer.

For upgrading flows to a newer version of this flow, make a backup of your existing flow by exporting it (top right) as json and saving it on your PC. Then delete the contents of the entire flow. Repeat for each printer then redo the configurator as per this guide. Ensure the printer-name is the same as before and it will load in correctly.


That's it! You now have the Bambu Printer (and any attached AMS units) available in Home-Assistant. It offers plenty of sensors and control.

If you have any issues, leave a comment below (requires joining) or leave an issue on the (new) github for these flows, which contains more detailed information. You can also message me on Discord (@wolfwithsword), or anywhere listed here.

Additional findings and ideas can be discussed on the Home-Assistant forum too!

GitHub - WolfwithSword/Bambu-HomeAssistant-Flows: A collection of HomeAssistant Dashboards and NodeRed Flows with a configurator to connect a BambuLabs printer to HomeAssistant through MQTT - based off of my Gists
A collection of HomeAssistant Dashboards and NodeRed Flows with a configurator to connect a BambuLabs printer to HomeAssistant through MQTT - based off of my Gists - GitHub - WolfwithSword/Bambu-Ho…

Notes

  • The configuration form will always be up to date with the latest github changes
  • You do not need to enable LAN Only or keep it enabled for the access code to work. It does not change unless you regenerate it
  • If the printer is continuously offline, and NodeRed has messages in the debugger that the printer is not reachable, verify that the printer is not randomly disconnecting from the network. If you have multiple VLANs/networks or a non-simple home-network setup, this may be the cause. Either move the printer and NodeRed's host to the same VLAN/network, or allow some stuff through the firewall rules.
  • The "reset filter" button is not for the printer, but for the NodeRed flow. Clicking it will force sensors to "clear" and be updated when new data comes through. If you have sensor data issues and this does not solve it, you may need to debug and delete some topics in HomeAssistant MQTT using MQTT Explorer
  • If you restart HomeAssistant, sensors may be unavailable and seem "broken". Wait about 5 minutes and it will be fixed if your printer is online - it's just HA not updating from MQTT until I reset it, which I force every 5 minutes. Without it, your HA logs would be bombarded every second.
  • If any sensor is unavailable and you expect it to be there, wait 6 minutes, if still unavailable, click the "force reset". If still unavailable after another few minutes, then leave a comment to ask about it.
  • There are number-boxes which can set the target temperature of the bed and nozzle. They have limits but use at your own risk. They are useful for pre-heating the chamber in a script or modifying on the fly, for example.
Example of using the printer and an AMS in a Home-Assistant dashboard

Tags

WolfwithSword

A maker & hobbyist. Everything creative from the digital to the physical. I strive to make the world around me, rather than let it make me.