X1 Carbon Integration?

Hey all,

It looks like we are starting to see integration for those of us with Bambu Labs printers.

Right now there seems to be two flavors, basically was looking to get a view of what are people using, what’s working well and what the future might be?

Also looks like the camera feed is in dev, anyone seen anymore news on that?

MQTT and Node Red

HACS integration

1 Like

I can give a quick rundown at least from my point of view for the current status and future work.

The NodeRed + MQTT approach currently has the most data available to it and is quite customizable, but that’s mostly due to all the work doable via nodered. It also makes it far easier to expand into advanced data, such as the following:

  1. FTPS Fetching for Image Extraction and 3mf file data extraction
  2. DB pushing of print data
  3. Easy collection and parsing for extra data (AMS True Humidity %, PA Calibration Value, Bed Mesh Data for visualization)

Regarding the HACS integration, its goal is to get on par to the nodered + mqtt approach. One way to see it is the NodeRed approach is “bleeding edge, likely to break” and the integration is a “slow, stable, but easy” approach. Some things are easier in the integration due to its close ties to internal working of HA and custom code being possible.

However it is also limited in some ways by HA. It may be possible to do the FTPS and file extraction for the image and other metadata but is a bit harder. Making a custom listener inside for PA value or bed mesh would be hard, and the bed mesh may not be useful to the current HACs integration as even in my nodered flow, I can’t store the data in HA, and have to rely on mqtt or external services/db’s to store it and visualize it - it can’t be done natively due to HA limitations.

The integration setup and updating is much, much easier, but development can be slower. I haven’t had time to contribute since early on, so it’s mostly been Greg and Adrian working on it, who I’m sure are both just as busy :laughing: I believe right now, the goal is to add in some more parity between the two especially regarding printer control, but also to fix some bugs around the P1P disconnect situation.

As for the camera feed, we’ve all been keeping an eye on it, but no news yet aside from yes it’s being worked on. I’ve been preparing a possible way to integrate it with the nodered flow for an upcoming large overhaul/update.

As for how the future goes, I can think of the following:

a) NodeRed + MQTT approach will continue to be updated as new things come out or I get new ideas, anything abnormal or out of the simple flow will be “additional flows”, like my advanced flow for ftps + db, remote print, bed mesh’s etc. My plans are to basically continue to use it as people suggest ideas and/or I come up with them (soon planning maybe to setup a filament tracking system, just in thoughts process right now).

b) NodeRed + MQTT approach will also be getting a major overhaul soon. I am updating everything to consolidate as many of the variables as possible into singular nodes which set flow variables, so re-configuring a flow should be much easier in case a mistake is made. Additionally as part of this, I will be creating a github pages site for the configurators should a meteor hit and take down my website :laughing:

c) HACS Integration will slowly keep building as much parity as possible to the NR + MQTT approach. Some things may not be able to be ported but I’m sure most can with time. I’m hoping I can come back to contribute to it again in the near-future.

d) Other projects have been popping up lately (I’ve helped contribute to one guy who was making a git-wiki for the “mqtt and other bamby api docs” unofficially, helped a guy also made a discord bot that synced with the MQTT from the printer, also helped a guy make an ESP based led controller running custom firmware connecting to the printer states - at the same time as developing my own led + fan control kit using esphome :laughing: )

e) I was also contacted by some folks early this year from a printer management startup company about potentially building a bambu integration to their software/tools. I declined for a few reasons, but I offered my knowledge base to them regarding the setups. Last I heard they’ve made some slow progress on it and plan to hopefully make it compatible soon, though some of the features they “required” are still not fully possible like the live camera feed (as well as print file upload and remote start - it’s possible and I’m working to improve my own implementation, but it’s weird at best).

f) I’m also considering making a standalone python script purely for my bed mesh visualizer as many folks seem to want to use it but not setup everything else. I plan to have this up and out something within the next month or so, as I am quite busy with work currently.

I hope this helps give some info, but let me know if there’s anything else in particular you wanted to know, discuss, etc :slight_smile:

Aw, thanks mate! I really appreciate you taking the time to give such a detailed answer. I’m sure others looking for the same info will get a lot out of that as well :slight_smile:

I think I’m going to go with the Node Red for now. I really like that idea of filament tracking at some point. I don’t use the Bambu filaments so some thing where you could input type and color and have it record what’s used would be amazing! Is that what you’re kinda thinking?

Personally auto start and such I don’t really have a use for. The best things I’ve found is Alexa control (with my old Ender 3 and Octoprint) getting print status or quickly pausing when something is going to go wrong, I’ve found super helpful. Also getting it to announce to all the Alexas that the prints done (between 9-10pm, then it will push it to the next day otherwise) is really cool.

Ive missed a lot of these features since I got the X1, but I could never think of going back to the Ender :rofl:

Also, why worry about what the mesh looks like? Since having the X1… never, relatively anyway, have to worry about anything like that :heart_eyes: :rofl:

One more question when you have a sec, what does your dashboard look like? One thing I have found hard is to keep the dashboard from breaking with all the updates and changes, I’m using minimalist UI and its slowly turned into a mess over the last 8 months HAHA

