greghesp / ha-bambulab

A Home Assistant Integration for Bambu Lab Printers
696 stars 58 forks source link

[Bug] Translation Error: The intl string context variable "reason" was not provided to the string "Stopped because of unknown reason {reason} at {time} (runtime: {executiontime} seconds)" #494

Closed pcmike closed 2 months ago

pcmike commented 2 months ago

Describe the bug

Ever since the most recent HA core update my automations that rely on entities exposed by this integration are failing with the following error when they reach steps involving the entities from this integration…

Translation Error: The intl string context variable "reason" was not provided to the string "Stopped because of unknown reason {reason} at {time} (runtime: {executiontime} seconds)"

It’s always the same error as above no matter the caution and no matter the entity.

All of these automations worked just fine before the HA core update. One thing to also call out is that after the update I did “categorize” all these automations into a “Bambu” category (I don’t think that matters, but figured I’d add that in). Aside from the update and the subsequent categorization, I haven’t changed anything else about my entire setup.

Anyone else encountering this? How can I troubleshoot this and try to get things working again?

Thank you!

To Reproduce

Tough to answer, because nothing has changed, so I don’t have any steps to “reproduce.”

Expected Behaviour

Error not to occur

What device are you using?

X1C

Diagnostic Output

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2024.4.1",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.12.2",
    "docker": true,
    "arch": "x86_64",
    "timezone": "America/New_York",
    "os_name": "Linux",
    "os_version": "6.6.20-haos",
    "supervisor": "2024.03.1",
    "host_os": "Home Assistant OS 12.1",
    "docker_version": "24.0.7",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "bambu_lab": {
      "version": "2.0.15",
      "requirements": []
    },
    "fontawesome": {
      "version": "2.2.1",
      "requirements": []
    },
    "govee": {
      "version": "2023.11.1",
      "requirements": [
        "govee-api-laggat==0.2.2",
        "dacite==1.8.0"
      ]
    },
    "tesla_custom": {
      "version": "3.20.5",
      "requirements": [
        "teslajsonpy==3.10.2"
      ]
    },
    "midea_ac_lan": {
      "version": "v0.3.22",
      "requirements": []
    },
    "hacs": {
      "version": "1.34.0",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    }
  },
  "integration_manifest": {
    "domain": "bambu_lab",
    "name": "Bambu Lab",
    "codeowners": [
      "@greghesp",
      "@AdrianGarside"
    ],
    "config_flow": true,
    "dependencies": [
      "device_automation",
      "ffmpeg",
      "mqtt"
    ],
    "documentation": "https://github.com/greghesp/ha-bambulab",
    "iot_class": "local_push",
    "issue_tracker": "https://github.com/greghesp/ha-bambulab/issues",
    "ssdp": [
      {
        "st": "urn:bambulab-com:device:3dprinter:1"
      }
    ],
    "version": "2.0.15",
    "is_built_in": false
  },
  "data": {
    "config_entry": {
      "entry_id": "3036056aa8c6ea760ad2f69e21648ef8",
      "version": 2,
      "minor_version": 1,
      "domain": "bambu_lab",
      "title": "**REDACTED**",
      "data": {
        "device_type": "X1C",
        "serial": "**REDACTED**"
      },
      "options": {
        "region": "NorthAmerica",
        "email": "**REDACTED**",
        "username": "**REDACTED**",
        "name": "3DP-00M-418",
        "host": "192.168.3.200",
        "local_mqtt": true,
        "auth_token": "**REDACTED**",
        "access_code": "**REDACTED**",
        "usage_hours": 76.59999999999998
      },
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "unique_id": null,
      "disabled_by": null
    },
    "push_all": {
      "ams": {
        "ams": [
          {
            "humidity": "5",
            "id": "0",
            "temp": "29.2",
            "tray": [
              {
                "bed_temp": "35",
                "bed_temp_type": "1",
                "cali_idx": -1,
                "cols": [
                  "61C680FF"
                ],
                "ctype": 0,
                "drying_temp": "55",
                "drying_time": "8",
                "id": "0",
                "nozzle_temp_max": "230",
                "nozzle_temp_min": "190",
                "remain": 84,
                "tag_uid": "9C27BC5400000100",
                "tray_color": "61C680FF",
                "tray_diameter": "1.75",
                "tray_id_name": "A01-G1",
                "tray_info_idx": "GFA01",
                "tray_sub_brands": "PLA Matte",
                "tray_type": "PLA",
                "tray_uuid": "52FB393EE5C94995B25F957E456BD5F6",
                "tray_weight": "1000",
                "xcam_info": "8813D007E803E803CDCC4C3F"
              },
              {
                "bed_temp": "35",
                "bed_temp_type": "1",
                "cali_idx": -1,
                "cols": [
                  "000000FF"
                ],
                "ctype": 0,
                "drying_temp": "55",
                "drying_time": "8",
                "id": "1",
                "nozzle_temp_max": "230",
                "nozzle_temp_min": "190",
                "remain": 38,
                "tag_uid": "5C0ABD5400000100",
                "tray_color": "000000FF",
                "tray_diameter": "1.75",
                "tray_id_name": "A01-K1",
                "tray_info_idx": "GFA01",
                "tray_sub_brands": "PLA Matte",
                "tray_type": "PLA",
                "tray_uuid": "AAF28870CF7B4A24935FA6490985DFB9",
                "tray_weight": "1000",
                "xcam_info": "A4388813E803E803CDCC4C3F"
              },
              {
                "bed_temp": "80",
                "bed_temp_type": "1",
                "cali_idx": -1,
                "cols": [
                  "000000FF"
                ],
                "ctype": 0,
                "drying_temp": "80",
                "drying_time": "8",
                "id": "2",
                "nozzle_temp_max": "270",
                "nozzle_temp_min": "240",
                "remain": 100,
                "tag_uid": "50E5802F00000100",
                "tray_color": "000000FF",
                "tray_diameter": "1.75",
                "tray_id_name": "B01-K0",
                "tray_info_idx": "GFB01",
                "tray_sub_brands": "ASA",
                "tray_type": "ASA",
                "tray_uuid": "C119E929774247C1A0147C0700713800",
                "tray_weight": "1000",
                "xcam_info": "803E1027E803E8030000803F"
              },
              {
                "bed_temp": "35",
                "bed_temp_type": "1",
                "cali_idx": -1,
                "cols": [
                  "9B9EA0FF"
                ],
                "ctype": 0,
                "drying_temp": "55",
                "drying_time": "8",
                "id": "3",
                "nozzle_temp_max": "230",
                "nozzle_temp_min": "190",
                "remain": 97,
                "tag_uid": "5CF22E9400000100",
                "tray_color": "9B9EA0FF",
                "tray_diameter": "1.75",
                "tray_id_name": "A01-D3",
                "tray_info_idx": "GFA01",
                "tray_sub_brands": "PLA Matte",
                "tray_type": "PLA",
                "tray_uuid": "ABC0188EBD164CA8BF3766F51882CAA1",
                "tray_weight": "1000",
                "xcam_info": "D007D007E803E8030000803F"
              }
            ]
          }
        ],
        "ams_exist_bits": "1",
        "insert_flag": true,
        "power_on_flag": false,
        "tray_exist_bits": "f",
        "tray_is_bbl_bits": "f",
        "tray_now": "255",
        "tray_pre": "255",
        "tray_read_done_bits": "f",
        "tray_reading_bits": "0",
        "tray_tar": "255",
        "version": 12870
      },
      "ams_rfid_status": 0,
      "ams_status": 0,
      "aux_part_fan": true,
      "bed_target_temper": 0.0,
      "bed_temper": 25.0,
      "big_fan1_speed": "0",
      "big_fan2_speed": "0",
      "cali_version": 0,
      "chamber_temper": 30.0,
      "command": "push_status",
      "cooling_fan_speed": "0",
      "ctt": 0,
      "fail_reason": "0",
      "fan_gear": 0,
      "filam_bak": [],
      "force_upgrade": false,
      "gcode_file": "/data/Metadata/plate_1.gcode",
      "gcode_file_prepare_percent": "100",
      "gcode_start_time": "1712454653",
      "gcode_state": "FINISH",
      "heatbreak_fan_speed": "0",
      "hms": [],
      "home_flag": 6409600,
      "hw_switch_state": 0,
      "ipcam": {
        "ipcam_dev": "1",
        "ipcam_record": "enable",
        "mode_bits": 2,
        "resolution": "1080p",
        "rtsp_url": "**REDACTED**",
        "timelapse": "disable",
        "tutk_server": "disable"
      },
      "job_id": "67652289",
      "layer_num": 145,
      "lifecycle": "product",
      "lights_report": [
        {
          "mode": "off",
          "node": "chamber_light"
        },
        {
          "mode": "flashing",
          "node": "work_light"
        }
      ],
      "maintain": 3,
      "mc_percent": 100,
      "mc_print_error_code": "0",
      "mc_print_stage": "1",
      "mc_print_sub_stage": 0,
      "mc_remaining_time": 0,
      "mess_production_state": "active",
      "net": {
        "conf": 16,
        "info": [
          {
            "ip": 3355683008,
            "mask": 16777215
          },
          {
            "ip": 0,
            "mask": 0
          }
        ]
      },
      "nozzle_diameter": "0.4",
      "nozzle_target_temper": 0.0,
      "nozzle_temper": 29.0,
      "nozzle_type": "hardened_steel",
      "online": {
        "ahb": false,
        "ext": false,
        "version": 7
      },
      "print_error": 0,
      "print_gcode_action": 255,
      "print_real_action": 0,
      "print_type": "cloud",
      "profile_id": "65747077",
      "project_id": "67068906",
      "queue_est": 0,
      "queue_number": 0,
      "queue_sts": 0,
      "queue_total": 0,
      "s_obj": [],
      "sdcard": true,
      "sequence_id": "2021",
      "spd_lvl": 2,
      "spd_mag": 100,
      "stg": [
        2,
        14,
        1
      ],
      "stg_cur": -1,
      "subtask_id": "132027188",
      "subtask_name": "verticalPhoneStand",
      "task_id": "132027187",
      "total_layer_num": 145,
      "upgrade_state": {
        "ahb_new_version_number": "",
        "ams_new_version_number": "",
        "consistency_request": false,
        "dis_state": 0,
        "err_code": 0,
        "ext_new_version_number": "",
        "force_upgrade": false,
        "idx": 7,
        "message": "",
        "module": "null",
        "new_version_state": 2,
        "ota_new_version_number": "",
        "progress": "0",
        "sequence_id": 0,
        "sn": "**REDACTED**",
        "status": "IDLE"
      },
      "upload": {
        "file_size": 0,
        "finish_size": 0,
        "message": "Good",
        "oss_url": "",
        "progress": 0,
        "sequence_id": "0903",
        "speed": 0,
        "status": "idle",
        "task_id": "",
        "time_remaining": 0,
        "trouble_id": ""
      },
      "vt_tray": {
        "bed_temp": "0",
        "bed_temp_type": "0",
        "cali_idx": -1,
        "cols": [
          "00000000"
        ],
        "ctype": 0,
        "drying_temp": "0",
        "drying_time": "0",
        "id": "254",
        "nozzle_temp_max": "0",
        "nozzle_temp_min": "0",
        "remain": 0,
        "tag_uid": "0000000000000000",
        "tray_color": "00000000",
        "tray_diameter": "0.00",
        "tray_id_name": "",
        "tray_info_idx": "",
        "tray_sub_brands": "",
        "tray_type": "",
        "tray_uuid": "00000000000000000000000000000000",
        "tray_weight": "0",
        "xcam_info": "000000000000000000000000"
      },
      "wifi_signal": "-45dBm",
      "xcam": {
        "allow_skip_parts": false,
        "buildplate_marker_detector": true,
        "first_layer_inspector": true,
        "halt_print_sensitivity": "medium",
        "print_halt": true,
        "printing_monitor": true,
        "spaghetti_detector": true
      },
      "xcam_status": "0"
    },
    "get_version": {
      "command": "get_version",
      "module": [
        {
          "hw_ver": "",
          "name": "ota",
          "sn": "",
          "sw_ver": "01.07.02.00"
        },
        {
          "hw_ver": "AP05",
          "name": "rv1126",
          "sn": "**REDACTED**",
          "sw_ver": "00.00.28.55"
        },
        {
          "hw_ver": "TH09",
          "name": "th",
          "sn": "**REDACTED**",
          "sw_ver": "00.00.07.12"
        },
        {
          "hw_ver": "MC07",
          "name": "mc",
          "sn": "**REDACTED**",
          "sw_ver": "00.00.22.37/00.00.22.37"
        },
        {
          "hw_ver": "",
          "name": "xm",
          "sn": "",
          "sw_ver": "00.01.02.02"
        },
        {
          "hw_ver": "AMS08",
          "name": "ams/0",
          "sn": "**REDACTED**",
          "sw_ver": "00.00.06.40"
        }
      ],
      "sequence_id": "0"
    }
  }
}

