Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

In HA 2023.12.1 card showing camera image is not working #25

Closed
majkers opened this issue Dec 11, 2023 · 12 comments
Closed

In HA 2023.12.1 card showing camera image is not working #25

majkers opened this issue Dec 11, 2023 · 12 comments

Comments

@majkers
Copy link

majkers commented Dec 11, 2023

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

@PiotrMachowski
Copy link
Owner

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

@majkers
Copy link
Author

majkers commented Dec 12, 2023

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.

@PiotrMachowski
Copy link
Owner

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

@majkers
Copy link
Author

majkers commented Dec 12, 2023

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

@PiotrMachowski
Copy link
Owner

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?

@majkers
Copy link
Author

majkers commented Dec 13, 2023

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
Copy link
Author

majkers commented Jan 3, 2024

@PiotrMachowski any idea what might cause the problem?

@PiotrMachowski
Copy link
Owner

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

@dafunkydan
Copy link

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 :(

@jordandrako
Copy link

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
       ...

@majkers
Copy link
Author

majkers commented Feb 28, 2024

Thanks @jordandrako it is working for me too

@PiotrMachowski
Copy link
Owner

Fixed in v2.1.1

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants