Support the new image entity for snapshot service

The snapshot service currently only support camera entity, however the new image entity introduced in August '23 already supports “semi” live-feed based updated time.

Several devices now use the image entity, but we cannot use the snapshot service as for camera (Camera - Home Assistant) for the image entity.
This would really be helpful for camera surveillance, time lapsing etc

Why not use a camera integration in the first place?

Because the device I’m using does not use camera, but image. It’s a 3D printer.

1 Like

Which integration?

Bambulab 3D printer. It uses Image entity for the camera, sending image every 3 seconds, so my scripts that capture snapshot will not work since image entity have no snapshot method.

Isn’t the entity_image what you want?

Assuming you are talking about this custom integration GitHub - greghesp/ha-bambulab: A Home Assistant Integration for Bambu Lab Printers it appears to provide a camera integration, do maybe ask on their GitHub if you aren’t seeing that.

Hi. Yes, it’s that integration, however the camera is a image entity and not camera entity. That’s the problem :slight_smile: There are a lot of discussions for possible workarounds, however it would be solved nicely if the image entity in HA would support snapshot method.
The reason for using image entity instead of camera is how the stream is sent. It’s updated every 3 seconds or so, and they are using rtsps (not rtsp) with a messy URL that’s not very stable.

So despite there being a camera.py and a image.py file in the source, you only get a image.whatever entity and no camera.whatever entity?

Edit: the output of this would help

{{integration_entities('bambu_lab')}}

Sure, here it is:

[
  "binary_sensor.bambup1s_recording_timelapse",
  "binary_sensor.bambup1s_hms_errors",
  "binary_sensor.bambup1s_online",
  "binary_sensor.bambup1s_firmware_update",
  "button.bambup1s_pause_printing",
  "button.bambup1s_resume_printing",
  "button.bambup1s_stop_printing",
  "button.bambup1s_force_refresh_data",
  "fan.bambup1s_cooling_fan",
  "fan.bambup1s_aux_fan",
  "fan.bambup1s_chamber_fan",
  "image.bambup1s_camera",
  "light.bambup1s_chamber_light",
  "select.bambup1s_printing_speed",
  "sensor.p1s_01p00a3b2900474_externalspool_external_spool",
  "sensor.bambup1s_mqtt_connection_mode",
  "sensor.bambup1s_wi_fi_signal",
  "sensor.bambup1s_bed_temperature",
  "sensor.bambup1s_target_bed_temperature",
  "sensor.bambup1s_nozzle_target_temperature",
  "sensor.bambup1s_nozzle_temperature",
  "sensor.bambup1s_aux_fan_speed",
  "sensor.bambup1s_chamber_fan_speed",
  "sensor.bambup1s_cooling_fan_speed",
  "sensor.bambup1s_heatbreak_fan_speed",
  "sensor.bambup1s_speed_profile",
  "sensor.bambup1s_current_stage",
  "sensor.bambup1s_print_progress",
  "sensor.bambup1s_print_status",
  "sensor.bambup1s_start_time",
  "sensor.bambup1s_remaining_time",
  "sensor.bambup1s_end_time",
  "sensor.bambup1s_total_usage",
  "sensor.bambup1s_current_layer",
  "sensor.bambup1s_total_layer_count",
  "sensor.bambup1s_active_tray_index",
  "sensor.bambup1s_gcode_filename",
  "sensor.bambup1s_task_name",
  "sensor.bambup1s_print_type",
  "sensor.bambup1s_active_tray",
  "sensor.bambup1s_nozzle_size",
  "sensor.bambup1s_nozzle_type",
  "switch.bambup1s_manual_refresh_mode"
]

So the image.bambup1s_camera is the problematic entity

What are the attributes of image.bambup1s_camera?

`

access_token: ########
entity_picture: /api/image_proxy/image.bambup1s_camera?token=#########
friendly_name: BambuP1S Camera

`

So that’s your image snapshot, what do you want to do with it? Copy it somewhere?

I’m using an automation to save snapshot in a folder every 5 secs, then ffmpeg script to create a timelapse when print is finished. That token changes every time I think, but I can check if it’s possible.

This is the current script I used on a different camera / printer, so guess I need to change it to download from the URL somehow:

service: camera.snapshot
target:
  entity_id: image.bambups1_camera 
data:
  filename: >-
    /media/3dprint/{{ now().strftime("%Y%m%d") }}/3dprint_{{
    now().strftime("%Y%m%d-%H%M%S") }}.jpg

Btw, seems there will be some changes to this soon: What can I do with the new 'image' entity integration? - #4 by petro

And here: Add snapshot service to image entity by NickM-27 · Pull Request #110057 · home-assistant/core · GitHub