Lovelace markdown from external file

Is it possible to load Lovelace Markdown card contents from an external file?
I’d be generating this file dynamically.

At the moment I use iFrame and html but the content can have different length and it doesn’t play well with the iFrame aspect ratio property.

I don’t think there is a built in way. You may have to make a custom card to handle it, along with a custom component to make the file.

1 Like

This worked for me. In ui-lovelace.yaml

 - name: Build and Release
  icon: mdi:code-tags-check
  cards:
  - type: picture-entity
    entity: camera.status
  - type: markdown
    title: Build Commit Message
    content: !include markdown.yaml

new file markdown.yaml

>
      **Testing external file**.

Integrated into VSTS Build Pipeline with a bash script

echo ">
  Current Build Number is: $(Build.BuildNumber) 

  Last Commit Message: $(Build.SourceVersionMessage)" > $(Build.ArtifactStagingDirectory)/markdown.yaml

Creates this file markdown.yaml

>
  Current Build Number is: 1.0.483 
  
  Last Commit Message: Updated LoveLace and Markdown YAML widget.

Produces the following output :
snip2

2 Likes

That works brilliantly.

I was able to render HTML table inside Markdown and the caching is not a problem in this case as it was with iFrame.

Thank you!

1 Like

Bear in mind that support for !include in ui-lovelace.yaml will be removed in a future version, see here:

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

Split configuration is currently possible directly in Lovelace, but it is expected to be removed in the near future due to fact that Home Assistant will be writing directly to the ui-lovelace.yaml file.