thomasloven / hass-lovelace_gen

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

[FR] Using templating #5

Closed dwainscheeren closed 4 years ago

dwainscheeren commented 4 years ago

Hi Thomas,

Do you think its possible to tweak this module to also use home assistant templating inside yaml instead of only jinja2 ?

Like doing:

{% for room in states.group.rooms.attributes.entity_id %}
{% set parts = room.split('.') -%}
- title: {{ parts[1] }}
  path: rooms/{{ parts[1] }}
  cards:   
    #Some cards
{% endfor %}

And my groups.yaml :

rooms:
  name: Kamers
  entities:
    - group.living_room

living_room:
  name: woonkamer
  entities: 
    - light.woonkamer_spot_2
thomasloven commented 4 years ago

No. A previous version of lovelace-gen did this, but it was unstable and largely unuseable, because the lovelace configuration is generated once and the states is changed dynamically.

Try auto-entities or something instead.