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

HI,

trying to migrate this regular HA card with sensor:

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

to Lovelace

  - type: entities
    title: Logtail
    entities:
      - sensor.log_tail

and/or

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

or:

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

the entities card shows correctly but the markdown card errors:

07

using:

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

gives:

02

while dev-state is showing as it should:

what should I change to get this showing correctly?

this is the sensor definition:

# https://home-assistant.io/components/sensor.file/
  - 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:

58

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à:
24

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.

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

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

Ispired by this post.

2 Likes

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.