question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Please help with defining a !include

See original GitHub issue

My Home Assistant version: 2021.11.5

Layout-card version 2.3.1

What I am doing: Trying to create a sidebar using This Method

What I expected to happen:

A sidebar should appear on my dashboard

What happened instead: I’m getting a error saying "/config/yamldash2.yaml", line 24, column 9: Unable to read file /lovelace/components/sidebar.yaml. I have added the sidebar.yaml file into the config/lovelace/components folder i have tried various folder locations and paths now but it’s not picking up the sidebar.yaml file at all. Thanks

Minimal steps to reproduce: Use this code in a yaml dashboard

path: test
title: Test
cards:
  - type: custom:layout-card
    layout_type: custom:grid-layout
    layout:
      grid-template-columns: 20% 30px auto
      grid-template-rows: auto
      grid-template-areas: |
        "sidebar . main"
      mediaquery:
        "(max-width: 600px)":
          grid-template-columns: 100%
          grid-template-areas: |
            "sidebar"
            "main"
        "(max-width: 800px)":
          grid-template-columns: 50% 50%
          grid-template-areas: |
            "sidebar"
            "main"
    cards:
      - !include /lovelace/components/sidebar.yaml
      - type: entities
        entities:
          - light.bedroom
        title: Bedroom
        view_layout:
          grid-area: main

End of code


Error messages from the browser console:

---

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

- [] Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).
- [] Have made sure I am using the latest version of the plugin.
- [] Have followed the troubleshooting steps of the "Common Problems" section of https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins.
- [] 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.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
steveuk23commented, Dec 6, 2021

I don’t believe that /lovelace is a special alias that HomeAssistant knows anything about. You should use the full path instead:

cards:
  - !include /config/lovelace/components/sidebar.yaml
  ...

Thanks for the reply. I was just coming on here to edit this as I changed it to your suggestion and it picks it up fine now. The code above with the sidebar code is meant to show a “sidebar” in home assistant but it’s not doing, but I’ve asked the original creator on that other page so hopefully he can advise. Unless you can see where I’ve gone wrong. Cheers

0reactions
thomaslovencommented, Feb 21, 2022

This is not a layout-card issue unless the exact same line works outside of layout-card.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Writing Definitions - Purdue OWL
A formal definition is based upon a concise, logical pattern that includes as much information as it can within a minimum amount of...
Read more >
Include Definition & Meaning
include suggests the containment of something as a constituent, component, or subordinate part of a larger whole.
Read more >
Include definition and meaning | Collins English Dictionary
1. to shut up or in; enclose ; 2. to have as part of a whole; contain; comprise. the cost includes taxes ;...
Read more >
INCLUDE | definition in the Cambridge English Dictionary
to contain something as a part of something else, or to make something part of something else: The check includes tax and service....
Read more >
Define and solve a problem by using Solver
Define and solve a problem by using Solver ... Solver is a Microsoft Excel add-in program you can use for what-if analysis. Use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found