piitaya / lovelace-mushroom

Build a beautiful Home Assistant dashboard easily

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Templates not rendering in 2022.6

totalitarian opened this issue · comments

Current Behavior

Normally this code would render state values

        - type: custom:mushroom-template-card
          style: |
            ha-card {
                --icon-symbol-size: 1.25em;
                --card-mod-icon-color: rgb(33, 150, 243); 
            }
          primary: '[[name]]'
          secondary: |-
            ㅤ {% if states('[[temperature-chip]]') | float > 0 %} 
                  {{ states('[[temperature-chip]]')  | round(0)}} °C {% endif %}  
                {% if states('[[humidity-chip]]') | float > 0 %}
                  ㅤ{{ states('[[humidity-chip]]') | round(0) }} % 
              {% endif %} ㅤ
          icon: mdi:[[main-icon]]

Expected Behavior

Rendering the value

Steps To Reproduce

No response

Environment

No response

Anything else?

But now it just renders the code. Any idea why?
image

What is this syntax [[""]]? Is it from another plugin ? Mushroom use HA template and this syntax is not supported by default.

What is this syntax [[""]]? Is it from another plugin ? Mushroom use HA template and this syntax is not supported by default.

It's from the decluttering card here

https://github.com/custom-cards/decluttering-card

Normally works just fine

I think it's linked to this : home-assistant/core#71687. You should specify a default value for float.

That worked, many thanks!

            ㅤ {% if states('[[temperature-chip]]') | float(0) > 0 %} 
                  {{ states('[[temperature-chip]]')  | round(0)}} °C 
              {% endif %}  
                {% if states('[[humidity-chip]]') | float(0) > 0 %}
                  ㅤ{{ states('[[humidity-chip]]') | round(0) }} % 
              {% endif %} ㅤ