greghesp / ha-bambulab

A Home Assistant Integration for Bambu Lab Printers
698 stars 59 forks source link

camera updating every second in logbook #451

Closed gregsmith-movista closed 5 months ago

gregsmith-movista commented 5 months ago

Discussed in https://github.com/greghesp/ha-bambulab/discussions/449

Originally posted by **starschild86** January 22, 2024 The log is currently flooded by updates on cam, would it be possible to disable them? also is the cam uploading a picture every second? does this consume bandwith/ create stress on my home assistant device? would it be possible to have it active only when a print is in progress? best, Nicola
gregsmith-movista commented 5 months ago

The logbook in HA starts to fill rapidly with entries from the camera with a "updating" message every second... example of logbook attached image There is otherwise no activity on the printer. It is not printing anything, but it is on, and ready to print when a job is sent.

gregsmith-movista commented 5 months ago

Honestly, it looks like someone left a debug flag running in the code somewhere. If we could figure out where that is, and get it commented out next build it would be AWESOME.

Let me know if I can help test out the issue.

AdrianGarside commented 5 months ago

Unfortunately the mechanisms that Home Assistant has to suppress this are buggy and don't work.

Dupe of #423

AdrianGarside commented 5 months ago

https://github.com/home-assistant/core/issues/108343 https://github.com/home-assistant/core/issues/108344

jiveman commented 5 months ago

Yea great work guys, but this makes it unusable for me at the moment. Also the manual refresh mode doesn't seem to survive reloads.

AdrianGarside commented 5 months ago

You can fix the real logbook with this configuration setting in your configuration.yaml like this:

recorder:
  exclude:
    entities:
      - image.p1p_SERIAL_camera
      - sensor.p1p_SERIAL_wi_fi_signal

You can't filter the entities just with the similar logbook: configuration settings because HA broke that a while back - only the recorder filtering works since that also controls logging. You could filter out the entire image domain from the logbook but it's best to filter these high volume events from being recorded at all as above.

What you can't fix currently is the logbook pane that appears in the device view - it shows live logbook entire pre-filtering so it'll appear like the logbook is still being spammed but if you look at the real the logbook it will not have the entries.

AdrianGarside commented 5 months ago

Now that I understand the distinction between the real logbook and the misleading logbook pane in the device view I'll see if I can actually suppress the recorder from the integration itself.

AdrianGarside commented 5 months ago

Actually my testing was flawed - logbook suppression alone does work:

logbook:
  exclude:
    entities:
      - image.p1p_SERIAL_camera
      - sensor.p1p_SERIAL_wi_fi_signal

Although to reduce database churn I still suggest suppressing via recorder.

AdrianGarside commented 5 months ago

Now that I understand the distinction between the real logbook and the misleading logbook pane in the device view I'll see if I can actually suppress the recorder from the integration itself.

Nope, the attribute suppression mechanism doesn't seem to work for the sensor state itself. The only solution right now is the user configuration change above.

AdrianGarside commented 5 months ago

Closing as dupe of #423