Open spuder opened 3 weeks ago
You sir are a gentleman and a scholar. How are you dumping the mqtt messages like this btw? His script looked home assistant based.
To get the mqtt messages use mqttx
mqttx sub -t 'device/$SERIAL_NUMBER/report' -u -P $LAN_ACCESS_CODE --mqtt-version 3.1.1 -h $IP_ADDRESS -p 8883 -l mqtts --insecure
The mqtt api is documented here:
https://github.com/Doridian/OpenBambuAPI/blob/main/mqtt.md
The 2 main endpoints are /report
and /request
For example to change the filament color you would do a request with a json payload like this
{
"print": {
"sequence_id": "0",
"command": "ams_filament_setting",
"ams_id": 0,
"tray_id": 0,
"tray_info_idx": "GFG99",
"tray_color": "F72323FF",
"nozzle_temp_min": 220,
"nozzle_temp_max": 270,
"tray_type": "PETG",
"setting_id": ""
}
}
you can query the Bambulab API and you will get a full filament list, also with your custom profiles. each filament has a uniq ID, also the custom profiles. You can have a look here, how you can read the filament list over the API: https://github.com/capull0/BambuAMSCtrl I coded this flask application, which will make the Bambulab RFID tags obsolete. Is working flawless since weeks.
Dumping the mqtt messages I've identified an internal code that is used for filaments
WolfWithSword has documented most of these internal filament codes
https://github.com/WolfwithSword/ha-bambulab/blob/78cc6bda14ef0f82e74b59afc745cc5534c01a5e/custom_components/bambu_lab/pybambu/const.py#L40-L62