greghesp / ha-bambulab

A Home Assistant Integration for Bambu Lab Printers
1.06k stars 94 forks source link

[Bug] Keeps going offline #609

Closed JamieEC closed 1 month ago

JamieEC commented 1 month ago

Describe the bug

Printer keeps showing offline in home assistant. No model picture is showing. Started 15/10/24. Following is present in logs Error doing job: Exception in callback BambuDataUpdateCoordinator.event_handler_internal('event_print_error') (None) Traceback (most recent call last): File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/config/custom_components/bambu_lab/coordinator.py", line 109, in event_handler_internal self._update_print_error() File "/config/custom_components/bambu_lab/coordinator.py", line 194, in _update_print_error if 'Code' in device.print_error.errors: ^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'PrintErrorList' object has no attribute 'errors'. Did you mean: 'error'?

I have deleted and readded, still same issue. I have added an IP address.

To Reproduce

Unknown

Expected Behaviour

Printer stays online

What device are you using?

P1S

Diagnostic Output

{
  "home_assistant": {
    "installation_type": "Home Assistant Container",
    "version": "2024.7.2",
    "dev": false,
    "hassio": false,
    "virtualenv": false,
    "python_version": "3.12.4",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/London",
    "os_name": "Linux",
    "os_version": "6.1.0-21-amd64",
    "run_as_root": true
  },
  "custom_components": {
    "spotcast": {
      "documentation": "https://github.com/fondberg/spotcast",
      "version": "v3.6.30",
      "requirements": []
    },
    "sonoff": {
      "documentation": "https://github.com/AlexxIT/SonoffLAN",
      "version": "3.7.3",
      "requirements": [
        "pycryptodome>=3.6.6"
      ]
    },
    "better_thermostat": {
      "documentation": "https://github.com/KartoffelToby/better_thermostat",
      "version": "1.5.1",
      "requirements": []
    },
    "minecraft_server": {
      "documentation": "https://www.home-assistant.io/integrations/minecraft_server",
      "version": "1.0.0",
      "requirements": [
        "aiodns==3.0.0",
        "getmac==0.8.2",
        "mcstatus==6.0.0"
      ]
    },
    "mass": {
      "documentation": "https://music-assistant.io",
      "version": "2024.6.2",
      "requirements": [
        "music-assistant==2.0.6"
      ]
    },
    "ui_lovelace_minimalist": {
      "documentation": "https://ui-lovelace-minimalist.github.io/UI/",
      "version": "v1.3.10",
      "requirements": [
        "aiofiles==0.8.0",
        "aiogithubapi>=22.2.4"
      ]
    },
    "tapo": {
      "documentation": "https://github.com/petretiandrea/home-assistant-tapo-p100",
      "version": "3.1.2",
      "requirements": [
        "plugp100==5.1.3"
      ]
    },
    "hacs": {
      "documentation": "https://hacs.xyz/docs/configuration/start",
      "version": "1.34.0",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "waste_collection_schedule": {
      "documentation": "https://github.com/mampfes/hacs_waste_collection_schedule#readme",
      "version": "2.2.0",
      "requirements": [
        "icalendar",
        "recurring_ical_events",
        "icalevents!=0.1.28",
        "beautifulsoup4",
        "lxml",
        "pycryptodome"
      ]
    },
    "alarmo": {
      "documentation": "https://github.com/nielsfaber/alarmo",
      "version": "v1.10.1",
      "requirements": []
    },
    "bambu_lab": {
      "documentation": "https://github.com/greghesp/ha-bambulab",
      "version": "2.0.22",
      "requirements": []
    },
    "dreame_vacuum": {
      "documentation": "https://github.com/Tasshack/dreame-vacuum",
      "version": "v1.0.4",
      "requirements": [
        "pillow",
        "numpy",
        "pybase64",
        "requests",
        "pycryptodome",
        "python-miio",
        "py-mini-racer",
        "tzlocal",
        "paho-mqtt"
      ]
    }
  },
  "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.22",
    "is_built_in": false
  },
  "setup_times": {
    "null": {
      "setup": 1.6371719539165497e-05
    },
    "01J9Q9CAY5ZMK605BXZG1SNBBN": {
      "wait_import_platforms": -0.052446091547608376,
      "wait_base_component": -0.0010935347527265549,
      "config_entry_setup": 0.07293218187987804
    }
  },
  "data": {
    "config_entry": {
      "data": {
        "device_type": "P1S",
        "serial": "**REDACTED**"
      },
      "disabled_by": null,
      "domain": "bambu_lab",
      "entry_id": "01JA88XTRYC4BJY1XBX599EJYT",
      "minor_version": 1,
      "options": {
        "region": "Europe",
        "email": "**REDACTED**",
        "username": "**REDACTED**",
        "name": "Bambu P1S",
        "host": "192.168.0.226",
        "local_mqtt": false,
        "auth_token": "**REDACTED**",
        "access_code": "**REDACTED**",
        "usage_hours": 0.0
      },
      "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-15 14:40:36.681 ERROR (P1S-Mqtt-858806) [custom_components.bambu_lab.pybambu] An exception occurred processing a message:
2024-10-15 14:40:36.682 ERROR (P1S-Mqtt-858806) [custom_components.bambu_lab.pybambu] Exception type: <class 'ValueError'>
2024-10-15 14:40:36.682 ERROR (P1S-Mqtt-858806) [custom_components.bambu_lab.pybambu] Exception data: 403
2024-10-15 14:41:40.688 WARNING (Thread-1088 (_thread_main)) [custom_components.bambu_lab.pybambu] On Disconnect: Disconnected from Broker: 0
2024-10-15 14:41:40.688 WARNING (Thread-1088 (_thread_main)) [custom_components.bambu_lab.pybambu] _on_disconnect
2024-10-15 14:41:40.713 WARNING (MainThread) [custom_components.bambu_lab.pybambu] On Disconnect: Disconnected from Broker: 0
2024-10-15 14:41:40.713 WARNING (MainThread) [custom_components.bambu_lab.pybambu] _on_disconnect
2024-10-15 14:41:40.714 WARNING (MainThread) [custom_components.bambu_lab.pybambu] Stopping watchdog thread
2024-10-15 14:41:40.715 WARNING (MainThread) [custom_components.bambu_lab.pybambu] Stopping camera thread
2024-10-15 14:41:41.154 WARNING (P1S-Mqtt-858806) [custom_components.bambu_lab.pybambu] On Disconnect: Disconnected from Broker: 0
2024-10-15 14:41:41.154 WARNING (P1S-Mqtt-858806) [custom_components.bambu_lab.pybambu] _on_disconnect
2024-10-15 14:41:41.154 WARNING (P1S-Mqtt-858806) [custom_components.bambu_lab.pybambu] Stopping watchdog thread
2024-10-15 14:41:41.154 WARNING (P1S-Mqtt-858806) [custom_components.bambu_lab.pybambu] Stopping camera thread

Other Information

No response

JamieEC commented 1 month ago

Issue was my IPv6 connectivity was not working. Once fixed it worked straight away.