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

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

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

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.For debugging, I have set the timing for both to 1 minute.

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:39:26.401783",
  "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": 151,
    "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": "RUNNING",
      "firmware_version": "01.07.02.00",
      "wifi_signal": -40,
      "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": 0,
      "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": 736964,
    "size_formatted": "719.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/904 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.For debugging, I have set the timing for both to 1 minute. 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/848dd3e5482b4cbc901b9e2c4a579d51.png) <details> <summary>System Information</summary> ```json { "generated_at": "2026-04-06T15:39:26.401783", "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": 151, "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": "RUNNING", "firmware_version": "01.07.02.00", "wifi_signal": -40, "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": 0, "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": 736964, "size_formatted": "719.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/331331722dbe46359a7341805717e735.log) --- *Submitted via BamBuddy Bug Report*
BreizhHardware 2026-05-06 12:31:26 +02:00
  • closed this issue
  • added the
    duplicate
    label
Author
Owner

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

Hello
I do not understand "and the printer plug turns on when the hotend reaches 70°C.For debugging, "
and why you add the filter plug at all to bambuddy, if you fully automate this in HA?
A1 plug in Bumbuddy should be fine and the Filter Plug fully automated in HA, which follows start print / Nozzle Temp and Print end - would this not be fine?

<!-- gh-comment-id:4193332783 --> @TravisWilder commented on GitHub (Apr 6, 2026): Hello I do not understand "and the printer plug turns on when the hotend reaches 70°C.For debugging, " and why you add the filter plug at all to bambuddy, if you fully automate this in HA? A1 plug in Bumbuddy should be fine and the Filter Plug fully automated in HA, which follows start print / Nozzle Temp and Print end - would this not be fine?
Author
Owner

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

Sorry, duplicate bug report... I add the log here too.

bambuddy-support-20260406-160420.zip

"and the printer plug turns on when the hotend reaches 70°C. Sorry, i mean the printer should turn off when the hotend reaches 70°C. I added the 2 plug to Bambuddy to keep all in the same place.

How can i automate the power on of the Filter in HA when a print starts? I understand that i can automate the power on of the Filter when the printer plug is on, but no with the start of the print. I want to stay off until a print start only.

<!-- gh-comment-id:4193495400 --> @mstko commented on GitHub (Apr 6, 2026): Sorry, duplicate bug report... I add the log here too. [bambuddy-support-20260406-160420.zip](https://github.com/user-attachments/files/26513334/bambuddy-support-20260406-160420.zip) "and the printer plug turns on when the hotend reaches 70°C. Sorry, i mean the printer should turn off when the hotend reaches 70°C. I added the 2 plug to Bambuddy to keep all in the same place. How can i automate the power on of the Filter in HA when a print starts? I understand that i can automate the power on of the Filter when the printer plug is on, but no with the start of the print. I want to stay off until a print start only.
Author
Owner

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

You can add the bambulab integration to HA
I use in example the status to block (hide) the Shelly switch in my HA dashboard to prevent power off during printing

<!-- gh-comment-id:4193741311 --> @TravisWilder commented on GitHub (Apr 6, 2026): You can add the bambulab integration to HA I use in example the status to block (hide) the Shelly switch in my HA dashboard to prevent power off during printing
Author
Owner

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

https://github.com/maziggy/bambuddy/issues/903

<!-- gh-comment-id:4197364893 --> @maziggy commented on GitHub (Apr 7, 2026): https://github.com/maziggy/bambuddy/issues/903
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#622
No description provided.