thomasloven / lovelace-layout-card

🔹 Get more control over the placement of lovelace cards.
MIT License
1.05k stars 125 forks source link

grid layout not rendered with cast to nest hub #287

Open jm-cook opened 4 months ago

jm-cook commented 4 months ago

My Home Assistant version: 2024.5.4

Layout-card version (FROM BROWSER CONSOLE): 2.4.5

What I am doing:

Using the cast integration to cast a dashboard to google nest hub

What I expected to happen:

Normally the dashboard is shown on the display of the nest hub

What happened instead:

When using any grid layout there is just a blank screen

Minimal steps to reproduce:

# The least ammount of code possible to reproduce my error
title: Grid cast bug
views:
  - title: bug-repro
    path: repro
    type: custom:grid-layout
    layout:
      grid-template-columns: repeat(3,auto)
      grid-template-rows: auto
      grid-template-areas: |
        "r1c1 r1c2 r1c3"
        "r2c1 r2c2 r2c3"
    cards:
    - type: markdown
      view_layout:
        grid-area: r1c1
      content: '## Placeholder'
    - type: markdown
      view_layout:
        grid-area: r1c2
      content: '## Placeholder'
    - type: markdown
      view_layout:
        grid-area: r1c3
      content: '## Placeholder'`
# End of code

See #285 In my case changing the number of columns does not help. Nothing is displayed.

Error messages from the browser console: None


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

jm-cook commented 4 months ago

Some more information on this!

I was able to get successful rendering to a nest hub using cast when I understood that a grid card should be placed inside a panel desktop. This is explained in the README, but it took me some time to understand that this could be my solution.

There are other reports of cast not working with grid and other layouts in the layout card and this could also be their solution. So arranging the cards like this inside a panel dashboard worked for me:

views:
  - type: panel
    theme: mush_nest_panel
    title: Nest
    cards:
      - type: custom:layout-card
        layout_type: custom:grid-layout
        layout:
          padding: 10px
          grid-template-columns: 2fr 2fr 2fr 4fr
          grid-template-rows: auto auto auto auto
          grid-template-areas: |
            "datearea  datearea  datearea  weather "
            "timearea  timearea  timearea  weather "
            " button1   button2   button3  fan "
            " button4   button5   button6  fan "
        cards:
          - type: custom:mushroom-entity-card
            entity: sensor.fv65_indoor_temperature
            name: Livingroom
            layout: horizontal
            view_layout:
              grid-area: button1
...

So my issue can be closed, but maybe this could be explained better or emphasized as essential for casting.