Log Extracts

No response

Other Information

No response

pcmike commented 2 months ago

I'm going to link you to a file that includes the following.. original automation, trace, trace timeline, and log error detail.

Link: https://pcmike.net/ha_x1c_counter

pcmike commented 2 months ago

I’m not a coder and have no clue about how this integration is written, but according to some knowledgeable people over at home assistant it sounds like the contributors with coding knowledge may want to take a look at this post… https://github.com/home-assistant/core/issues/115060#issuecomment-2041605497

@greghesp << Greg, do you happen to idle on any particular discord servers where you discuss your integration?

AdrianGarside commented 2 months ago

Thanks. I’ll fix the threading issues they called out but it sounds like that might be just the tip of the iceberg.

serosenstein commented 2 months ago

I'm also seeing this behavior on 2024.4.0 container

AdrianGarside commented 2 months ago

Please try this version: https://github.com/greghesp/ha-bambulab/releases/tag/v2.0.16-dev4

serosenstein commented 2 months ago

Looks like my automation finished successfully this time (turn on fan when printer starts printing). Thanks for the quick work on this!

tool666schism commented 2 months ago

Can confirm, that release resolved my issue as well (turning off the LED after print completes)

AdrianGarside commented 2 months ago

Closing this as resolved. Please open a new issue (with debug logs) if you still hit any further instability to help me keep repros prior to this fix vs after.