thomasloven / hass-lovelace_gen

🔹 Improve the lovelace yaml parser for Home Assistant
MIT License
209 stars 22 forks source link

Variable in RAW block #50

Closed Schrolli91 closed 1 year ago

Schrolli91 commented 1 year ago

How can is use the include variables inside a raw block?

card_mod:
   style: |
     ha-card {
      {%raw%}
      {% if is_state('{{main_light_entity}}', 'on') %}
        background: rgba(255, 152, 0, 0.1);
      {% endif %} 
      {%endraw%}
     }

This will only shown correctly, if i hardcode the specific entitity.

thomasloven commented 1 year ago

You can't. That's the point of raw blocks.

{%endraw%}{{main_light_entity}}{%raw%}