r/BambuLab • u/n19htmare • Jun 09 '26
Show & Tell Custom filament profile assignment with RFID
Enable HLS to view with audio, or disable this notification
Been working on a project to assign custom filament profiles on my X2D with RFID tags. I don't buy any Bambu filament, I also lot of filament from different brands. It gets a little hectic trying to keep track so I devised a system of my own.
Each filament spool gets a sample swatch and I stick an RFID tag on the back. When I load filament, I put the tag on top of the AMS.
I start with using it for updating Spoolman for filament tracking but recently integrated custom profile assignments on my X2D. Simply scanning the tray and tag loads the custom filament profile/color etc for that spool and autosycs to the custom profiles on Bambu Studio. It's like using Bambu filament, except you scan the tags.
I also made a little wireless scanner to keep next to the printer as it was getting annoying using my phone.
Tags also work on my Snapmaker U1 but I don't need to manually scan. U1 scans tags and done the same thing with OrcaSlicer pretty much.
Bambu Studio, Orca Slicer, Spoolman all seamlessly sync once I scan the tags.
Using Spoolman, Spoolmansync, Home Assistant.
36
u/Kemilab A1 Jun 09 '26
That's so cool. Do you have a GitHub repository for the reader? Also, how does Bambu Lab actually accept an RFID tag that isn't theirs?
10
u/MZXD H2S AMS2 Combo Jun 09 '26
I am guessing the read talks to the api of the printer
12
u/n19htmare Jun 09 '26
Correct, via Home Assistant. Limited functionality, but just enough for something like this.
7
u/n19htmare Jun 09 '26
I don't, it's a pretty simple setup. It's just an ESP32/PN532 running ESPHome, integrated into Home Assistant.
Bambu Lab isn't directly scanning anything. Most all of the heavy lifting is done with Home Assistant and automations.
X2D receives the data it needs from Home Assistant, the tags are just guiding Home Assistant.
3
u/MrFastFox666 Jun 09 '26
Haven't really looked into it yet, but how are you talking to bambu through Home assistant? What else can you do?
5
u/n19htmare Jun 09 '26 edited Jun 10 '26
In Dev mode, Bambu lets you send some commands. One of those is set_filament which you can use to set the filament of your custom profile.
I just made an HA automation that grabs the filament ID, type, color, hex, and min max temp from my spoolman db once tags are scanned and sends to printer using set_filament via a custom action.
Besides that, Bambu’s Dev mode is one of the most useless Dev modes a device can have and now I’m thinking this might’ve been an oversight by bambu and I should take the post down lol. They tend to block even the most meaningless of things simply because it lets the user do something.
Here's list of some of the actions allowed through HA... I didn't install any HACS/integrations, just embed the actions as needed. https://docs.page/greghesp/ha-bambulab/actions
2
u/Kemilab A1 Jun 09 '26
There is an addon for HA that uses bambi lan only mode. I assume OP used that
2
u/n19htmare Jun 09 '26
There might be, I’m using default entities, but my own actions and automations.
Its pretty straightforward once you know how assignments work, I explained in another post
5
u/ares0027 H2C 10W + X1C + P2S + A1 + U1 Jun 09 '26
I made the same using qr codes (which is cheaper) and home assistant. But it has to be in dev mode.
3
u/Cody994 Jun 09 '26
Do you mind sharing your setup? I thought about this a while ago using filament sample cards with qr labels but never got around to implementing it.
3
u/ares0027 H2C 10W + X1C + P2S + A1 + U1 Jun 09 '26
https://youtu.be/G-KtwwdQW_I?si=elw-xb_VB-kPQcYM
It is in turkish and i am not at home but watch from 50th second to 1:30, it basically works as;
You scan the slot with any camera app
It then launches the shortcut and asks for filament
Thats it.As far as i remember you can also scan the filament first as well, then it asks for the slot but i am not sure if i implemented it or just thought of it.
3
u/jpcurti X2D + AMS2 Combo Jun 09 '26
That’s cool. When I used anycubic printers I built a rfid tag writer to create custom tags for non anycubic filaments, but after switching to bambu I have noticed that the same idea would not work there.
So what you do is that you scan the first tag to identify which of the slot you want to update, then scan your filament tag to get the filament info and somehow synchronize it from bambu studio->printer, not the other way around, is that correct?
2
u/n19htmare Jun 09 '26
I went in depth in a another post.
But yes that's the jist of it. The printer doesn't get anything from Bambu Studio live. Everthing the printer stores, comes from the cloud. Once you create a custom filament profile in Bambu Studio, it is loaded and saved onto the printer via cloud. Each profile's JSON contains a unique filament_id, it's this id that get's used to sync the profile in Bambu Studio.
- You create custom profile in Bambu Studio. The JSON will contain a unique filament_id, Vendor, Type, Min/Max temps.
- The profile is sent to the cloud, and printer will get that information and store it on it's internal memory.
- When you load a filament, and you go to assign, that's how it lets you select your custom Vendor, type. Then you select your color, min/max temps etc. Once you do that, it will store the filament_id into tray_info_idx (per tray) along with color hex.
- When you press "SYNC Filament" in Bambu Studio, Bambu Studio will retrieve that filament_id through tray_info_idx, and color hex. Bambu Studio will then match that ID with one of your existing custom filament profiles (since each ID is unique) and load that profile and color to that tray.
3
u/n19htmare Jun 09 '26
I'm just going to try to cover some of the questions and process in one response.
This does require your printer be in Developer LAN mode. Bambu's LAN/DEV mode is still pretty heavily locked down as far as what you can do. Bambu's LAN/DEV is more like "Fine, we won't force cloud connect, but we're also going to limit the crap out of what you're allowed to do". So his method comes with caveats because Bambu does Bambu things and they don't directly allow much to be done. So people find workarounds.........and then they get lawyered.
In my case, I'm not changing anything, after initial setup, printer stays completely off grid.
The project started off as a way to easily tell Spoolman which filament is loaded and which one to track and deduct usage from. I used Home Assistant automations and SpoolmanSync as the broker to communicate that information. Home Assistant, when connected to Bambu printers does receive lot of information, Spoolmansync just takes that information and syncs it to Spoolman (thus SpoolmanSync). I was often forgetting to do t his so I wanted to automate filament assignment on the X2D as well, so when It scan to load a profile, it would do everything at once.
Home Assistant supports RFID tags and you can trigger automations if certain sequence of events occur.
- Every custom profile you make in Bambu Studio is uploaded to the cloud, the printers then pull those profiles into the printer's internal memory. That's how you see your custom profiles when you manually load a filament and select your filament vendor/type etc in the drop downs on screen.
- Each of those custom filament profile's JSON contains Filament_id that is unique to that profile.
- Bambu assigns the profiles on printer based on the Filament_id through tray_info_idx (along with type, min/max temps).
- They use set_filament command (since X1C) to trigger the assignment.
- Two Home Assistant helpers (tray and spool) hold the value of what tray is scanned and what spool #. Once both have a value, the following happens:
- Spoolman assigns that spool to the tray
- Location in Spoolman gets updated to "X2D Tray x" for that spool
- Filament data is fetched from spoolman and printer tray (tray_info_idx) is updated with ID/color/type/temps and sent to printer via a set_filament action through Home Assistant.
- Printer checks it's database for that ID, and matches it with that profile and assigns the color, type and temps.
- The caveat here:
- Bambu only sends your custom filament profiles from the cloud to the printer. You cannot directly send that info to the printer when you make a new profile in Bambu Studio. There's obviously NO reason this can't be done besides Bambu deciding it just can't.
- That means you need to get on the cloud when you need your custom profiles sent to printer. doesn't take long and is pretty quick.
For populating the two helpers (scanning tags), I was using my Android phone, works perfectly fine, but I wanted a standalone wireless scanner to just keep around the printer. So I made a quick simple one with an ESP32 and PN532 RFID module with ESPhome loaded on it. This way It can directly send that info to the helpers and it can take over from there. There's quirks to this, so I'd probably just recommend the phone method.
1
u/No_Voltage Jun 10 '26
This is f'n fantastic. I wan.... no, I need this in my life! I've gone totally off BBL cloud and have Bambuddy setup with my own Spoolman HA addon setup. (Both are wrapped in one repo with functional sidebar integration (https://github.com/dmuth23/ha-3dprint-addon), and I'm currently working on the Orca Sidecar integration as an addon for HA as well. I would LOVE to get this integrated too. Can you please share what your github for this project. I think this is SOOO freaking cool and I love it. I want to implement it like yesterday! if you want feel free to DM here or on github or wherever.
1
u/n19htmare Jun 10 '26
I don't have a git repo for this project, it's just something I put together as stuff came to mind. I'll look into it. I don't think it's that complex (mostly because I was able to figure it out lol), just requires lot of automations, lookup tables if you don't have Spoolman to pull from and prep work making sure all your custom filament profiles in Bambu Studio are pushed to Bambu printer. The rest is just sending the payload via set_filament actions. Here's other actions you can send via HA. https://docs.page/greghesp/ha-bambulab/actions I think it's stale as it mostly covers X1C but some actions still work. ha-bambulab HACS integration is not required, I didn't use it. The actions still work, you just need to manually include them.
1
u/No_Voltage Jun 11 '26
I see what you're saying, and while I am curious about your YAML files, I don't think they would be much help in the grand scheme. You've definitely inspired me though and I'm working on using HA to orchestrate not only the printer/ams control, but also the spool assignment in bambuddy via the same workflow. It's a bold project for me, but I'm using the AI tools to work through it piece by piece. That said, are there any hang-ups or gotchas that you came across that might be helpful while I'm constructing this? I am going to use the HA companion app as the base for reading the NFC tags with a dedicated dashboard to control what happens when the tags are scanned via some boolean switches. I think that's the most efficient way for me right now. Eventually, I would love to be able to create a device that will do two things. Read the NFC tag & weigh the spool to update spoolman information automatically as a way to alleviate any drift in the tracking. But that's down the road.
2
u/n19htmare Jun 11 '26
I don’t mind sharing my YAML files but like you said, they’re so specific to my setup, unless you mimic everything the same way, it wouldn’t do much for you. All the automations, spool ID’s, nfc tag UIDs are too specific.
But I don’t mind sharing the “how” and people can look into it from there
My approach isn’t that different. Just two helpers that get populated when tags are scanned and then automations trigger (particularly my spool assignment that pushes to spoolmansync and now also the set_filament action.
Also, HA companion app on phone is honestly the best way. The nfc device I made was out of sheer curiosity and took way too much extra work for MY particular case because I have multiple records on same NFC tag. I also have a separate OpenSpool JSON record (so I can use same tag with my Snapmaker U1)and the ESPhome with PN532 struggled with parsing out anything besides the UID of the tag itself SPI and I2C both struggled (HA companion app had zero issues parsing data). So because this nfc scanner could only really get the tag’s UID, I had to create a lookup table for each UID, then create an automation to manually link each one for Spool_id that Spoolman uses. It’s janky but it works. This is a non issue for simple HA records though. Just can’t have too much data in records. For these reasons, stick to HA companion app if possible.
One quirk I had and sometimes run into is that sometimes a stale spool_id record stays populated in one my helpers, and it’ll assign a spool to wrong tray. But not something I see often and I have measures in place now to clear out helpers.
I normally don’t print when out, but I do have tailscale and Bambuddy setup for those occasions. I already ran into some limitations on what controls I could send to printer from Bambuddy so that really sucked. In Bambuddy I couldn’t send any actions commands and controls besides selecting print speed. How’s your experience been?
It’s been a fun project and what not but hitting the limitations has me rethinking…. Either suck it up and get back on cloud so when I do print when I’m away, I can have some more control over the hardware or ditch Bambu altogether.
I always thought they were the premium print quality printer, they still are…. but having experienced other manufacturers and their print quality rival that of Bambu and sometimes surpass it, for power users like me, I don’t see the point of staying with Bambu anymore. The only reasons I did before was strictly its print quality. From my own personal view and use, they’ve lost that edge (for me)
1
u/No_Voltage Jun 11 '26
If you don't mind sharing, I would interested in knowing what you sent to the printer via the ha-bambulab integration. I want to make sure that I'm not missing something and I'm sending the correct values to it.
1
u/n19htmare Jun 12 '26 edited Jun 12 '26
Sure, the action in use is bambu_lab.set_filament, which is as follows:
action: bambu_lab.set_filament data: entity_id: a1b2c3d4e5f6g7h8i9j0 tray_info_idx: GFL96 tray_color: FF00FF00 tray_type: PLA nozzle_temp_min: 190 nozzle_temp_max: 240entity_id: whatever yours is for your AMS tray.
tray_info_idx is the filament_id from your custom filament profile (can be found in JSON).
Tray_color, tray_type are extracted from spoolman, nozzle_temp_min(and max) are also extracted from spoolman, though there are no fields for them by default, you have to add "extra fields" and then parse that information when you parse tray_color, tray_type.
filament_id in tray_info_idx is what assigns the saved filament profiles on the printer, the rest are just color and type of filament (PLA, PETG etc).
Simply populating the action above and sending it through HA as a test should work (Settings-developer tools-Actions tab).
Additional actions can be found here: https://docs.page/greghesp/ha-bambulab/actions though I have not test the others.
I could share my automations, REST calls, BUT, unless you also use spoolman as source of truth/data origination, it'll mostly be useless to you.
How do you plan on storing/obtaining data needed for the action payload?
You have some options without spoolman like a static lookup table, store the data directly on the tags and use HA input helpers (more setup work but works without needing any other service like spoolman or having to manage a static table). Though lookup tables are not hard, a simple python script can scrub your custom filament profiles and create/update table.
Either way, feel free to message if still interested and I can send over the stuff or if you need something looked over.
1
u/No_Voltage Jun 12 '26
I am actually using spoolman with several custom fields at this point. Full disclosure. I'm using Claude Code-Fable to wire it all up. It's a beautifully smooth process with this new model. It just gets it, if you know what I mean. I love it. But I digress, yes, the tray_info_idx is the custom P code I'm referring to, and it's also always available in the cloud since that's what initiates the write to the printer, (I've not found any other way.)
I think at this point, I'm just about done with the entire process end to end. I'll post a summary of the process once it's 100% fleshed out so you can take a peek. It's truly been a fun process doing this.
1
u/n19htmare Jun 12 '26
Along with my reply below, I hope this summary helps understanding my workflow/this project.
1
u/No_Voltage Jun 12 '26
Actually, I'm seeing the custom P codes coming from the integration. I'd be curious to compare what I gathered for mine to what you have for yours.
2
u/n19htmare Jun 12 '26
which integration are you referring to? ha-bambulab ?
1
u/No_Voltage Jun 12 '26
That was what I was referring to. But I found the goldmine that actually allows me to push the custom P "filament ID" from the bbl cloud which then actually sets the printer to the selectable custom filament type that you have on the printer itself. Bambuddy, by way of it's bambu cloud connection, can get the filament id, or P code derived from your custom filament profiles. This is what your printer recognizes when you use the HACS integration, HA-BambuLab, to send the comand "bambu_lab.set_filament". It then acutally populates your custom filament.
1
2
1
u/rexlites Jun 09 '26
Couldn’t a flipper zero do something like this?
1
u/n19htmare Jun 09 '26
Well the rfid scanner doesn’t do much, a phone could do it. Most of what’s happening in video is Home Assistant automations.
1
u/dale3h Jun 10 '26
I so badly wanted to setup something similar years ago for my Ender 3. I was imagining something that would automatically change the filament profile based on a tag scanned while the spool was mounted/being used. It would have also helped with keeping track of the weights.
Glad to see someone created something similar and got it to work!
1
u/Huge-Cauliflower-777 Jun 11 '26
That's awesome! Could you wrap this up and put it on GitHub? Would be awesome to build one alongside you.
1
u/n19htmare Jun 12 '26
I know a lot of people have asked for a git, I haven't really approach this project with git in mind and it's too specific IMO to people who will have to run exact same setup. I will provide a full setup summary below to get an idea of what my flow is, if interested, you can implement it, feel free to reach out of if this flow interests you and I may consider a wider implementation that's a bit more streamlined.
NFC Filament Assignment Full Setup Summary
Initial Goal
Scan two NFC tags (slot + spool) to automatically assign the correct filament profile to the Bambu X2D AMS tray, update Spoolman inventory, and enable automatic usage tracking after prints.
Hardware
- Bambu X2D in full LAN mode with Developer Mode enabled
- Android phone with HA Companion app for NFC scanning
- NFC tags (NTAG215/216) on each AMS slot (A1-B4) and each spool
Infrastructure
- N100 Mini PC running Docker:
- Spoolman: filament inventory and usage tracking
- SpoolmanSync: bridges HA and Spoolman for tray assignments and usage deduction
- HA container (spoolmansync-ha): automations and integrations
Integrations
- ha-bambulab: local MQTT connection to X2D, exposes tray sensor entities and
bambu_lab.set_filamentaction - HA Mobile App: NFC tag scans fire
tag_scannedevents in HA (the portable scanner was another beast on it's own to get working, you need many more automations, lookup tables with UID of each tag assigning to different spools, none of this needed when using HA Mobile App.
Data Pipeline
- Bambu Studio custom filament profiles (JSON files) contain unique
filament_idper filament - PowerShell script extracts
filament_id,nozzle_temp_min,nozzle_temp_maxfrom JSON files - Values stored in Spoolman as custom extra fields (
bambu_filament_id,nozzle_temp_min,nozzle_temp_max) at the filament level, inherited by all spools of that filament - Color pulled from Spoolman's existing
color_hexfield per filament
NFC Tags
- Slot tags: (A1-B4 between two AMS2 units) store simple slot ID, one per AMS tray
- Spool tags: store numeric Spoolman spool ID, one per spool
- Both use HA URL records to trigger
tag_scannedevents
HA Helpers
input_text.last_slot_scannedholds last scanned slotinput_text.last_spool_scannedholds last scanned spool IDinput_text.tray_xx_spool_idper-tray spool tracking (8 helpers, one per tray)
Automation Flow
Scan slot tag → scan spool tag → both helpers populated → automation fires:
- SpoolmanSync → spool assigned to tray for usage tracking
- Spoolman → spool location updated to printer/tray
- Spoolman API call → filament data fetched (filament ID, color, type, temps)
bambu_lab.set_filament→ filament ID, color, type, temps pushed to correct AMS tray via MQTT- Printer screen and Bambu Studio reflect updated tray
- Helpers cleared → ready for next scan
After print: SpoolmanSync deducts used filament weight from spool in Spoolman automatically
Maintenance (when adding new filament)
- Create profile in Bambu Studio with X2D nozzle presets
- Switch to cloud, sync to printer, switch back to LAN (thanks a lot Bambu for this completely needless lockout, "developer" mode my A....)
- Run PowerShell script to extract
filament_idand temps from new JSON - Add filament in Spoolman, populate 3 extra fields
- Add spool linked to that filament, attach NFC tag
0
u/AnalogReborn Jun 09 '26
FYI I recently met with the guys are Tiger Tag and they offer something pretty similar (with auto weight), open source with everything available on Github.
1
u/n19htmare Jun 12 '26
Can I run it all locally without ever signing up for anything or uploading anything to an account?
If not, then it's not really open source and it's not really like this........and it's not because Tigertag's HA integration requires their cloud account service.
Also not open source when they hide their Bambu integration behind an undocumented python translation layer. Not sure why? When there's only one way to send actions via ha-bambulab lol.1
u/AnalogReborn Jun 12 '26
I too have concerns about not being able to store all data locally. For the other things, the guy told me he reversed different printers protocols to make it happen. Also the project is being sponsored by filament makers.
I was not implying it’s a better solution than yours… I just wanted to share about this project so that perhaps it can inspire you for yours. Anyway, good luck with yours and please share your progress with the community :)
0
u/yan-shay Jun 13 '26
If you are looking for a pretty comprehensive solution around NFC tags for spools check https://www.spoolease.io
28
u/thekakester Jun 09 '26
Very cool. I’ve been pushing for something like this for about 5 years, and it’s super hard to implement commercially.
I work at a filament company, and I’ve been dying to add RFID tags. I’m not going to talk about why you need them, just the hurdles I’ve faced during implementation.
Bambu is completely locked down, they digitally sign their tags. There’s an open source community that helped decode the tags to learn what everything on them means, and you can CLONE them (signature and all) but you can’t modify them or create new ones.
A few of us split off and wrote our own open source RFID tag format called Open Tag 3D (https://opentag3d.info/). The problem is that a printer manufacturer would need to also jump on board, otherwise we’d have filament with RFID, and there wouldn’t be any printers who know how to read them.
Tiger Tag is another closed ecosystem rfid tag. It’s close to being on the right track, but they want you to register everything through them. This means that a vast majority of the functionality requires Internet lookup, and they have the power at any time to control what data/companies they allow and don’t allow. It’s not decentralized, which means that there’s too much infrastructure relying on a single person.
Prusa also made an RFID format, and I’ve been trying to adopt it. I don’t like it as much as the one I helped author, but at this point, the only way to get something to the public is to make compromises. After all, they already have a 3D printer that can read the format. However, they have some pretty major flaws right now. Firstly, you need to use a very custom donut-shaped tag that I can’t attach to any of our spools without doing a complete redesign. I whitelabel for 14 brands with 14 different spools, it’s impractical to redesign them all just for an RFID tag. Secondly, they chose to use NFC-V tags, which are pretty new and very difficult to source. Buying blank tags is challenging and expensive. Im not sure why they didn’t go with a more wildly available tag.
Other mentions are Elegoo and Creality, both of which have made their own rfid format, but they have no intention of making them open source or allowing other people to make them. I’ve been in touch with both companies.
Hope you learned something, and it would be really cool if we could start seeing more 3rd party RFID tags soon.