[GH-ISSUE #903] [Bug Report] When multiple smart plugs are added via HA, the automation only works with the f #623

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

Originally created by @maziggy on GitHub (Apr 6, 2026).
Original GitHub issue: https://github.com/maziggy/bambuddy/issues/903

Originally assigned to: @maziggy on GitHub.

When multiple smart plugs are added via HA, the automation only works with the first one that was added.

I have added two TUYA smart plugs through HA. If I configure them in the smart plugs section, only the automation for the first one that was added works.

In this case, I have one plug connected to the A1 and another connected to a particle filter. It’s set up so that the filter turns on when printing starts and turns off with a 5-minute delay after it finishes, and the printer plug turns on when the hotend reaches 70°C.

I’ve run several tests, and only the automation for the first plug that was added works. Also, in the main Printers menu, only the first one that was added appears.

In summary, the first one I added is the Filter. This way, the filter turns on and off when the print starts, but the printer does not. If I add the A1 plug first, the printer turns off, but the filter does not. I’m not sure if this is a bug or if it’s intended behavior.

Thank you very much.

Screenshot

Bug Report Screenshot

System Information
{
  "generated_at": "2026-04-06T15:29:26.253977",
  "app": {
    "version": "0.2.3b1",
    "debug_mode": false
  },
  "system": {
    "platform": "Linux",
    "platform_release": "6.8.0-90-generic",
    "platform_version": "#91-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 18 14:14:30 UTC 2025",
    "architecture": "x86_64",
    "python_version": "3.13.12"
  },
  "environment": {
    "docker": true,
    "data_dir": "/app/data",
    "log_dir": "/app/logs",
    "timezone": ""
  },
  "database": {
    "archives_total": 149,
    "archives_completed": 136,
    "printers_total": 1,
    "filaments_total": 0,
    "projects_total": 0,
    "smart_plugs_total": 2
  },
  "printers": [
    {
      "index": 1,
      "model": "A1",
      "nozzle_count": 1,
      "is_active": true,
      "mqtt_connected": true,
      "state": "FAILED",
      "firmware_version": "01.07.02.00",
      "wifi_signal": -43,
      "reachable": true,
      "ams_unit_count": 1,
      "ams_tray_count": 3,
      "has_vt_tray": true,
      "external_camera_configured": false,
      "plate_detection_enabled": false,
      "hms_error_count": 2,
      "developer_mode": true,
      "nozzle_rack_count": 0
    }
  ],
  "settings": {
    "auth_enabled": "true",
    "setup_completed": "true",
    "auto_archive": "true",
    "save_thumbnails": "true",
    "capture_finish_photo": "true",
    "default_filament_cost": "15.0",
    "currency": "EUR",
    "energy_cost_per_kwh": "0.143",
    "energy_tracking_mode": "total",
    "check_updates": "true",
    "check_printer_firmware": "true",
    "include_beta_updates": "true",
    "notification_language": "en",
    "bed_cooled_threshold": "20.0",
    "ams_humidity_good": "40",
    "ams_humidity_fair": "60",
    "ams_temp_good": "28.0",
    "ams_temp_fair": "35.0",
    "ams_history_retention_days": "30",
    "per_printer_mapping_expanded": "false",
    "date_format": "eu",
    "time_format": "24h",
    "default_printer_id": "1",
    "ftp_retry_enabled": "true",
    "ftp_retry_count": "10",
    "ftp_retry_delay": "10",
    "ftp_timeout": "300",
    "mqtt_enabled": "false",
    "mqtt_broker": "",
    "mqtt_port": "1883",
    "mqtt_topic_prefix": "bambuddy",
    "mqtt_use_tls": "false",
    "ha_enabled": "true",
    "library_archive_mode": "always",
    "library_disk_warning_gb": "5.0",
    "camera_view_mode": "embedded",
    "preferred_slicer": "orcaslicer",
    "prometheus_enabled": "false",
    "dark_background": "oled",
    "dark_accent": "green",
    "dark_style": "glow",
    "debug_logging_enabled": "false",
    "debug_logging_enabled_at": "",
    "queue_drying_enabled": "false",
    "queue_drying_block": "false",
    "ambient_drying_enabled": "false",
    "drying_presets": "",
    "advanced_auth_enabled": "false",
    "smtp_auth_enabled": "true",
    "spoolman_enabled": "false",
    "spoolman_sync_mode": "auto",
    "spoolman_disable_weight_sync": "false",
    "spoolman_report_partial_usage": "true",
    "disable_filament_warnings": "false",
    "user_notifications_enabled": "true",
    "prefer_lowest_filament": "false",
    "default_bed_levelling": "true",
    "default_flow_cali": "false",
    "default_vibration_cali": "true",
    "default_layer_inspect": "false",
    "default_timelapse": "false",
    "stagger_group_size": "2",
    "stagger_interval_minutes": "5",
    "require_plate_clear": "true"
  },
  "docker": {
    "container_memory_limit_bytes": null,
    "container_memory_limit_formatted": null,
    "network_mode_hint": "host"
  },
  "virtual_printers": [
    {
      "index": 1,
      "enabled": true,
      "mode": "proxy",
      "model": "N2S",
      "model_name": "A1",
      "has_target_printer": true,
      "has_bind_ip": true,
      "running": true,
      "pending_files": 0
    }
  ],
  "integrations": {
    "notification_providers": [
      {
        "type": "telegram",
        "enabled": true,
        "has_last_error": false
      }
    ],
    "spoolman": {
      "enabled": false,
      "reachable": false
    },
    "mqtt_relay": {
      "enabled": false,
      "connected": false,
      "broker": "",
      "port": 0,
      "topic_prefix": "bambuddy"
    },
    "homeassistant": {
      "enabled": true
    }
  },
  "database_health": {
    "backend": "sqlite",
    "journal_mode": "wal",
    "quick_check": "ok",
    "db_size_bytes": 2220032,
    "wal_size_bytes": 4120032
  },
  "dependencies": {
    "fastapi": "0.135.3",
    "uvicorn": "0.43.0",
    "pydantic": "2.12.5",
    "sqlalchemy": "2.0.49",
    "paho-mqtt": "2.1.0",
    "psutil": "7.2.2",
    "httpx": "0.28.1",
    "aiofiles": "25.1.0",
    "cryptography": "46.0.6",
    "opencv-python-headless": "4.13.0.92",
    "numpy": "2.4.4"
  },
  "log_file": {
    "size_bytes": 361166,
    "size_formatted": "352.7 KB"
  },
  "network": {
    "interface_count": 2,
    "interfaces": [
      {
        "name": "enp2s0",
        "subnet": "x.x.1.0/24"
      },
      {
        "name": "macvlan-shim",
        "subnet": "x.x.1.0/24"
      }
    ]
  },
  "websockets": {
    "active_connections": 2
  }
}

Logs (sanitized): bambuddy.log


Submitted via BamBuddy Bug Report

Originally created by @maziggy on GitHub (Apr 6, 2026). Original GitHub issue: https://github.com/maziggy/bambuddy/issues/903 Originally assigned to: @maziggy on GitHub. When multiple smart plugs are added via HA, the automation only works with the first one that was added. I have added two TUYA smart plugs through HA. If I configure them in the smart plugs section, only the automation for the first one that was added works. In this case, I have one plug connected to the A1 and another connected to a particle filter. It’s set up so that the filter turns on when printing starts and turns off with a 5-minute delay after it finishes, and the printer plug turns on when the hotend reaches 70°C. I’ve run several tests, and only the automation for the first plug that was added works. Also, in the main Printers menu, only the first one that was added appears. In summary, the first one I added is the Filter. This way, the filter turns on and off when the print starts, but the printer does not. If I add the A1 plug first, the printer turns off, but the filter does not. I’m not sure if this is a bug or if it’s intended behavior. Thank you very much. ### Screenshot ![Bug Report Screenshot](https://raw.githubusercontent.com/maziggy/bambuddy/bug-report-assets/screenshots/d8290562b4b34e8e8ca6c5a71177ffc6.png) <details> <summary>System Information</summary> ```json { "generated_at": "2026-04-06T15:29:26.253977", "app": { "version": "0.2.3b1", "debug_mode": false }, "system": { "platform": "Linux", "platform_release": "6.8.0-90-generic", "platform_version": "#91-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 18 14:14:30 UTC 2025", "architecture": "x86_64", "python_version": "3.13.12" }, "environment": { "docker": true, "data_dir": "/app/data", "log_dir": "/app/logs", "timezone": "" }, "database": { "archives_total": 149, "archives_completed": 136, "printers_total": 1, "filaments_total": 0, "projects_total": 0, "smart_plugs_total": 2 }, "printers": [ { "index": 1, "model": "A1", "nozzle_count": 1, "is_active": true, "mqtt_connected": true, "state": "FAILED", "firmware_version": "01.07.02.00", "wifi_signal": -43, "reachable": true, "ams_unit_count": 1, "ams_tray_count": 3, "has_vt_tray": true, "external_camera_configured": false, "plate_detection_enabled": false, "hms_error_count": 2, "developer_mode": true, "nozzle_rack_count": 0 } ], "settings": { "auth_enabled": "true", "setup_completed": "true", "auto_archive": "true", "save_thumbnails": "true", "capture_finish_photo": "true", "default_filament_cost": "15.0", "currency": "EUR", "energy_cost_per_kwh": "0.143", "energy_tracking_mode": "total", "check_updates": "true", "check_printer_firmware": "true", "include_beta_updates": "true", "notification_language": "en", "bed_cooled_threshold": "20.0", "ams_humidity_good": "40", "ams_humidity_fair": "60", "ams_temp_good": "28.0", "ams_temp_fair": "35.0", "ams_history_retention_days": "30", "per_printer_mapping_expanded": "false", "date_format": "eu", "time_format": "24h", "default_printer_id": "1", "ftp_retry_enabled": "true", "ftp_retry_count": "10", "ftp_retry_delay": "10", "ftp_timeout": "300", "mqtt_enabled": "false", "mqtt_broker": "", "mqtt_port": "1883", "mqtt_topic_prefix": "bambuddy", "mqtt_use_tls": "false", "ha_enabled": "true", "library_archive_mode": "always", "library_disk_warning_gb": "5.0", "camera_view_mode": "embedded", "preferred_slicer": "orcaslicer", "prometheus_enabled": "false", "dark_background": "oled", "dark_accent": "green", "dark_style": "glow", "debug_logging_enabled": "false", "debug_logging_enabled_at": "", "queue_drying_enabled": "false", "queue_drying_block": "false", "ambient_drying_enabled": "false", "drying_presets": "", "advanced_auth_enabled": "false", "smtp_auth_enabled": "true", "spoolman_enabled": "false", "spoolman_sync_mode": "auto", "spoolman_disable_weight_sync": "false", "spoolman_report_partial_usage": "true", "disable_filament_warnings": "false", "user_notifications_enabled": "true", "prefer_lowest_filament": "false", "default_bed_levelling": "true", "default_flow_cali": "false", "default_vibration_cali": "true", "default_layer_inspect": "false", "default_timelapse": "false", "stagger_group_size": "2", "stagger_interval_minutes": "5", "require_plate_clear": "true" }, "docker": { "container_memory_limit_bytes": null, "container_memory_limit_formatted": null, "network_mode_hint": "host" }, "virtual_printers": [ { "index": 1, "enabled": true, "mode": "proxy", "model": "N2S", "model_name": "A1", "has_target_printer": true, "has_bind_ip": true, "running": true, "pending_files": 0 } ], "integrations": { "notification_providers": [ { "type": "telegram", "enabled": true, "has_last_error": false } ], "spoolman": { "enabled": false, "reachable": false }, "mqtt_relay": { "enabled": false, "connected": false, "broker": "", "port": 0, "topic_prefix": "bambuddy" }, "homeassistant": { "enabled": true } }, "database_health": { "backend": "sqlite", "journal_mode": "wal", "quick_check": "ok", "db_size_bytes": 2220032, "wal_size_bytes": 4120032 }, "dependencies": { "fastapi": "0.135.3", "uvicorn": "0.43.0", "pydantic": "2.12.5", "sqlalchemy": "2.0.49", "paho-mqtt": "2.1.0", "psutil": "7.2.2", "httpx": "0.28.1", "aiofiles": "25.1.0", "cryptography": "46.0.6", "opencv-python-headless": "4.13.0.92", "numpy": "2.4.4" }, "log_file": { "size_bytes": 361166, "size_formatted": "352.7 KB" }, "network": { "interface_count": 2, "interfaces": [ { "name": "enp2s0", "subnet": "x.x.1.0/24" }, { "name": "macvlan-shim", "subnet": "x.x.1.0/24" } ] }, "websockets": { "active_connections": 2 } } ``` </details> **Logs (sanitized):** [bambuddy.log](https://raw.githubusercontent.com/maziggy/bambuddy/bug-report-assets/logs/e102c6662e9b4749b050e84dbb430b78.log) --- *Submitted via BamBuddy Bug Report*
BreizhHardware 2026-05-06 12:31:26 +02:00
Author
Owner

@mstko commented on GitHub (Apr 6, 2026):

bambuddy-support-20260406-160420.zip

I’m attaching the full log from the start of the print. For debugging, I have set the timing for both to 1 minute.

<!-- gh-comment-id:4193377274 --> @mstko commented on GitHub (Apr 6, 2026): [bambuddy-support-20260406-160420.zip](https://github.com/user-attachments/files/26512921/bambuddy-support-20260406-160420.zip) I’m attaching the full log from the start of the print. For debugging, I have set the timing for both to 1 minute.
Author
Owner

@maziggy commented on GitHub (Apr 7, 2026):

Available/Fixed in branch dev and available with the next release or daily build. Please let me know if ti works for you now.

<!-- gh-comment-id:4197357079 --> @maziggy commented on GitHub (Apr 7, 2026): Available/Fixed in branch dev and available with the next release or daily build. Please let me know if ti works for you now.
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#623
No description provided.