lovelace-layout-card icon indicating copy to clipboard operation
lovelace-layout-card copied to clipboard

No Elements when casting via cast.show_lovelace_view with custom:grid-layout

Open kleinerhobbit opened this issue 3 years ago • 15 comments
trafficstars

My Home Assistant version: 2022.8.7

Layout-card version (FROM BROWSER CONSOLE): 2.4.2

What I am doing: try to cast a dashboard to google-hub

What I expected to happen: show dashboard like in chrome-browser on my pc

What happened instead: only background image gets displayed. no enities and no informations.

Minimal steps to reproduce:

views:
  - path: grid
    title: Grid layout
    type: custom:grid-layout
    layout:
      grid-template-columns: auto 30px 25%
      grid-template-rows: auto
      grid-template-areas: |
        "header header header"
        "main . sidebar"
        "footer footer footer"
    cards:
      - type: entities
        entities:
          - entity: light.bed_light
        title: '1'
        show_header_toggle: false
        view_layout:
          grid-area: header

Error messages from the browser console: unable to get


By putting an X in the boxes ([X]) below, I indicate that I:

  • [x] Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).
  • [x] Have made sure I am using the latest version of the plugin.
  • [x] Have followed the troubleshooting steps of the "Common Problems" section of https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins.
  • [x] Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.

kleinerhobbit avatar Sep 05 '22 14:09 kleinerhobbit

I have the same issue here, tried different layout nothing work outside of masonry default layout..

arsenicks avatar Oct 06 '22 15:10 arsenicks

@kleinerhobbit you can try this, it seems to help, I've found this in an old version of the README file.

Note for Home Assistant Cast users

Layout-card doesn't entirely work with Cast at this time. Specifically, the view may or may not load in if you start a Cast directly to a view which uses layout-card.

If you instead load a different view, and then switch to the one using layout-card, things seem to be working better. I hope to be able to fix this soon.

arsenicks avatar Oct 07 '22 15:10 arsenicks

@arsenicks I'm seeing the same issue. Is there a way to programmatically switch the layout?

no2chem avatar Oct 11 '22 04:10 no2chem

What I'm doing right now is something like that in my automation and so far so good. It's been running for 2 days and seems to work.

Note: My default_view use masonry default..

action:
  - service: cast.show_lovelace_view
    data:
      entity_id: media_player.cast_salon_haut
      dashboard_path: lovelace
      view_path: default_view
  - delay:
      hours: 0
      minutes: 0
      seconds: 15
      milliseconds: 0
  - service: cast.show_lovelace_view
    data:
      entity_id: media_player.cast_salon_haut
      dashboard_path: lovelace
      view_path: cast_rss_feed

arsenicks avatar Oct 11 '22 13:10 arsenicks

Yeah, this seems to work, but it takes too long for it to switch. The 15 seconds appears to be really necessary!

I think this is probably a bug in homeassistant somewhere though. I've tried to set pychromecast up for debug but no success so far

no2chem avatar Oct 12 '22 15:10 no2chem

I think this is probably a bug in homeassistant somewhere though. I've tried to set pychromecast up for debug but no success so far

Let us know if you find something. Casting using a default layout works well, I think it's known casting could have problem with some custom component and custom layout. As it was stated in the old version of the readme but was removed later so I guess some fixes has been made inbetween.. Let's wait for some input from dev's, at least there's a workaround :P

arsenicks avatar Oct 13 '22 15:10 arsenicks

Hi all

Sorry for the late reply. Was in holiday. Will try the workaround with masonry-view asap.

Other interesting thing. The casting of the view is working fine all the time with catt. But there is the problem with the 10min timeout.

Cheers

kleinerhobbit avatar Oct 13 '22 16:10 kleinerhobbit

Just chiming in - cycling the dashboards worked for me as well. Thanks for the tip! Annoying - but hey at least it works 😄

nebriv avatar Feb 03 '23 00:02 nebriv

Just want to provide some debug information on this issue: when this happens, the page has:

<hui-error-card style="display: none;"></hui-error-card>

and inside its shadow root is

<ha-alert alert-type="error"> <!--?lit$2959686161$--><pre><!--?lit$2959686161$-->...</pre> </ha-alert>

where those ... is the YAML of the dashboard.

chiahsing avatar May 13 '23 06:05 chiahsing

I have the same issue. I'm using the workaround for now. Will there be a fix soon?

jurrianv avatar Aug 03 '23 10:08 jurrianv

Same issue here, any fix planned?

radinsky avatar Sep 22 '23 08:09 radinsky

Same issue here

tomahawk793 avatar Oct 06 '23 01:10 tomahawk793

Any update? I have the same issue

imdeepjee avatar Jan 25 '24 21:01 imdeepjee

Just ran into this issue today when trying to use layout-card to fix the dashboard when casting to a big tv. Does this happen for everyone?

chrisdrumz avatar Apr 08 '24 00:04 chrisdrumz

I'm not sure if this is exactly the same thing or not. I also have issues rendering grid with cast. But, only my larger of 2 views. The smaller view that only has a few cards works. So, I started removing card from the broken view and if I remove enough it works. What I see is that with:

  grid-template-columns: repeat(4, 1fr)
  grid-template-rows: auto

and showing 4 gauge cards for the 1st row, the 4th card flows down to the 1st column of the 2nd row (I can't make this happen on a local browser). Then, with enough cards there is not enough room and nothing renders.

shettich avatar Apr 20 '24 16:04 shettich