Lovelace: Horizontal or Vertical Stack breaks the config

Not sure what’s wrong, yamllint pushes the horizontal-stack value to the bottom for reasons I’m unaware of:
Any ideas?

title: My Awesome Home
# Include external resources
resources:
  - url: /local/thermostat-card.js?v=0.5
    type: module
background: center / cover no-repeat url("/background.png") fixed
# Exclude entities from "Unused entities" view
excluded_entities:
  - weblink.router
views:
    # View tab title.
  - title: Location
    background: radial-gradient(crimson, skyblue)
    theme: dark-mode

  - title: Heating and Lighting
  - type: horizontal-stack
    cards:

      - type: glance
        title: At a Glance
        entities:
          - sensor.kitchen_thermostat_temperature
          - sensor.kitchen_thermostat_target
          - sensor.kitchen_thermostat_humidity   
          - light.yeelight_rgb_286c07ae2621
          - light.yeelight_rgb_286c07aeabc2          

      - type: entities
        # Title of the entities card
        title: Lighting

        entities:
          - entity: light.gateway_light_7811dcb24481
            name: Gateway
          - light.yeelight_rgb_286c07ae2621
          - entity: light.yeelight_rgb_286c07aeabc2
            # Override the name to use
            name: Mancave

      - type: custom:thermostat-card
        title: Kitchen
        entity: climate.kitchen 
        
      - type: entities
        # Title of the entities card
        title: Heating

        entities:
          - entity: climate.kitchen
            name: Set Thermostat Temperature

Because your yaml is incorrect.

Your second view (Heating and lighting) has no attributes. You just start listing another view. Views don’t have a type attribute either, so my assumption is that you want your second view to contain a horizontal-stack card.

Take a look at the view documentation:

https://www.home-assistant.io/lovelace/views/

Notice how all view do not list type in configuration variables? Yet right under - title: Heating and Lighting you have a new view (indicated by the - ) with the type property.

this section of your yaml should look like this:

views:
    # View tab title.
  - title: Location
    background: radial-gradient(crimson, skyblue)
    theme: dark-mode

  - title: Heating and Lighting
    cards: #MISSING THIS
      - type: horizontal-stack
        cards:
2 Likes

Ah, thanks, works. That makes sense. I wrongly assumed if I wanted to stack everything within a new view I didn’t need this.

Always follow the yaml in the docs. I would say that I know this stuff pretty well and I always code with the doc’s open. Even when helping here on the forums.

1 Like