Mesh was more for an interest point so I could visualize it. Also made me notice that the back of my bed for like over half a year was lower, so I levelled that off and then padded low spots with blue tape and now my bed is very very very flat. Noticeable difference? Only in bed-sized prints but otherwise very minor, but it’s nice.

My dashboard is pretty similar to the buildup you would get from using my yamls for it, with the addition of some more sensors, fan/light controls for my bento box and top lighting (PWM controlled via esphome), fan controls for the printer, my PA calibration, and then webpage panels from Grafana showing my list of recent prints, cost in material and energy of recent prints, and latest bed mesh visualization.

Dashboard should never really break with updates/changes, and almost never have updates itself to be honest, it’s mostly just nodered basic and advanced flows that need updating.

I also use the printer/ams device pages themselves sometimes, so I’m not consistent myself :laughing:

Someone asked for my Alexa notifications, here is the Node Red for it.

Most of this is due to the great work from Nick is setting up the complicated flows to allow access to the printer.

But added here are my notifications.

Just note to go though carefully and change the entity names to make sure they match yours.

Also I found the best way to trigger though Alexa, was to create a Boolean that is surfaced up to Alexa as a scene though Nabu Casa, then create a routine that triggers the scene.

Printer status and % complete

[{"id":"c129f43362e8424a","type":"api-call-service","z":"b5c06d389ad8d106","g":"059b6953aaba21ee","name":"Turn off Print Status input boolean","server":"d272ac3c.e0735","version":5,"debugenabled":false,"domain":"input_boolean","service":"turn_off","areaId":[],"deviceId":[],"entityId":["input_boolean.x1_carbon_status"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":800,"y":440,"wires":[[]]},{"id":"5e17ad25f970bcf7","type":"api-call-service","z":"b5c06d389ad8d106","g":"059b6953aaba21ee","name":"Annouince the Printers status","server":"d272ac3c.e0735","version":5,"debugenabled":false,"domain":"notify","service":"alexa_media","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"The Printer is {{states('sensor.x1c_x1_carbon_print_status')}} [{% set printstate = is_state('sensor.x1c_x1_carbon_print_status', 'RUNNING') %}  {% if printstate %} Printer is at {{states('sensor.x1c_x1_carbon_print_progress')}} % and will finish in {{states('sensor.x1c_x1_carbon_print_remaining_time')}} minutes {% endif %}]\",\t\"data\":{\"type\":\"announce\", \"method\":\"speak\"},\t\"target\":[\"media_player.bedroom_show\",\"media_player.echo_show\",\"media_player.bathroom\"]\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":480,"y":440,"wires":[["c129f43362e8424a"]]},{"id":"f2eddae9faca4346","type":"server-state-changed","z":"b5c06d389ad8d106","g":"059b6953aaba21ee","name":"Printer Status Boolean turns on?","server":"d272ac3c.e0735","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.x1_carbon_status","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":190,"y":440,"wires":[["5e17ad25f970bcf7"],[]]},{"id":"d272ac3c.e0735","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]

Announce printer is finished;

[{"id":"113b7def5c085742","type":"trigger-state","z":"b5c06d389ad8d106","g":"059b6953aaba21ee","name":"Did the Printer finish?","server":"d272ac3c.e0735","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"sensor.x1c_x1_carbon_print_status","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"FINISH"},{"targetType":"this_entity","targetValue":"","propertyType":"previous_state","propertyValue":"old_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"RUNNING"}],"inputs":1,"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","enableInput":true,"x":160,"y":280,"wires":[["ccd6a3700ecba1a9"],[]]},{"id":"ccd6a3700ecba1a9","type":"time-range-switch","z":"b5c06d389ad8d106","g":"059b6953aaba21ee","name":"11PM to 9AM","lat":"-33.924211898294686","lon":"151.1886483807575","startTime":"23:00","endTime":"9:00","startOffset":0,"endOffset":0,"x":420,"y":280,"wires":[["6dd9cd426f157f5a"],["c9828b8bbaadfeea"]]},{"id":"6dd9cd426f157f5a","type":"delay","z":"b5c06d389ad8d106","g":"059b6953aaba21ee","name":"","pauseType":"delay","timeout":"15","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":450,"y":380,"wires":[["ccd6a3700ecba1a9"]]},{"id":"c9828b8bbaadfeea","type":"api-call-service","z":"b5c06d389ad8d106","g":"059b6953aaba21ee","name":"Announce Printer is finished","server":"d272ac3c.e0735","version":5,"debugenabled":false,"domain":"notify","service":"alexa_media","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"The X1 Carbon has finished, please remove the print\",\t\"data\":{\"type\":\"announce\", \"method\":\"speak\"},\t\"target\":[\"media_player.bedroom_show\",\"media_player.echo_show\",\"media_player.bathroom\"]\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":720,"y":280,"wires":[[]]},{"id":"d272ac3c.e0735","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
1 Like

Does the HACS integration work locally?

Both the HACs and NodeRed integrations work with the printer in local/lan mode. The only caveat is for P1 series (and likely A1 Mini) there is a limited number of MQTT clients who can connect to the printer when not using the cloud connection. So if you use other things like XTouch, BLLED, or have the handy app and slicer/studio open at the same time, something will stop working.