Lovelace markdown card with template variables

Yeah I figured that after I wrote it.

Yeah I just ignore those messages.

Did you try:

type: markdown
content: |2-
   {% for state in states.sensor %}
     {{ state.entity_id }}={{ state.state }},
   {% endfor %}
title: Test

It’s what the UI editor generates.

1 Like

Haha…I try but…its hard!

Tried this…

      - type: markdown
        content: |2-
           {% for state in states.sensor %}
             {{ state.entity_id }}={{ state.state }},
           {% endfor %}
        title: Test

No change.
What does the

do?

I have no idea. :thinking:

1 Like

Yes…thats the point I reached…pretty convinced its a problem with my installation config. Others can get it to work…just not me.

@tom_l An update…recently updated to 0.101.3 and just revisited the Markdown issue I was having…

I can now confirm with nothing (of consequence…some text yes) changed in my config and retest the same Markdown Card:

  - title: Makdown
    cards:
      - type: markdown
        title: Template Example
        content: >
          ## Sensor States       
          
          Test template value example which does not execute in HA 0.94.0

          Now using HA 0.101.3....


          {% for state in states.sensor %}
            {{ state.entity_id }}={{ state.state }},
          {% endfor %}

Cheers to all who assisted me with this issue!

I am calling this solved with the issue being a problem in HA 0.94.0

2 Likes

I wonder when this was introduced. I’ve just had it with 0.96.0. I updated to 0.102.3 and it no longer displays the code within the markup dialog. I now have the problem that the code doesn’t actually work, but that’s for later… !

1 Like

Did you test your code works in the template editor?

Nope. That’s for later!

Cool…I have found that if it works in the template editor now it will work on the markdown card.

1 Like