Lovelace dashboards with template support for better managment of cards and reduce duplications

Hello,

While i like the simplicity for creating dashboards in the front-end i noticed that config files were getting huge and hard to maintain.

I couldn’t find anything that would solve those problems so i decided to created an integration that makes it possible to use templating in your dashboard config. This will reduce duplicate cards with macros and will create a more dynamic way of configuring cards in your view.

It has full access to the templating environment but state etc. will only be validated on parsing/creating and not dynamically updated.

As mentioned you can define some dashboard scoped config in the root of your lovelace config which makes it possible to define variables, macros or templates.

A quick example to show case this:

lovelace_extend:
  vars:
    entities: "{{ get_device_entities_from_device('sensor.sun_next_dawn') }}"
    
  macros:
    get_device_entities_from_device:
        args: id
        content: "{{ device_entities(device_id(id)) }}"
          
views:
  - type: panel
    title: Dashboard
    cards:
      - type: entities
        entities: "{{ entities }}"

Which should create a dashboard like this

image

More info about installing, configure or usage check my repository

If you run into any issues or have any feedback, feel free to let me know.