I did another test:
I manually set the printer state to idle, and in that case the print-end branch works correctly — the value is sent to Spoolman and the updater receives it.
So the print-end part of the automation is fine.
Attached is the trace from that manual idle trigger.
The only remaining issue is that tray-change events never send anything to Spoolman.
The tray-change trigger fires, the helper updates, and the log entry appears — but the rest_command.update_spool action does not run during a tray change.
Let me know if you want me to capture a full tray-change trace as well.
{
"trace": {
"last_step": "action/0/choose/1/sequence/3",
"run_id": "588b03cd9ebbcc424494b42b0a193b65",
"state": "stopped",
"script_execution": "finished",
"timestamp": {
"start": "2025-12-02T13:12:45.617293+00:00",
"finish": "2025-12-02T13:12:45.666962+00:00"
},
"domain": "automation",
"item_id": "1764422987345",
"trigger": "state of sensor.p2s_22e8bj582800104_aktueller_arbeitsschritt",
"trace": {
"trigger/1": [
{
"path": "trigger/1",
"timestamp": "2025-12-02T13:12:45.617340+00:00",
"changed_variables": {
"this": {
"entity_id": "automation.bambulab_update_spool_with_last_tray_helper_debug",
"state": "on",
"attributes": {
"id": "1764422987345",
"last_triggered": "2025-12-02T10:28:45.110221+00:00",
"mode": "single",
"current": 0,
"friendly_name": "Bambulab - Update Spool (with last_tray helper + debug )"
},
"last_changed": "2025-12-02T10:16:23.834627+00:00",
"last_reported": "2025-12-02T10:28:45.111395+00:00",
"last_updated": "2025-12-02T10:28:45.111395+00:00",
"context": {
"id": "01KBF9Q0XPJ2T5KCZD2QVET5JJ",
"parent_id": "01KBF9Q0XNY8GEE3KEJRWSY6BR",
"user_id": null
}
},
"trigger": {
"id": "print_end",
"idx": "1",
"alias": null,
"platform": "state",
"entity_id": "sensor.p2s_22e8bj582800104_aktueller_arbeitsschritt",
"from_state": {
"entity_id": "sensor.p2s_22e8bj582800104_aktueller_arbeitsschritt",
"state": "printing",
"attributes": {
"options": [
"paused_first_layer_error",
"paused_ams_lost",
"idle",
"check_birdeye_camera_position",
"paused_skipped_step",
"paused_front_cover_falling",
"paused_user",
"calibrating_motor_noise",
"bed_level_phase_2",
"paused_chamber_temperature_control_error",
"check_plaform",
"check_absolute_accuracy_after_calibration",
"heating_hotend",
"check_door_and_cover",
"heating_chamber",
"filament_loading",
"cleaning_nozzle_tip",
"paused_nozzle_clog",
"bed_level_phase_1",
"check_absolute_accuracy_before_calibration",
"bed_level_high_temperature",
"cooling_chamber",
"unknown",
"checking_extruder_temperature",
"paused_filament_runout",
"scanning_bed_surface",
"filament_unloading",
"calibrating_extrusion_flow",
"laser_calibration",
"absolute_accuracy_calibration",
"calibrate_birdeye_camera",
"calibrating_micro_lidar",
"printing",
"paused_low_fan_speed_heat_break",
"paused_user_gcode",
"check_quick_release",
"paused_nozzle_filament_covered_detected",
"homing_toolhead",
"paused_nozzle_temperature_malfunction",
"paused_cutter_error",
"m400_pause",
"inspecting_first_layer",
"calibrate_nozzle_offset",
"calibrating_extrusion",
"paused_heat_bed_temperature_malfunction",
"heatbed_preheating",
"auto_bed_leveling",
"changing_filament",
"motor_noise_showoff",
"identifying_build_plate_type",
"heated_bedcooling",
"print_calibration_lines",
"sweeping_xy_mech_mode",
"offline"
],
"device_class": "enum",
"friendly_name": "P2S_22E8BJ582800104 Aktueller Arbeitsschritt"
},
"last_changed": "2025-12-02T10:16:27.145456+00:00",
"last_reported": "2025-12-02T10:16:36.223880+00:00",
"last_updated": "2025-12-02T10:16:27.145456+00:00",
"context": {
"id": "01KBF90G8992D2FTCK1DKRG9F3",
"parent_id": null,
"user_id": null
}
},
"to_state": {
"entity_id": "sensor.p2s_22e8bj582800104_aktueller_arbeitsschritt",
"state": "idle",
"attributes": {
"options": [
"paused_first_layer_error",
"paused_ams_lost",
"idle",
"check_birdeye_camera_position",
"paused_skipped_step",
"paused_front_cover_falling",
"paused_user",
"calibrating_motor_noise",
"bed_level_phase_2",
"paused_chamber_temperature_control_error",
"check_plaform",
"check_absolute_accuracy_after_calibration",
"heating_hotend",
"check_door_and_cover",
"heating_chamber",
"filament_loading",
"cleaning_nozzle_tip",
"paused_nozzle_clog",
"bed_level_phase_1",
"check_absolute_accuracy_before_calibration",
"bed_level_high_temperature",
"cooling_chamber",
"unknown",
"checking_extruder_temperature",
"paused_filament_runout",
"scanning_bed_surface",
"filament_unloading",
"calibrating_extrusion_flow",
"laser_calibration",
"absolute_accuracy_calibration",
"calibrate_birdeye_camera",
"calibrating_micro_lidar",
"printing",
"paused_low_fan_speed_heat_break",
"paused_user_gcode",
"check_quick_release",
"paused_nozzle_filament_covered_detected",
"homing_toolhead",
"paused_nozzle_temperature_malfunction",
"paused_cutter_error",
"m400_pause",
"inspecting_first_layer",
"calibrate_nozzle_offset",
"calibrating_extrusion",
"paused_heat_bed_temperature_malfunction",
"heatbed_preheating",
"auto_bed_leveling",
"changing_filament",
"motor_noise_showoff",
"identifying_build_plate_type",
"heated_bedcooling",
"print_calibration_lines",
"sweeping_xy_mech_mode",
"offline"
],
"device_class": "enum",
"friendly_name": "P2S_22E8BJ582800104 Aktueller Arbeitsschritt"
},
"last_changed": "2025-12-02T13:12:45.616913+00:00",
"last_reported": "2025-12-02T13:12:45.616913+00:00",
"last_updated": "2025-12-02T13:12:45.616913+00:00",
"context": {
"id": "01KBFK3ASGXJ4WK6TGFPA5M8NJ",
"parent_id": null,
"user_id": "9da944317a6a41a9b3f4e58707b1998a"
}
},
"for": null,
"attribute": null,
"description": "state of sensor.p2s_22e8bj582800104_aktueller_arbeitsschritt"
}
}
}
],
"action/0": [
{
"path": "action/0",
"timestamp": "2025-12-02T13:12:45.617505+00:00",
"changed_variables": {
"context": {
"id": "01KBFK3ASHZ6KEH6GBTK4H3DJQ",
"parent_id": "01KBFK3ASGXJ4WK6TGFPA5M8NJ",
"user_id": null
},
"tray_number": 1,
"tray_sensor": "sensor.p2s_22e8bj582800104_ams_1_slot_1",
"tray_weight": 198.43,
"tag_uid": "1AAD1A7600000100",
"material": "ABS",
"name": "Bambu ABS",
"color": "```