Working Home Assistant Custom RFID Spool Setting (AMS Support) #1177
MrKuenning
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Guide to Set Up RFID Tag Scanning and Bambu Lab A1 Filament Settings in Home Assistant
Recently, the Bambu Labs Home Assistant integration introduced the ability to push spool information, such as filament type and color, to the A1 printer. I wanted to take this a step further by automating the process using RFID tags, with full support for AMS (Automatic Material System).
The concept is simple: place RFID tags on each AMS tray, and by swiping your phone over a tag, you can select the tray. Then, by scanning an RFID sticker on the spool you’re using, the configuration is automatically pushed to the printer. The whole thing only costs a few dollars worth of RFID stickers.
The automation works by storing the data for each spool as a template sensor. When an RFID tag is scanned, it matches the unique tag ID and looks up the associated data. While I initially hoped to use a library or lookup table instead of unique sensors, I couldn’t find a way for Home Assistant to support that approach.
This guide will walk you through the steps to set up RFID tag scanning for managing Bambu Lab A1 spool and tray locations, using Home Assistant automations and sensors.
Step 1: Create Sensors in templates.yaml
Define the tray and spool sensors in your
templates.yamlfile. These sensors will represent the RFID tags scanned for each tray and spool. You will need to define one of these per spool locations. For my A1 that was 5, each AMS and the external spool.The
namecan be anything you want.The
stateis the RFID tag IDattribute
entity_idmust match the entity name of your tray in the Bambu Integrationattribute
nameis what ever you wantFor the spools themselves, you will need to define a sensor per spool.
The
namecan be anything you want.The
stateis the RFID tag IDThe action that Home assistant uses to write to a tray looks like this.
So these are the variables we are storing in the sensor.
I recomend looking at your tray attributes on your Bambu Integration.
action: bambu_lab.set_filament
target:
entity_id: sensor.bambu_a1_ams_tray_2
data:
tray_info_idx: P0e61dbf
tray_color: FF0000FF
tray_type: PLA
nozzle_temp_min: 220
nozzle_temp_max: 220
attribute
tray_info_idxyou will need to get this value from the tray attributes on your Bambu Integration.attribute
common_nameEasy to read version of aboveattribute
tray_colorHex Colorattribute
common_colorEasy to read version of aboveattribute
tray_typemust match the filament type in the Bambu IntegrationStep 2: Create Groups in groups.yaml
The sensors we made above need to be added to groups. We use these groups as a verification that the Automations match and should run.
Step 3: Create an Input Select Helper
In the UI Helper section, create an input select helper to store the available tray and spool entities. This will allow your automation to select the appropriate tray/spool based on the RFID tag.
The sensors must match the current name of your trays in your Bambu Integration.
Step 4: Create Automation 1 – RFID - Select Bambu Lab A1 Spool Location
This automation will trigger when a tag is scanned, check if the tag is in the
tray_info_group, and update the selected tray or spool in theinput_select.bambu_a1_set_spoolhelper.Automation Configuration
Add the following automation:
NOTE: I have a telegram message that tells me what spool is selcted via notification. You can use your own notification type, or remove it.Step 5: **Create Automation 2 – RFID - Set Bambu Lab A1 Filament **
This automation will trigger when a tag is scanned, check if the tag is in the
spool_data_group, and then set the filament parameters for the selected spool. It will also send a notification with the filament settings.Automation Configuration
Add the following automation:
NOTE: I have a telegram message that tells me what spool is selcted via notification. You can use your own notification type, or remove it.Step 6: Add New Spools
Going forward you just need to add a new spool sensor with your new Tag IDs and add it to the
spool_data_group.Step 7: Test and Debug Your Setup
After completing the configuration in Step 5, it's important to test and debug your automation to ensure everything is working as expected. Follow these steps to test and troubleshoot your system:
1. Trigger the Automation
2. Check the Telegram Notifications
telegram_bot.send_messageaction is correctly configured with the correct target (your chat ID).3. Verify Input Select is Updated
input_select.bambu_a1_set_spoolentity is updated to reflect the selected spool or tray based on the scanned tag.input_select.4. Debugging Automation
If the automation isn't working as expected, enable Debug Mode in Home Assistant to view logs and understand what might be going wrong.
Go to Configuration > Logs in Home Assistant and review any errors related to the automation.
You can also add
debugactions to the automation to send logs to Telegram for real-time troubleshooting. For example:5. Check the Sensor States
sensor.tag_a1_ams_tray_1,sensor.tag_a1_ams_tray_2, etc., and ensure they match the tag IDs you are scanning.6. Verify Group Entities
group.tray_info_groupandgroup.spool_data_group) are populated with the correct sensors and entities.7. Adjust if Necessary
Once the automation is tested and debugged, your setup should be fully functional. You’ll now have an efficient system for scanning RFID tags and automatically setting filament parameters and tray locations.
All reactions