Bambu Lab X1 X1C MQTT

@WolfwithSword Hi Nick, do you know an easy way to change the time “sensor.x1c_bambu_x1c_print_end_time” format to 24h format?

It comes in as a timestamp itself so it would follow you HA settings for displaying time. Otherwise in whichever entity card you have it displayed in, you might need to add yaml to convert it (or make a template sensor, since it can also be 0 or N/A depending on other states).

I believe though there are settings/preferences in HA for displaying time which can cover it.

Wow, I’m impressed on what’s been achieved so far to integrate HA with Bambu printers. Amazing. Just a quick question here: I use both the AMS and two Eibos filament dryers. I thought about automating this load/unload from the two Eibos with one small motor mounted to the inside of the filament dryer helping the spool movement and one extruder on the outside pushing/pulling the filament itself (just like the AMS). Anyone tried something similar yet?

My current plan is: adding custom GCODE to the filament profile on filament start and filament end in order to trigger MQTT events, heat nozzle and use HA to activate those motors to insert/remove filament at the correct time and with the correct nozzle temperature. Also, when setting a pause requesting user input in that custom GCODE I assume it is also possible to have a feedback in HA for each stage of the automation (G400 U1 for example requests user to tap “resume” at the touchscreen), reducing a lot the risk of jams, clogs and errors. :slight_smile:

I have no clue on where to start looking for the needed hardware as I’m into 3D printing for only 2 months, but this seems like a solid idea. What do you guys think?

Definitely an interesting idea, not sure if I know of anything like that before. Though I’d be curious how that could work. Unfortunately there’s not really any linking between custom gcode in a filament start/end that can trigger an MQTT event - you can send gcode to the printer via MQTT but you can’t really read or get events from gcode being run.

Looks like the new firmware has dropped, and I need to fix a few things with the nodered flow(s). Hoping to get it done within the next week.

Also of note - RTSPS url’s for the camera are now “available” if you switch on the liveview switch on the X1C, seems to be independent of lan mode but regardless of lan mode being on or not I can’t seem to connect to it (even if I add in credentials). If anyone can get that working that would be great to share :slight_smile:

1 Like

I’m upgrading now and will give it a go. I’ll post back results.

Okay so after restarting the printer a few times, the RTSPS stream went from being unstable and only working for 2 seconds at a time, to now working flawlessly. I can’t get it to work with go2rtc or restreamer like some others have, but I’ve got it working in HA with just the “Generic Camera” integration.

When you go to devices & services to add the generic camera integration, here is what I have:

Stream Source:  rtsps://bblp:[ACCESSCODE]@[IP]:322/streaming/live/1   (it removed the port for me actually, so :322 may be optional)
Protocol: TCP
Auth: ignore this
username / password: ignore this
Frame Rate: 30 works

Disable "Verify SSL Certificate"

Once saved, go back to the generic camera integration to the entities, and rename it with the three dots next to the configure button, as by default it will be named after the IP address.

Unfortunately I can’t setup a streamable camera via mqtt so this will need to be done manually. I was debating making a pre-configured URL for this in the mqtt data but, since it contains access code, I’d rather not (unless I put it in as an attribute maybe? So it’s somewhat hidden. I don’t know if I’d be okay with that).

Settings + Camera entity in a picture-elements card.


b9046b

1 Like

FYI, using the basic authentication fields instead of credentials in the url worked for me.

I’ll have to try that later, only tried when it was unstable so not surprised if it works now!

Edit: Yep, it worked!

Not sure I understand how to use the basic authentication versus the url creds but mine is up and running. I see a little buffering but still more stable than what I had!

Bambu Studio to VLC to BlueIris to HA… and that was with VLC losing the stream frequently.

1 Like

Pretty sure the basic auth just injects the creds into the URL for you. It also helps to keep the password from sitting in the config line for the URL in plain text.

Sorry - duh… not enough coffee this morning. Got it working that way!

1 Like

I shut everything down for a few hours today and have not been been able to reconnect the camera since :frowning:

Already printing so can’t power cycle the printer. I tried toggling the Lan mode LiveView and reconfiguring the camera but nada.

Do you have it streaming anywhere else (like Bambu Studio)?

Yes, can still see it there and made sure that Go-Live was on there as well just in case.

When I tried to reconfigure the Generic Camera, it says it times out though which is odd since I’m connected to it via Bambu Studio.

It’s probably timing out because you’re connected from Bambu Studio. Apparently they limited the local streaming to one connection at a time. I had the same issue earlier.

I’ve been able to stream it with HA while also having it live on bambu studio and/or bambu handy app without problem. From my understanding, it’s limited to one local stream - which for bambu studio I think only is used if you’re in LAN mode?

@Corey_Johnson Did you try restarting the printer once after doing the firmware update? I reconfirmed thanks to the new hotfix firmware that on first boot from a firmware update, the RTSPS stream is very unstable - but once restarting the printer and waiting some time, it works like a charm. It may also be the case if you “first” enable the lan liveview setting after booting with it off.

1 Like

I just reset it, installed yet another firmware (01.06.01.00) and now it works again. Go figure.

1 Like

That was my assumption too but I couldn’t get HA to load at all when having the stream going from Bambu. Looking at the log data from studio, they’re using live555 to host the stream, which has multiplexing capabilities. It’s all conjecture at this point I suppose.

1 Like

I did notice earlier today though when I did not have the HA stream up but did have handy up for about 10m, after loading HA it was unavailable for about 3-5 minutes before it came back with no issues. So maybe it’s an issue with initializing the stream from the printer… Eh, if it works it works and sometimes it can :laughing: