Lovelace cards size - columns

Hello. I have several cards. custom:button-card, custom:weather-card and gauge. All are visible in single column.

How to get the goal to have 2 columns. Button in one (or 50% page width). Gauge in second (or 50% page width). And weather under them wide (both 2 columns or 100% page width). How to prepare it? Thanks.

Untitled%20Diagram

GNU nano 2.7.4 File: /home/homeassistant/.homeassistant/ui-lovelace.yaml

cards:
  - id: 7f854071c9054131b0a07602572b49ec  # Automatically created id
    type: custom:button-card
    entity: switch.pump
    icon: mdi:sofa
    color: auto
    action: toggle
    default_color: rgb(255, 233, 155)
    color_type: card
    name: Heating
    style:
      - font-size: 12px
      - font-weight: bold
  - id: e780c04e491b4050a2745e0346aab069  # Automatically created id
    type: gauge
    title: Temperature
    unit_of_measurement: °C
    entity: sensor.temperature
    severity:
      blue: 0
      yellow: 45
      red: 90
  - id: f84a9a7f674c4ee183d3745f056affb5  # Automatically created id
    type: custom:weather-card
    entity_weather: weather.yweather
    entity_sun: sun.sun
cards:
  - type: vertical-stack
    cards:
      - type: horizontal-stack
        cards:
          - type: custom:button-card
          - type: gauge
      - type: type: custom:weather-card

You’ll need to put all your customization you posted, the yaml I posted will not work and requires real configurations. These are the cards:

1 Like

Well I know about those stacks. I tried them without succes.
But how to use them?
Are You sure You need whole config? There must must be some Common code sample to get what I need.

And there Is also problem that everything is in single column centered on the page. There is plenty of space on both sides.

LIke what Petro said, you need to use a combination of vertical and horizontal stack cards. Look at this example to help, specifically the ‘combination of both’ section:

https://home-assistant-lovelace-gallery.netlify.com/#demo-hui-stack-card

Best way to learn is to do it yourself. To utilize all the space in the UI instead of one column, you use ‘panel: true’ and then a combination of horizontal and vertical stacks. Here is my example, which has some comments that may help you to visualize what each stack is doing:

  - icon: mdi:home
    title: Home 
    id: home
    panel: true
    cards:
      - type: horizontal-stack # forces everything to fit in one row
        cards:
          - type: vertical-stack # column 1
            cards:
              - type: custom:quote-day                
                entity: sensor.quote_of_the_day
          - type: vertical-stack # column 2
            cards:
              - type: weather-forecast
                title: Forecast
                entity: weather.yweather    
          - type: vertical-stack # column 3
            cards:          
              - type: picture-entity
                entity: camera.traffic_map
                image: http://link.here
                show_name: false
                show_state: false
# Media Players (only show up when playing a video/music)
              - type: conditional
                conditions:
                  - entity: media_player.tv
                    state_not: "off"
                card:
                  type: media-control
                  entity: media_player.tv

This is the result.

6 Likes

Seems promising. Will try it. Thank you.

Nothing promising about it, It will work. Here’s an almost identical solution that I’m using. Only difference is that I’m using a custom vertical stack card that attempts to remove card borders to make it look like a large card.

Capture

      - id: 05d75ee28a514ef88ac9888bd3e96650  # Automatically created id
        type: custom:vertical-stack-in-card
        title: Kitchen
        cards:
          - type: entity-button
            entity: switch.kitchen_pantry
            name: Pantry
            tap_action: toggle
            hold_action: more-info
          - type: horizontal-stack
            cards:
              - type: entity-button
                entity: light.kitchen_cans
                name: Cans
                tap_action: toggle
                hold_action: more-info
              - type: entity-button
                entity: light.kitchen_island
                name: Island
                tap_action: toggle
                hold_action: more-info
          - type: horizontal-stack
            cards:
              - type: entity-button
                entity: switch.kitchen_cabinet
                name: Under Cabinet
                tap_action: toggle
                hold_action: more-info
              - type: entity-button
                entity: switch.kitchen_holiday
                name: Above Cabinet
                tap_action: toggle
                hold_action: more-info

