greghesp / ha-bambulab

A Home Assistant Integration for Bambu Lab Printers
884 stars 71 forks source link

[Feature] Camera stream only while printing or on request #423

Open crosserSniper opened 9 months ago

crosserSniper commented 9 months ago

Describe the feature

My Homeassistant-Logfile is full with camera P1S has changed. It would be great, if the image is only refreshing while printing, or on request - for example when the picture was pressed.

grafik

What device is this for?

P1S

Other Information

No response

niklerus commented 9 months ago

I second that, the camera never stops unless you power cycle the printer (and then you need to restart HA to get camera to start) Logfile gets an updated entry every second as it is now.

kiwiholmberg commented 9 months ago

I added configuration to exclude events from the camera since they were extremely spammy. Goes in your global HA configuration.yaml:

logbook:
  exclude:
    entities:
      - image.p1s_01pxxxxxxxx_camera
cahdero commented 9 months ago

I added configuration to exclude events from the camera since they were extremely spammy. Goes in your global HA configuration.yaml:

logbook:
  exclude:
    entities:
      - image.p1s_01pxxxxxxxx_camera

I've tried this using the "recorder" integration ...continues to record camera updates..

niklerus commented 9 months ago

I disabled the entity for now, hoping it will be fixed in the near future.

miabilabs commented 9 months ago

Adding a vote here. I've unfortunately disabled the entity as well.

AdrianGarside commented 9 months ago

I second that, the camera never stops unless you power cycle the printer (and then you need to restart HA to get camera to start) Logfile gets an updated entry every second as it is now.

It’s a bug if you have to restart the printer to get the camera working again. I fixed a bug recently that led to that if you were connecting via the Bambu cloud Mqtt service instead of direct to the printer.

AdrianGarside commented 9 months ago

I added configuration to exclude events from the camera since they were extremely spammy. Goes in your global HA configuration.yaml:

logbook:
  exclude:
    entities:
      - image.p1s_01pxxxxxxxx_camera

Is that working for you? It doesn’t for me. What version of home assistant are you running?

kiwiholmberg commented 9 months ago

I added configuration to exclude events from the camera since they were extremely spammy. Goes in your global HA configuration.yaml:

logbook:
  exclude:
    entities:
      - image.p1s_01pxxxxxxxx_camera

Is that working for you? It doesn’t for me. What version of home assistant are you running?

Yes it works. I no longer see the events for the camera in the logbook. Running HAOS 11.2, the printer is in LAN mode. To be extra clear, you'll have to change the entity name in the filter to match whatever your camera entity name is 🙂

cahdero commented 9 months ago

I added configuration to exclude events from the camera since they were extremely spammy. Goes in your global HA configuration.yaml:

logbook:
  exclude:
    entities:
      - image.p1s_01pxxxxxxxx_camera

Is that working for you? It doesn’t for me. What version of home assistant are you running?

Yes it works. I no longer see the events for the camera in the logbook. Running HAOS 11.2, the printer is in LAN mode. To be extra clear, you'll have to change the entity name in the filter to match whatever your camera entity name is 🙂

You’ll want to utilize the “record” function and not the “logbook” function. It still get recorded just doesn’t show on the logbook. Also if using the record function it doesn’t show on the logbook bag but only when you filter for the actual camera entity for some reason

niklerus commented 9 months ago

I second that, the camera never stops unless you power cycle the printer (and then you need to restart HA to get camera to start) Logfile gets an updated entry every second as it is now.

It’s a bug if you have to restart the printer to get the camera working again. I fixed a bug recently that led to that if you were connecting via the Bambu cloud Mqtt service instead of direct to the printer.

You've misread a bit, I said that I need to restart HA to get the camera to work again if I stop the logflow from the printer by restarting the printer.

AdrianGarside commented 9 months ago

I spent some time over the weekend trying to get recorder and logbook exclusions to work with no success - they’re still spamming the system. So I wonder what’s different for folk that have gotten it to behave as advertised.

AdrianGarside commented 9 months ago

I second that, the camera never stops unless you power cycle the printer (and then you need to restart HA to get camera to start) Logfile gets an updated entry every second as it is now.

It’s a bug if you have to restart the printer to get the camera working again. I fixed a bug recently that led to that if you were connecting via the Bambu cloud Mqtt service instead of direct to the printer.

You've misread a bit, I said that I need to restart HA to get the camera to work again if I stop the logflow from the printer by restarting the printer.

Sorry I mistyped. I mean it’s a bug if you have to restart home assistant after you restarted the printer to get the camera working again. It should automatically reconnect without any intervention.

AdrianGarside commented 8 months ago

I added configuration to exclude events from the camera since they were extremely spammy. Goes in your global HA configuration.yaml:

logbook:
  exclude:
    entities:
      - image.p1s_01pxxxxxxxx_camera

Is that working for you? It doesn’t for me. What version of home assistant are you running?

Yes it works. I no longer see the events for the camera in the logbook. Running HAOS 11.2, the printer is in LAN mode. To be extra clear, you'll have to change the entity name in the filter to match whatever your camera entity name is 🙂

You’ll want to utilize the “record” function and not the “logbook” function. It still get recorded just doesn’t show on the logbook. Also if using the record function it doesn’t show on the logbook bag but only when you filter for the actual camera entity for some reason

I can't get recorder exclusion to work for these images by any means: recorder: exclude: domains:

None of domains, entity_globs or entities work to stop the state change being recorded and present in the logbook every 1-2 seconds. Were you able to get this to work?

AdrianGarside commented 8 months ago

My testing was flawed. The logbook pane in the device view shows pre-filtered changes and I have found no way to prevent that showing live changes even when they are correctly filtered from the logbook and backing database. The actual logbook was properly excluding.

You can suppress the logging by adding either of these to your configuration.yaml file:

recorder:
  exclude:
    entity_globs:
      - image.p1*_camera
      - sensor.p1*_wi_fi_signal

or

logbook:
  exclude:
    entity_globs:
      - image.p1*_camera
      - sensor.p1*_wi_fi_signal

I recommend suppressing recording as that'll reduce the database churn.

github-actions[bot] commented 6 months ago

Stale issue message

sabaatworld commented 6 months ago

Is it possible to expose camera as a camera entity? It would be easier to work with and also avoid the above issues.

github-actions[bot] commented 4 months ago

Stale issue message

jawilson commented 2 weeks ago

Is it possible to expose camera as a camera entity? It would be easier to work with and also avoid the above issues.

I've added PR #595 to implement this.