Lovelace: Entity Markdown card

** Update: Replaced inline Javascript with link to repo and added better example. **
Here is a custom card I have created which is basically a wrapper around the markdown card, which picks up the content from the state of an entity. This makes it easy to have dynamic formatted text in any view.

Example usage

resources:
  - url: /local/entity-markdown.js
    type: js

views:
  - title: Home
  - id: home
    cards:
      - type: custom:entity-markdown
        id: markdown-example
        title: Markdown Sample
        entity: sensor.markdown_test

This uses a template sensor defined like this in configuration.yaml:

sensors:
  - platform: template
    sensors:
      markdown_test:
        friendly_name: Markdown Test
        value_template: |
          This is **some text** which is *formatted using* [Markdown](https://en.wikipedia.org/wiki/Markdown)
          This supports
          multiple lines
          > Some quoted text here.

example

This card should also work as a custom card in cards like entity-filter.

3 Likes

When you get a chance, I think all of us who aren’t yet able to visualize JS code would benefit from a visual sample. :slight_smile:

I’ve updated the original post now to link to my GitHub repo and include a better example with an image.

thank you so much ! Exactly what I was looking for to redirect to a link sensor .

I hope this is still an active project.

Do you think there is any chance of integrating Mermaid with this?
Mermaid is an extension of markdown that allows you to do call flows and other cool diagrams.

That means Home Assisters would be able to create live network diagrams!

1 Like