In the view configuration, you have to set the ‘panel: true’ option so that it fits all the screen.

- title: Technique
  panel: true
  cards:
  - type: vertical-stack
    cards:
    - type: glance
      title: Etats

With panel: true

Without panel: true

4 Likes

This is awesome! Note that doing it this way prevents you from using any badges in that View.

how do you set panel using the UI?

Found it, have to go into raw config mode

Hello
1st of all great work !
i tried to implement but i have some things i am not beeing able to manage

so:
1 - clicking the buttons does not make anything
2 - is it possible to take of the frames ?

thank you in advance
below code and image
!

panel: true
type: vertical-stack
title: Kitchen
cards:
  - type: entity-button
    entity: light.luz_sala_de_estar
    name: All living room lights
    tap_action: toggle
    hold_action: more-info
  - type: horizontal-stack
    cards:
      - type: entity-button
        entity: light.luz_sala_de_estar
        name: Sala de estar
        icon: 'mdi:ceiling-light'
        tap_action: toggle
        hold_action: more-info
      - type: entity-button
        entity: light.yeelight_color2_04cf8c842ee1
        name: Ambilight TV
        mdi: television-box
        tap_action: toggle
        hold_action: more-info
      - type: entity-button
        entity: light.luz_led_exterior
        name: Led Exterior
        icon: 'mdi:led-on'
        tap_action: toggle
        hold_action: more-info
      - type: entity-button
        entity: light.luz_hall
        name: Hall entrada
        tap_action: toggle
        hold_action: more-info
  - type: horizontal-stack
    cards:
      - type: entity-button
        entity: light.yeelight_color1_04cf8c9557ff
        name: Candeeiro Pé
        tap_action: toggle
        hold_action: more-info
      - type: entity-button
        entity: light.luz_philips_xiaomi
        name: Candeeiro aparador
        tap_action: toggle
        hold_action: more-info

I think you need to work on translating this better. No clue what you are saying here.

Yes, but you need to implement card-modder

the style to remove frame (just the shadow) is:

    --ha-card-box-shadow: 'none'

to remove the frame and the card background:

    --ha-card-background: "rgba(0, 0, 0, 0.0)"
    --ha-card-box-shadow: 'none'

You probably want the 2nd one for the style.

thanks ! and i add the code on the custom card?

Yes, it goes in the style section of the cardmodder configuration

well i dont have card-modder installer… i will install it then

i get this error:
Custom element doesn’t exist: vertical-stack-in-card.

:frowning:

are you using that card? If so, you need that custom card too.

well let me explain
i have made the card as the photo i showed on top…but without card-modder…
just with vertical and horizontal stack…but i want to remove the frames so i installed card-modder and card-tools…but gives me the error

Ok Finally made it !
the card is configured and no erros, but unfortunelly when clicking nothing happens.
can someone please help me?

code:

type: 'custom:vertical-stack-in-card'
title: Sala
panel: true
cards:
  - type: entity-button
    entity: switch.luz_cozinha
    name: cozinha
    tap_action: toggle
    hold_action: more-info
  - type: horizontal-stack
    cards:
      - type: entity-button
        entity: light.luz_sala_de_estar
        hold_action: more-info
        icon: 'mdi:ceiling-light'
        name: Sala de estar
        tap_action: toggle
      - type: entity-button
        entity: light.luz_sala_de_jantar
        hold_action: more-info
        name: Sala de Jantar
        tap_action: toggle
      - type: entity-button
        entity: light.yeelight_color2_04cf8c842ee1
        hold_action: more-info
        mdi: television-box
        name: Ambilight TV
        tap_action: toggle
      - type: entity-button
        entity: light.luz_led_exterior
        hold_action: more-info
        icon: 'mdi:led-on'
        name: Led Exterior
        tap_action: toggle
      - type: entity-button
        entity: light.luz_hall
        hold_action: more-info
        name: Hall entrada
        tap_action: toggle

hi. can someone please help?