greghesp / ha-bambulab

A Home Assistant Integration for Bambu Lab Printers
862 stars 70 forks source link

[Bug] Printer status switches to offline randomly #493

Closed SoCuul closed 5 months ago

SoCuul commented 5 months ago

Describe the bug

When my printer is idle, its status randomly switches sometimes to offline, then reverts back to idle a few seconds later.

To Reproduce

  1. Set up an automation to log each time the status changes/check history

*Note: I have not been able to reproduce this consistently, but this is how I have known that it goes offline.

Expected Behaviour

Status should stay idle consistently.

What device are you using?

A1

Diagnostic Output

https://pastebin.com/raw/7BEs2qk4

Log Extracts

No response

Other Information

No response

AdrianGarside commented 5 months ago

This is the watchdog timer firing - which happens if the printer doesn't send data for a long enough time (30 seconds). It triggers a call from the integration to the printer to turn data back on as there is (was?) some kind of idle out going on where it would silently stop sending data unless told to keep doing so. The watchdog time also handles the case when the printer truly did go offline so that we can detect it correctly even in cloud mode where we never actually know it went offline since the cloud mqtt connection never drops. But with A1/P1 printers they only send deltas and occasionally the wifi value doesn't fluctuate enough to have anything new to send for > 30s.