Bambu lab sensor attribute

I got last week x1c in, saw very nice intergration whit it.
But missing one thing whit it. like to record the print material and volume being used over time
know that I can create a extra sensor whit {{ state_attr(‘sensor.bambu_x1c_ams_tray_1’, ‘type’) }}
this gives me a sensor whit the current filemant is used in that slot.
whit automation can create simple automation, that if print length and/or print weight has been changed. automation will then run and check what filament is being used and add that value to sensor. to track how much of each filament is being used

This is atleast my first idea. but unknown if it can done easier. that we can create a helper that do all the things in one line.
checking what filament is used and report the value in it.
then it will be nice to specify the color as sensor also to each filament.

Meaning we can track for example how much filament is being used.
then create automation that if we hit 1kg or 300m, we get a message on time that we will run out of filament.
This will avoid that we run out of a filament at the start of the print and not to late. Meaning we can stop print if we do not make it, or print and know we need to swap filament during process.

Last part I do not see alot of problems whit it.
But whit the first to setup the correct sensor will be nice if someone can assist.

1 Like

I am thinking about the same automations and how to tackle it.

I did not yet start creating them, but here is the logic I want to apply.
As soon as I have some automations, I will share them.

In any case, you will need an entity for each spool:

  • or you manually create entities (eg. helpers)
  • or you install Spoolman and integrate it in HA. Spoolman is a free database for all your spools. When integrated in HA, each spool has an entity. If you add a spool to the database, a new entity will be created in HA.
    One of the attributes in the spoolman entities are “remaining weight” and “remaining length”. You can also add custom fields to Spoolman and they will become attributes in HA. I did not try this yet. I think that an additional custom field will be required to store the spool serial number (see attribute “tag uid” in your sensor.x1c_active_tray).

Spoolman itself

The integration of Spoolman into HA

Next, you can write an automation that reads the “tag uid” of the current spool in use in the AMS and look up the related entity from Spoolman. Then, at the end of the printing process, substract printing length and/or weight.

Thanks was not aware of that intergration.

Was busy to think about solution as automation.
Start automation if Bambu X1C Current stage goes to printing stage.
Then created choise. On each of it start whit if, this to check current used filament.

Only needed to create extra sensor where the current weight and length that will be used be putted on for each filament type that you use.
But not able to continue whit this to create the sensor.

Mayby spoolman will do the trick to.

edit:
Checked it and is mainly can only be used if the printer support klipper or octoprint. but bambu is using none of does. means it will not do the trick i believe

My idea was to update the “remaining weight” attribute of the entities linked to spoolman, but unfortunately HA is not able to overwrite the value of entities and their attributes. So, this will not bring the solution.
A possible solution is to create separate helpers for every spool, but I am not in favour of doing so.
I submitted a feature request to the Spoolman integration asking if it’s possible to update data in Spoolman via a (new) service.