0.90.0: Streaming camera in lovelace?

How do I add the cool streaming camera to lovelace? It is HIKVISION camera.

I have changed the camera config from:

ffmpeg:
ffmpeg_bin: /usr/bin/ffmpeg
camera:

  • platform: ffmpeg
    name: Outside
    input: rtsp://user:password@IP:554/Streaming/Channels/2

to

stream:
camera:

When I go to Developer tool States and open more info it streams fine. But I can’t get it to show in lovelace.

In ui-lovelace I have:

  - type: picture-elements
    image: /local/black.png
    elements:
      - type: image
        entity: camera.outside
        camera_image: camera.outside
        style:
          top: 50%
          left: 50%
          width: 100%

It does not show the video (when I click on it, it opens more info and plays fine).

1 Like
i use this picture-entity card:
     - type: horizontal-stack
        cards:
          - type: custom:card-modder
            style:
              border-radius: 20px
              overflow: hidden
              box-shadow: '2px 2px rgba(0,0,0,0.4)'
              border: 'solid 1px rgba(100,100,100,0.3)'
            card:
              type: picture-entity
              entity: camera.living_room
              show_name: false
              show_state: false

Ok, probably an issue with the camera configuration. It shows the same:


Any clue how to configure the HIKVISION camera? It worked ok through ffmpeg (other than the frame rate).

according to the documentation, it should look like this:

# Example configuration.yaml entry
switch:
  - platform: hikvisioncam
    host: 192.168.1.32

find your camera in this list to see what configuration to use: Stream Component: Confirmed Cameras and Configurations

anyone got wyze cams yet?

We still show the still image in the Lovelace frontend for now. Nobody has developed a video Lovelace card at this time. You must go to more info panel to see the stream.

1 Like

Thanks @dshokouhi, I did configure it according to it, same issue (my config was basically the same before, only had extra parameters in teh stream, I guess this was not the issue.
It shows gray rectangle in lovelace. I now understand from @hunterjm that I won’t get a stream, but I was hoping for at least an ever so changin image like I had before.

Anyhow, went back to ffmpeg, do not see any benfit for the stream feature in this scenario. Pity, it got me quite excited.

You will see an image that changes every 10 seconds in Lovelace if you have configured the still image url correctly. If you see a broken image or grey rectangle in the frontend, your configuration is not correct. Try to google how to get a snapshot for your particular model of camera, the ISAPI url works great for my HikVision cameras.

same here and I just want to say a huge thank you for Stream… It works flawlessly for me and my HikVision cameras. Just playing with it and someone presses the doorbell… Philips TV works as a media player, so no matter what is showing, kodi, chromecast, tivo, it then switches to the stream from the front door… Now I need to work out how I pause what is playing and switch back after 30 seconds…

This is true genius and the part that has been missing from HA.

Found a working config for Hikvision at the end. The info on https://community.home-assistant.io/t/stream-component-confirmed-cameras-and-configurations/106729 did not work for me.
I have removed the username and password from the link, added as parameters and added authentication: digest.

camera:
  - platform: generic
    name: Outside
    still_image_url: "http://<IP>/ISAPI/Streaming/channels/101/picture"
    stream_source: "rtsp://<username>:<password>@<IP>:554"
    username: "<username>"
    password: "<password>"
    authentication: digest
1 Like

On my TV that can be done with media_player.turn_off service call after a delay action in the automation.

May I ask how you were you able to accomplish this without casting it?

like this… my philips tv is a media player in HA

- alias: Doorbell_test
  initial_state: 'on'
  trigger:
    platform: event
    event_type: xiaomi_aqara.click
    event_data:
      entity_id: binary_sensor.switch_158d0001a668c0
      click_type: single
  action:
    - service: camera.play_stream
      data:
        entity_id: camera.front_garden_stream
        media_player: media_player.43pus7303_12
1 Like

Thanks!! just learned something new.

1 Like

Hello @MarkR,
Any idea what are the media_players which are compatible with that? Just tested enigma ones (a Vu Zero device) and it is not compatible. I have a NotImplementedError.

Thanks.

not a clue… I tried Chromecast and Kodi and neither worked… then I tried my philips tv and it worked a treat… sorry that is of no help at all…

@hunterjm do you have a list please?

Samsung TV K5500 model not working with that, I have a ERROR (MainThread) [homeassistant.components.media_player.samsungtv] Unsupported media type message.

Actually this is a myth… You can actually get a stream using the camera_view: live option

Eg:

type: picture-glance
camera_image: camera.outside
camera_view: live
title: Outside
entities:
  - switch.garden

( @bruxy70 )

1 Like

Yes, I have it configured that way (except it is a picture-element type image).
And you are right, it is not a static image, but I would not call it stream either - I get 1 frame per 10 seconds.