Live camera stream as a card on lovelace - is this possible?

One gripe I have about HA is the inability to display live streams within lovelace. I mean completely live streams, not once that update once every 10 seconds. I use BlueIris, and the BlueIris app lets me do this and I have been trying to replicate this in Home Assistant.

I was hoping that @hunterjm’s stream component would fix this, but it seems like all this does is give me another way to configure this within the UI.

So my entity card looks like this:

entity: camera.carport
show_name: false
show_state: false
type: picture-entity

And with that above configuration, it will show a still image on the lovelace UI, which refreshes every 10 seconds. If I click on the still image, then it will show the stream.

I found that I can have an entity like this:

camera:
  - platform: mjpeg
    mjpeg_url: http://camera-server.home/mjpg/carport
    name: Carport

Or like this:

stream:
camera:

  - platform: generic
    name: Streaming Enabled
    still_image_url: "http://camera-server.home/image/carport"
    stream_source: "http://camera-server.home/h264/carport/temp.m3u8"

And the results are essentially the same. Is there any way to have a live stream show within a panel in lovelace?

The simple answer is that this gets us one step closer. It is now possible, but a Lovelace card has not been built yet. My advice is to hang tight and it will come.

1 Like

You can try this with your configured camera:

    - type: picture
      image: https://HA_IP:port/api/camera_proxy_stream/camera.your_cam?api_password=password
      tap_action:
        action: none
      hold_action:
        action: none

Use https or http for your url, the way HA is setup.
Replace with your HA IP, port, and camera entity name.

Optional, I set up the url in the secrets.yaml, so I don’t have password in lovelace:

secrets.yaml:
your_cam: https://HA_IP:port/api/camera_proxy_stream/camera.your_cam?api_password=password

picture card:
    - type: picture
      image: !secret your_cam

The catch, need to use HA password (I think token is also possible) and the stream will still stop after 5-10 minutes (refresh the browser to re-start stream again),

I am using the “Picture Glance” card to stream
camera_image: camera.aarlo_driveway
entities: []
title: Driveway Live
type: picture-glance

Have a look at this

1 Like

This is true I wish I had the knolage to rewrite the picture-glance card as it would be super if true streaming was supported support added…

but this does work but puts load on the blueiris server:

        type: picture-glance
        title: Living room
        entities:
          - switch.decorative_lights
          - light.ceiling_lights
          - lock.front_door
          - binary_sensor.movement_backyard
          - light.wallpainting
        image: http://192.168.1.xxx:xx/mjpg/Drive/video.mjpg
1 Like

if you have a mjpeg camera put it as a picture

It is possible in Lovelace to show still image of the camera (with xy sec to refresh) and on click show live view?

For always live I can use:

camera_view: live
entity: camera.hikvisionout
type: picture-entity
5 Likes

Oh my, thank you so much! I have been trying to do this for half a year, and with your help it worked right away!

Hi,
Did you haver sorted this out?
I also have the same 10s refesh. This is fine for me but I’m not sure if this is really just a display isseu or if the stream is from BI to HA is really affected.
I’m trying to set up Deepstack in HA, and not sure if the stream coming from BI is ok.
Thanks

The live view of picture-entity seems to have a 7-12 second delay from real-live. I am also using Blue Iris and it doesn’t seem to be an issue on the Blue Iris side… seems like buffering on the HA / picture-entity side before the video stream is displayed on browser.

With camer-view set to auto, it refreshes a static image every 10 seconds. When the image is refreshed, it seems to be current (no more then 1 second lag). I would like to see where the 10 seconds refresh comes from… seems like its not configurable in yaml, but would like to find the code in HA for this. Anyone know where this is (i.e., a github link to the picture-entity code where the 10 second refresh is coded)?

1 Like

FYI, I found the 10 second refresh rate in the code:

1 Like

I have this same ~10 sec delay with the unifi protect integration.

Would be awesome to eliminate it.

Do we open an issue? Or where do we go from here? Would be great if 1) it could be variable or 2) a much lower number like 1 sec.

I opened a PR: https://github.com/home-assistant/frontend/pull/5466

FYI, this is for refresh rate of static image – the “live” stream issue is a different issue.

Yeah… better than nothing, though. :). (It’s a start.)

This isn’t an “error” this a limitation of the picture-entity card and is by design. I don’t remember the details as I read it a while ago but it was something to do with using too many resources while “idle” and that is why it is only a live steam when you click on it and open it.

Depending on your requirements you can use this custom card.

1 Like

This would make a great addition to HACS :slight_smile: will be trying it myself and see how that goes.

It maybe in HACS, I do have it but I think the author removed.
When I go to it in HACS it shows “Repository is in the blacklist.”

indeed a few weeks ago it was available on HACS, but i think because this custom card was updated 2 years ago it’s blacklisted