Lovelace - Markdown card - sensor won't show its state


trying to migrate this regular HA card with sensor:

    name: Logtail
    icon: mdi:library-books
      - sensor.log_tail

to Lovelace

  - type: entities
    title: Logtail
      - sensor.log_tail


  - type: custom:useful-markdown-card
    content: >
       [[ sensor.log_tail ]]


  - type: markdown
    content: >
       [[ sensor.log_tail ]]

the entities card shows correctly but the markdown card errors:



  - type: custom:useful-markdown-card
    content: >
       [[ states.sensor.log_tail.state ]]



while dev-state is showing as it should:

what should I change to get this showing correctly?

this is the sensor definition:

  - platform: file
    file_path: /config/home-assistant.log
    name: Log tail

From the other thread about this, shouldn’t it be:

  - type: custom:useful-markdown-card
    content: >
       [[ sensor.log_tail.state ]]

Notice the word state after your entity_id and the lack of the word states before.

Exact same issue you had here:

The key being

No, that’s what I tried of course, but it shows:


should have mentioned that, sorry

in the custom:useful-markdown-card? That doesn’t make sense.

it doesn’t, and it didn’t… I tried all combinations both with the custom card or the regular markdown. Except for this:

  - type: custom:useful-markdown-card
    title: Logtail
    content: >
       [[ sensor.log_tail.state ]]

et voilà:

thank you…

weather coordinates? That’s odd… You may have found an issue with the custom card.

EDIT: Nevermind, you’re saying it works.

the card now shows my log. that works.

the OWM component doesn’t :wink:

not familiar with that.

with the built in Markdown card the following worked for me:

type: markdown
content: |
  {{ states('sensor.log_tail') }}

Ispired by this post.


This whole thread was using the custom:markdown card prior to the existence of Jinja templates in the built in markdown card.

What’s your point?

That you revived an old outdated thread.

1 Like

Old != Outdated.

it is when the main topic at hand is about the useful-markdown-card which is deprecated

Which it wasnt (exclusively). Discussion Done.

Deleting the post doesn’t mean I agree with you.