Grab camera image (instead of video) for dashboard camera element

I’ve noticed that a single camera still image is much easier to grab when you’re out of your network than the video stream. Actually, even within your network a still shot image works so much better and is adequate for me 99% of the time. For some reason, my HA dashboard takes minutes sometimes to load the video stream, even within my own LAN.

My camera provides a low resolution still image url and a high resolution still image url. Is it possible to create a camera entity that shows the high resolution image when “clicked” rather than the video stream? I still like that it shows a large thumbnail camera image in the dashboard, but when I click it, I want a pop-up of the full resolution image (rather than the video stream).

I’m using this as my configuration.yaml entry. I’d like to replace the “stream_source” with the high resolution URL. When I try to change the stream source from the rtsp stream url to just the http high resolution image url, clicking on the camera doesn’t bring up anything.

camera:
  - platform: generic
    stream_source: rtsp://USER:[email protected]:8554/0
    still_image_url: http://192.168.1.25/cgi-bin/jpeg.cgi?channel=small_image
    name: CAMERA_NAME
    verify_ssl: false
    authentication: basic
    username: USER
    password: PASS

Hi @automationjunkie, the stream url needs to be a stream. It’s not made to work with an image url. Perhaps you could create two cameras, then configure a picture card for the first to load the other?

I don’t know exactly how this might work, just an idea.

Define a second camera without the stream:

camera:
  - platform: generic
    still_image_url: http://192.168.1.25/cgi-bin/jpeg.cgi?channel=small_image
    name: CAMERA_NAME TWO
    verify_ssl: false
    authentication: basic
    username: USER
    password: PASS

On the dashboard this will update every 10 seconds or so. When clicked the higher resolution image will update every 1-3 seconds. Which should be considerably more responsive than waiting for the stream to load.

Please note that YAML configuration for generic cameras is deprecated. Your YAML will be imported but not for much longer!

1 Like

Are you using the preload stream option? That will make the stream start much more quickly and might fix your video issue. The CPU and memory load are pretty light, so there’s really not much downside to that option unless your cameras to HA connection is poor to begin with (e.g., wifi). With the better compression codecs the video stream should not take that much bandwidth, plus you get audio, and you can also make recordings with automations.
Of course if all you want/need is stills, you can still set it up that way.

1 Like