Home-Assistant-Lovelace-Local-Conditional-card icon indicating copy to clipboard operation
Home-Assistant-Lovelace-Local-Conditional-card copied to clipboard

In HA 2023.12.1 card showing camera image is not working

Open majkers opened this issue 1 year ago • 11 comments

Hello, I have a vertical stack card with 'Live' button at the top to conditionally display custom:webrtc-camera card or picture-entity card. After upgrading to 2023.12.1 I've noticed that only custom:webrtc-camera is working now.

My card looks more or leass like that:

type: vertical-stack       
cards:
  - show_name: true
    show_icon: false
    name: Widok live
    type: button
    tap_action:
      action: fire-dom-event
      local_conditional_card:
        action: toggle
        ids:
          - front_live
          - front_static
    icon: mdi:video-switch
  - type: custom:local-conditional-card
    default: hide
    id: front_live
    card:
      type: custom:webrtc-camera
      url: front_camera_stream
      title: Front
      poster: https://home-assistant.io/images/cast/splash.png
      intersection: 0.75
      mode: webrtc,mse,mp4,mjpeg
      muted: true
  - type: custom:local-conditional-card
    default: show
    id: front_static
    card:
      camera_image: camera.front
      camera_view: auto
      image: >-
        http://XXX
      entity: camera.front
      name: Front
      show_state: false
      type: picture-entity

It was working ok in HA 2023.11.x and before. Picture-entity card taken away for conditional card is working OK

majkers avatar Dec 11 '23 21:12 majkers

Do you have a picture elements card somewhere else in the view? Can you try following config? (it consists of 2 cards)

 -  camera_image: camera.front
    camera_view: auto
    image: >-
      http://XXX
    entity: camera.front
    name: Front
    show_state: false
    type: picture-entity

 -  type: vertical-stack       
    cards:
      - show_name: true
        show_icon: false
        name: Widok live
        type: button
        tap_action:
          action: fire-dom-event
          local_conditional_card:
            action: toggle
            ids:
              - front_live
              - front_static
        icon: mdi:video-switch
      - type: custom:local-conditional-card
        default: hide
        id: front_live
        card:
          type: custom:webrtc-camera
          url: front_camera_stream
          title: Front
          poster: https://home-assistant.io/images/cast/splash.png
          intersection: 0.75
          mode: webrtc,mse,mp4,mjpeg
          muted: true
      - type: custom:local-conditional-card
        default: show
        id: front_static
        card:
          camera_image: camera.front
          camera_view: auto
          image: >-
            http://XXX
          entity: camera.front
          name: Front
          show_state: false
          type: picture-entity

PiotrMachowski avatar Dec 11 '23 22:12 PiotrMachowski

Jus like I mentioned in my issue, I've already tried that and it is working. Picture entity card is working OK when taken away from conditional card. It also doesn't matter if this card is hidden or shown by default.

majkers avatar Dec 12 '23 06:12 majkers

The purpose of my check is different - it makes sure that picture-elements card is loaded from the cache

PiotrMachowski avatar Dec 12 '23 10:12 PiotrMachowski

To be clear.It is picture entity card not picture elements.

majkers avatar Dec 12 '23 14:12 majkers

You are right, apparently I was still partially sleeping. Nevertheless, does it work in the local conditional card when picture entity card is also added directly?

PiotrMachowski avatar Dec 12 '23 15:12 PiotrMachowski

I did what You asked me for and the result is that picture-entity card added somewhere else in my dashboard works but the one in local conditional card is not :(

majkers avatar Dec 13 '23 07:12 majkers

@PiotrMachowski any idea what might cause the problem?

majkers avatar Jan 03 '24 09:01 majkers

Unfortunately I haven't found any solution so far :(

PiotrMachowski avatar Jan 03 '24 09:01 PiotrMachowski

picture-entity card added somewhere else in my dashboard works but the one in local conditional card is not :(

I thought i am smart by using Custom Button Card to display an Image - Unfortunatly, same goes for Custom Button Card containing an Image. Doesn't get displayed. When the Image is removed from the Button Card, it gets displayed again :(

dafunkydan avatar Jan 26 '24 13:01 dafunkydan

Try wrapping your card in a grid card, that fixed it for me when using cards the local condition card wouldn't render, like vertical-stack or frigate card.

type: custom:local-conditional-card
id: your-id
default: show
card:
  type: grid
  columns: 1
  square: false
  cards:
    - type: picture-entity
       ...

jordandrako avatar Feb 27 '24 20:02 jordandrako

Thanks @jordandrako it is working for me too

majkers avatar Feb 28 '24 07:02 majkers