thomasloven / lovelace-auto-entities

🔹Automatically populate the entities-list of lovelace cards
MIT License
1.24k stars 113 forks source link

Access to variables in template? #265

Closed Inrego closed 1 year ago

Inrego commented 2 years ago

Hi. What variables are available in template? I'm trying to use the user variable, to match by user id, but seems like it's not available.

Here's a very simplified example of what I'm trying to achieve:

type: custom:auto-entities
filter:
  template: |
    {% set id = 'input_select.dashboard_1_' ~ user.id %}
    {% set ids = [id] %}
    {% for select_id in ids %}
      {{ select_id }}
    {% endfor %}
card:
  type: entities
thomasloven commented 1 year ago

config and user as usual https://www.home-assistant.io/dashboards/markdown/#template-variables