[GH-ISSUE #707] [Bug]: AMS-HT slots incorrectly reported as "External Spool" in Spoolman location #471

Closed
opened 2026-05-06 12:29:54 +02:00 by BreizhHardware · 2 comments

Originally created by @motioneso on GitHub (Mar 14, 2026).
Original GitHub issue: https://github.com/maziggy/bambuddy/issues/707

Originally assigned to: @shrunbr on GitHub.

Bug Description

When a printer has an AMS-HT unit, Bambuddy incorrectly sets the Spoolman spool location to "[Printer] - External Spool" instead of "[Printer] - AMS HT-A1" (or similar). This also causes Spoolman to either auto-create a new, but incorrect,"External Spool" location entry or place it into the existing External Spool location.

I believe the root cause is in how the AMS IDs are handled for IDs over 128 in the Spoolman services file, specifically at the "convert_ams_slot_to_location()" method.

Expected Behavior

If syncing to Spoolman, the filament should be correctly placed in the AMS Location (for me, P2S - AMS-HT A1) and not in a P2S - External Spool

Steps to Reproduce

  1. Have a printer with an AMS-HT unit (e.g. P2S with AMS-HT)
  2. Load a spool into the AMS-HT
  3. Let Bambuddy sync to Spoolman
  4. Observe the spool's location is set to "[Printer] - External Spool" instead of "[Printer] - AMS HT-A1"

Printer Model

P2S

Bambuddy Version

v0.2.2b4

Printer Firmware Version

01.01.03.00

Installation Method

Docker

Operating System

Linux (Ubuntu/Debian)

Relevant Logs / Support Package

No response

Screenshots

No response

Additional Context

I had Claude take a look for fun, here is what it suggested that fixed the issue:
def convert_ams_slot_to_location(self, ams_id: int, tray_id: int) -> str:
if ams_id >= 254:
# True external spool slot (254 = Ext-L, 255 = Ext-R)
return "External Spool"

if ams_id >= 128:
    # AMS-HT units use IDs 128-135 (HT-A, HT-B, etc.)
    ht_letter = chr(ord("A") + (ams_id - 128))
    return f"AMS HT-{ht_letter}{tray_id + 1}"

ams_letter = chr(ord("A") + ams_id)
return f"AMS {ams_letter}{tray_id + 1}"

Checklist

  • I have searched existing issues to ensure this bug hasn't already been reported
  • I am using the latest version of Bambuddy
  • My printer is set to LAN Only mode
  • My printer has Developer Mode enabled
Originally created by @motioneso on GitHub (Mar 14, 2026). Original GitHub issue: https://github.com/maziggy/bambuddy/issues/707 Originally assigned to: @shrunbr on GitHub. ### Bug Description When a printer has an AMS-HT unit, Bambuddy incorrectly sets the Spoolman spool location to "[Printer] - External Spool" instead of "[Printer] - AMS HT-A1" (or similar). This also causes Spoolman to either auto-create a new, but incorrect,"External Spool" location entry or place it into the existing External Spool location. I believe the root cause is in how the AMS IDs are handled for IDs over 128 in the Spoolman services file, specifically at the "convert_ams_slot_to_location()" method. ### Expected Behavior If syncing to Spoolman, the filament should be correctly placed in the AMS Location (for me, P2S - AMS-HT A1) and not in a P2S - External Spool ### Steps to Reproduce 1) Have a printer with an AMS-HT unit (e.g. P2S with AMS-HT) 2) Load a spool into the AMS-HT 3) Let Bambuddy sync to Spoolman 4) Observe the spool's location is set to "[Printer] - External Spool" instead of "[Printer] - AMS HT-A1" ### Printer Model P2S ### Bambuddy Version v0.2.2b4 ### Printer Firmware Version 01.01.03.00 ### Installation Method Docker ### Operating System Linux (Ubuntu/Debian) ### Relevant Logs / Support Package _No response_ ### Screenshots _No response_ ### Additional Context I had Claude take a look for fun, here is what it suggested that fixed the issue: def convert_ams_slot_to_location(self, ams_id: int, tray_id: int) -> str: if ams_id >= 254: # True external spool slot (254 = Ext-L, 255 = Ext-R) return "External Spool" if ams_id >= 128: # AMS-HT units use IDs 128-135 (HT-A, HT-B, etc.) ht_letter = chr(ord("A") + (ams_id - 128)) return f"AMS HT-{ht_letter}{tray_id + 1}" ams_letter = chr(ord("A") + ams_id) return f"AMS {ams_letter}{tray_id + 1}" ### Checklist - [x] I have searched existing issues to ensure this bug hasn't already been reported - [x] I am using the latest version of Bambuddy - [x] My printer is set to LAN Only mode - [x] My printer has Developer Mode enabled
BreizhHardware 2026-05-06 12:29:55 +02:00
Author
Owner

@shrunbr commented on GitHub (Mar 15, 2026):

This can be assigned to me, working on the fix.

@motioneso - Thank you for the report. I've been doing a lot of work on the Spoolman integration recently, I don't have an AMS-HT unit so this is good to know. I did find some information to confirm the ID number usage so I'm working to get this implemented.

<!-- gh-comment-id:4061990766 --> @shrunbr commented on GitHub (Mar 15, 2026): This can be assigned to me, working on the fix. @motioneso - Thank you for the report. I've been doing a lot of work on the Spoolman integration recently, I don't have an AMS-HT unit so this is good to know. I did find some information to confirm the ID number usage so I'm working to get this implemented.
Author
Owner

@maziggy commented on GitHub (Mar 15, 2026):

https://github.com/maziggy/bambuddy/pull/711

Fixed in branch dev.

<!-- gh-comment-id:4062556515 --> @maziggy commented on GitHub (Mar 15, 2026): https://github.com/maziggy/bambuddy/pull/711 Fixed in branch dev.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/bambuddy#471
No description provided.