greghesp / ha-bambulab

A Home Assistant Integration for Bambu Lab Printers
935 stars 81 forks source link

[Bug] _async_update_data() unexpectedly called #642

Closed jbarbash closed 1 day ago

jbarbash commented 1 day ago

Describe the bug

Every time I restart HA I'm getting this error message, even on the newest update

To Reproduce

Restart HA and view logs

Expected Behaviour

No errors reported

What device are you using?

A1 Mini

Diagnostic Output

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2024.10.4",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.12.4",
    "docker": true,
    "arch": "aarch64",
    "timezone": "America/New_York",
    "os_name": "Linux",
    "os_version": "6.6.31-haos-raspi",
    "supervisor": "2024.10.3",
    "host_os": "Home Assistant OS 13.2",
    "docker_version": "27.2.0",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "linktap": {
      "documentation": "https://github.com/sh00t2kill/linktap_local_http_component",
      "version": "0.1.0",
      "requirements": []
    },
    "bambu_lab": {
      "documentation": "https://github.com/greghesp/ha-bambulab",
      "version": "2.0.25",
      "requirements": [
        "httpx>=0.27.0"
      ]
    },
    "rpi_gpio": {
      "documentation": "https://github.com/thecode/ha-rpi_gpio",
      "version": "2024.10.2",
      "requirements": [
        "gpiod>=2.0.2"
      ]
    },
    "traeger": {
      "documentation": "https://github.com/njobrien1006/hass_traeger",
      "version": "2024.08.25",
      "requirements": []
    },
    "kidde": {
      "documentation": "https://github.com/tache/homeassistant-kidde",
      "version": "v0.1.0",
      "requirements": [
        "kidde-homesafe"
      ]
    },
    "aarlo": {
      "documentation": "https://github.com/twrecked/hass-aarlo/blob/master/README.md",
      "version": "0.8.1.8",
      "requirements": [
        "unidecode",
        "pyaarlo>=0.8.0.12"
      ]
    },
    "hacs": {
      "documentation": "https://hacs.xyz/docs/configuration/start",
      "version": "2.0.1",
      "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",
    "requirements": [
      "httpx>=0.27.0"
    ],
    "ssdp": [
      {
        "st": "urn:bambulab-com:device:3dprinter:1"
      }
    ],
    "version": "2.0.25",
    "is_built_in": false
  },
  "setup_times": {
    "null": {
      "setup": 4.75000124424696e-05
    },
    "01J8GFYSBWHQ7REMV72GJK4619": {
      "wait_import_platforms": -0.03344422800000757,
      "wait_base_component": -0.0036326759727671742,
      "config_entry_setup": 0.09220652200747281
    }
  },
  "data": {
    "config_entry": {
      "created_at": "2024-09-23T22:27:41.564711+00:00",
      "data": {
        "device_type": "A1mini",
        "serial": "**REDACTED**"
      },
      "discovery_keys": {},
      "disabled_by": null,
      "domain": "bambu_lab",
      "entry_id": "01J8GFYSBWHQ7REMV72GJK4619",
      "minor_version": 1,
      "modified_at": "2024-10-26T14:24:43.174481+00:00",
      "options": {
        "region": "NorthAmerica",
        "email": "**REDACTED**",
        "username": "**REDACTED**",
        "name": "3D Printer",
        "host": "",
        "local_mqtt": false,
        "auth_token": "**REDACTED**",
        "access_code": "**REDACTED**",
        "usage_hours": 41.37
      },
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "title": "**REDACTED**",
      "unique_id": null,
      "version": 2
    },
    "push_all": null,
    "get_version": null
  }
}

Log Extracts

