no sorry it did not work as you think. you have to set it only when it is not recognized. and in any case only one time in spool life.
in any case this was a suggestion, obviously you are free to think and to deploy your app as you want
Ok
But you can change the automation so it will work for you.
Now that it think of it, if you set the tag uid in spoolman correctly, and change the automation to use tag uid it should work for your bambulab spools.
wowwwww!! really?
Yeah, just play with it a bit. But the spoolman updater UI wont show which spool is where until you set it tho
At this Point Im starting to fell stupid ![]()
I copied the Restful Command but now i get this error. I changed /spools/spool to everything imaginable /spools or /spool
spools/spool
Error. Url: http://10.150.175.10:8088/spools/spool. Status code 404. Payload: b'{\n "name": "None",\n "material": "None",\n "tag_uid": "None",\n "used_weight": 0,\n "color": "None",\n "active_tray_id": "a1_03919d510504942_active_tray_unavailable"\n}'
This was a “dry-run” thats why the tray is unavailable. But i got the same error after a print
/spool
Error. Url: http://10.150.175.10:8088/spool. Status code 404. Payload: b'{\n "name": "None",\n "material": "None",\n "tag_uid": "None",\n "used_weight": 0,\n "color": "None",\n "active_tray_id": "a1_03919d510504942_active_tray_2"\n}'
/spools
Error. Url: http://10.150.175.10:8088/spools. Status code 500. Payload: b'{\n "name": "None",\n "material": "None",\n "tag_uid": "None",\n "used_weight": 0,\n "color": "None",\n "active_tray_id": "a1_03919d510504942_active_tray_1"\n}'
Try http://10.150.175.10:8088/swagger there you can test the endpoints
So yeah that made me figure out its /spools Even thought your command said /spools/spool
But how do i fix the 500 error?
In swagger it only says 200 is good but nothing else
At first, I had a strange issue where it created a new spool even though the correct one was selected.
I then updated to the latest version, and after that, nothing worked at all.
I noticed on GitHub that you had changed half of the code for HA ![]()
After making some adjustments, everything is working again now ![]()
I ran some tests afterwards, and the only thing that doesn’t work is:
if you cancel the print midway, the material used up to that point is not passed on to Spoolman.
A small feature request: I find the dropdown a bit inconvenient.
Could you instead display all created spools at once, like it’s done in OpenSpoolman?
Also, I think the Print History and NFC Tags in OpenSpoolman are awesome ![]()
Since OpenSpoolman doesn’t support multi-print, I’ll definitely keep using your tool ![]()
Just tested a multi-print, but unfortunately the quantity specifications are completely off.
OrcaSlicer predicted 10g, which was also displayed on the printer afterwards:
The spools before the print:
After the print:
That makes a difference of:
Scharlachrot: 12g
Gray: 13g
Dark Gray: 19g
@guyke can you help with this? The automation is working for me but maybe you can spot the issue faster since its your creation?
OpenSpoolman only supports Bambulab spools. So that sucks anyways ![]()
But the dropdown displays all the spools in 1 dropdown. But you can search in it as well
I just updated the BambuLab Integration and wanted to give you a headsup, that the active Tray Index entity is no longer provided. This is propably going to cause some Problems for the automation.
Yeah I saw
But there is another sensor in its place. Currently on Vacation so I cant take a look. I would recommend not upgrading
Thanks for your efforts, enjoy your vacation. we can survive with out updating ![]()
Hello I’m working with Spoolman in Home Assistant — I’ve got everything working but there’s no way to subtract the filament used from the total amount. I tried using the filament_used sensor from Moonraker, but it’s not ideal since it resets to 0 when the print completes or hits 100% status, so the value isn’t stored anywhere Does anyone have an idea?
I think you are in the wrong topic with your question buddy
I’ve build a solution to the Tray Index with a additional template sensor. This is the config i have tested and working right now:
Please note that i’ve added the code below to 1 file as a package.
Templates:
sensor:
- platform: template
sensors:
bambulab_filament_usage:
friendly_name: "Bambu Lab Filament Usage"
value_template: "{{ states('sensor.bambu_lab_p1s_gewicht_van_print') | float(0) / 100 * states('sensor.bambu_lab_p1s_printvoortgang') | float(0) }}"
availability_template: "{% if is_state('sensor.bambu_lab_p1s_gewicht_van_print', 'unknown') or is_state('sensor.bambu_lab_p1s_gewicht_van_print', 'unavailable') %} false {% else %} true {%- endif %}"
bambulab_ams1_tray_index:
friendly_name: "Bambu Lab AMS1 Tray Index"
value_template: >-
{% for tray in range(4) %}
{% set entity_id = 'sensor.bambu_lab_p1s_ams1_tray_' ~ tray %}
{% if state_attr(entity_id, 'active') == true %}
{{ tray }}
{% break %}
{% endif %}
{% endfor %}
availability_template: >-
{% for i in range(4) %}
{% set entity_id = 'sensor.bambu_lab_p1s_ams1_tray_' ~ i %}
{% if has_value(entity_id) and state_attr(entity_id, 'active') is not none %}
{{ true }}
{% break %}
{% endif %}
{% endfor %}
Rest Command:
rest_command:
bambulab_update_spool:
url: "http://<spoolman-updater>:8088/Spools"
method: POST
headers:
Content-Type: "application/json"
payload: >
{
"name": "{{ filament_name }}",
"material": "{{ filament_material }}",
"tag_uid": "{{ filament_tag_uid }}",
"used_weight": {{ filament_used_weight | int }},
"color": "{{ filament_color }}",
"active_tray_id": "{{ filament_active_tray_id }}"
}
Automations:
automation:
- alias: BAMBU LAB - Update Spool When Print Finishes or Tray Switches
id: 8caacd91-1328-4ecf-9120-bb5bc32e0475
triggers:
- trigger: state
entity_id: sensor.bambulab_ams1_tray_index
conditions:
- condition: template
value_template: "{{ trigger.from_state.state not in ['unknown', 'unavailable'] }}"
- condition: template
value_template: "{{ trigger.from_state.state | int > 0 }}"
actions:
- variables:
tray_number: "{{ trigger.from_state.state if trigger.entity_id == 'sensor.bambulab_ams1_tray_index' else states('sensor.bambulab_ams1_tray_index') }}"
tray_sensor: "sensor.bambu_lab_p1s_ams1_tray_{{ tray_number }}"
tray_weight: "{{ states('sensor.bambulab_filament_usage_meter') | float(0) | round(2) }}"
tag_uid: "{{ state_attr(tray_sensor, 'tag_uid') }}"
material: "{{ state_attr(tray_sensor, 'type') }}"
name: "{{ state_attr(tray_sensor, 'name') }}"
color: "{{ state_attr(tray_sensor, 'color') }}"
- action: rest_command.bambulab_update_spool
data:
filament_name: "{{ name }}"
filament_material: "{{ material }}"
filament_tag_uid: "{{ tag_uid }}"
filament_used_weight: "{{ tray_weight }}"
filament_color: "{{ color }}"
filament_active_tray_id: "{{ tray_sensor | replace('sensor.', '') }}"
- action: utility_meter.calibrate
data:
value: "0"
target:
entity_id: sensor.bambulab_filament_usage_meter
Utility Meter:
utility_meter:
bambulab_filament_usage_meter:
source: sensor.bambulab_filament_usage
cycle: weekly
does i work with a1 and ams lite?
cuz then im gonna try it ![]()
It should, cannot test that because i dont have an a1