2024-10-27 08:34:30.670 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration linktap which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-10-27 08:34:30.672 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration bambu_lab which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-10-27 08:34:30.673 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration rpi_gpio which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-10-27 08:34:30.675 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration traeger which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-10-27 08:34:30.677 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration kidde which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-10-27 08:34:30.678 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration aarlo which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-10-27 08:34:30.680 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-10-27 08:34:54.019 WARNING (ImportExecutor_0) [homeassistant.components.camera] STATE_IDLE was used from aarlo, this is a deprecated constant which will be removed in HA Core 2025.10. Use CameraState.IDLE instead, please report it to the author of the 'aarlo' custom integration
2024-10-27 08:34:54.033 WARNING (ImportExecutor_0) [homeassistant.components.camera] STATE_RECORDING was used from aarlo, this is a deprecated constant which will be removed in HA Core 2025.10. Use CameraState.RECORDING instead, please report it to the author of the 'aarlo' custom integration
2024-10-27 08:34:54.049 WARNING (ImportExecutor_0) [homeassistant.components.camera] STATE_STREAMING was used from aarlo, this is a deprecated constant which will be removed in HA Core 2025.10. Use CameraState.STREAMING instead, please report it to the author of the 'aarlo' custom integration
2024-10-27 08:34:54.061 WARNING (ImportExecutor_0) [homeassistant.components.camera] STATE_IDLE was used from aarlo, this is a deprecated constant which will be removed in HA Core 2025.10. Use CameraState.IDLE instead, please report it to the author of the 'aarlo' custom integration
2024-10-27 08:34:54.073 WARNING (ImportExecutor_0) [homeassistant.components.camera] STATE_RECORDING was used from aarlo, this is a deprecated constant which will be removed in HA Core 2025.10. Use CameraState.RECORDING instead, please report it to the author of the 'aarlo' custom integration
2024-10-27 08:34:54.088 WARNING (ImportExecutor_0) [homeassistant.components.camera] STATE_STREAMING was used from aarlo, this is a deprecated constant which will be removed in HA Core 2025.10. Use CameraState.STREAMING instead, please report it to the author of the 'aarlo' custom integration
2024-10-27 08:34:54.130 WARNING (ImportExecutor_0) [homeassistant.components.media_player.const] MEDIA_TYPE_MUSIC was used from aarlo, this is a deprecated constant which will be removed in HA Core 2025.10. Use MediaType.MUSIC instead, please report it to the author of the 'aarlo' custom integration
2024-10-27 08:34:54.674 DEBUG (MainThread) [custom_components.bambu_lab] async_setup_entry Start
2024-10-27 08:34:54.674 DEBUG (MainThread) [custom_components.bambu_lab] ConfigEntry.Id: 01J8GFYSBWHQ7REMV72GJK4619
2024-10-27 08:34:54.675 ERROR (MainThread) [custom_components.bambu_lab] _async_update_data() unexpectedly called
2024-10-27 08:34:54.675 DEBUG (MainThread) [custom_components.bambu_lab] Finished fetching bambu_lab data in 0.000 seconds (success: True)
2024-10-27 08:34:54.712 DEBUG (MainThread) [custom_components.bambu_lab] BUTTON::async_setup_entry
2024-10-27 08:34:54.717 DEBUG (MainThread) [custom_components.bambu_lab] CAMERA::async_setup_entry
2024-10-27 08:34:54.717 DEBUG (MainThread) [custom_components.bambu_lab] FAN::async_setup_entry
2024-10-27 08:34:54.721 DEBUG (MainThread) [custom_components.bambu_lab] FAN::async_setup_entry DONE
2024-10-27 08:34:54.725 DEBUG (MainThread) [custom_components.bambu_lab] IMAGE::async_setup_entry
2024-10-27 08:34:54.729 DEBUG (MainThread) [custom_components.bambu_lab] SELECT::async_setup_entry
2024-10-27 08:34:54.765 DEBUG (MainThread) [custom_components.bambu_lab] SWITCH::async_setup_entry
2024-10-27 08:34:54.766 DEBUG (MainThread) [custom_components.bambu_lab] async_setup_entry Complete
2024-10-27 08:34:54.766 DEBUG (MainThread) [custom_components.bambu_lab] Starting MQTT
2024-10-27 08:34:54.766 DEBUG (MainThread) [custom_components.bambu_lab] Starting listen()
2024-10-27 08:34:54.803 DEBUG (MainThread) [custom_components.bambu_lab.pybambu] Starting MQTT listener thread
2024-10-27 08:34:54.805 INFO (A1MINI-Mqtt-67) [custom_components.bambu_lab.pybambu] MQTT listener thread started.
2024-10-27 08:34:54.805 DEBUG (A1MINI-Mqtt-67) [custom_components.bambu_lab.pybambu] Connect: Attempting Connection to us.mqtt.bambulab.com
2024-10-27 08:34:55.183 DEBUG (A1MINI-Mqtt-67) [custom_components.bambu_lab.pybambu] Starting listen loop
2024-10-27 08:34:55.335 INFO (A1MINI-Mqtt-67) [custom_components.bambu_lab.pybambu] On Connect: Connected to printer
2024-10-27 08:34:55.336 DEBUG (A1MINI-Mqtt-67) [custom_components.bambu_lab.pybambu] Loading slicer settings...
2024-10-27 08:34:55.336 DEBUG (A1MINI-Mqtt-67) [custom_components.bambu_lab.pybambu] Loading slicer settings
2024-10-27 08:34:55.336 DEBUG (A1MINI-Mqtt-67) [custom_components.bambu_lab.pybambu] Getting slicer settings from Bambu Cloud
2024-10-27 08:34:56.452 DEBUG (A1MINI-Mqtt-67) [custom_components.bambu_lab.pybambu] Got custom filaments: {'GFA00': 'Generic PLA Basic', 'GFL99': 'Generic PLA'}
2024-10-27 08:34:56.453 DEBUG (A1MINI-Mqtt-67) [custom_components.bambu_lab.pybambu] Now subscribing...
2024-10-27 08:34:56.453 DEBUG (A1MINI-Mqtt-67) [custom_components.bambu_lab.pybambu] Subscribing: device/0309CA410700714/report
2024-10-27 08:34:56.453 DEBUG (A1MINI-Mqtt-67) [custom_components.bambu_lab.pybambu] On Connect: Getting version info
2024-10-27 08:34:56.453 DEBUG (A1MINI-Mqtt-67) [custom_components.bambu_lab.pybambu] Sent {'info': {'sequence_id': '0', 'command': 'get_version'}} to topic device/0309CA410700714/request
2024-10-27 08:34:56.453 DEBUG (A1MINI-Mqtt-67) [custom_components.bambu_lab.pybambu] On Connect: Request push all
2024-10-27 08:34:56.455 DEBUG (A1MINI-Mqtt-67) [custom_components.bambu_lab.pybambu] Sent {'pushing': {'sequence_id': '0', 'command': 'pushall'}} to topic device/0309CA410700714/request
2024-10-27 08:34:56.455 DEBUG (A1MINI-Mqtt-67) [custom_components.bambu_lab.pybambu] Starting watchdog thread
2024-10-27 08:34:56.456 INFO (A1MINI-Watchdog-142) [custom_components.bambu_lab.pybambu] Watchdog thread started.
2024-10-27 08:35:26.456 DEBUG (A1MINI-Watchdog-142) [custom_components.bambu_lab.pybambu] Watchdog fired. No data received for 30 seconds for 0309CA410700714.
2024-10-27 08:35:26.456 INFO (A1MINI-Watchdog-142) [custom_components.bambu_lab.pybambu] Watch dog fired
2024-10-27 08:35:26.458 DEBUG (A1MINI-Watchdog-142) [custom_components.bambu_lab.pybambu] Sent {'pushing': {'sequence_id': '0', 'command': 'start'}} to topic device/0309CA410700714/request

Other Information

No response

AdrianGarside commented 1 day ago

Is your printer off when you start the integration?

AdrianGarside commented 1 day ago

Never mind - I see it in my logs too, I was expecting HA to flag it in the UI but I didn't get that. Fixed with #649

jbarbash commented 1 day ago

This seems to still be an issue on 2.0.26. same error.

On Sun, Oct 27, 2024, 1:02 PM AdrianGarside @.***> wrote:

Closed #642 https://github.com/greghesp/ha-bambulab/issues/642 as completed.

— Reply to this email directly, view it on GitHub https://github.com/greghesp/ha-bambulab/issues/642#event-14928359364, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADMOVWMFUUXVLDTK5EHPP4LZ5UMBNAVCNFSM6AAAAABQV2U3BGVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJUHEZDQMZVHEZTMNA . You are receiving this because you authored the thread.Message ID: @.***>

AdrianGarside commented 1 day ago

It'll be fixed in the next release. It's doesn't affect usage so I'm not going to push a new release just for this - there'll new a new release shortly with other fixes.