Madelena / hass-config-public

My Dashboards for Home Assistant - Advanced data visualizations, responsive design, a neat maximalist Metro Live Tile layout, and an ultraminimal tablet layout!
709 stars 57 forks source link

configuration.yaml #12

Closed BoraSchninsky closed 1 year ago

BoraSchninsky commented 1 year ago

Hi Amazing!

Can you please share your configuration.yaml i am absolutely a beginner

where i must enter

decluttering_templates: !include cards/decluttering_templates.yaml button_card_templates: !include cards/button_card_templates.yaml apexcharts_card_templates: !include cards/apexcharts_card_templates.yaml

and where i must include:

lovelace-dashboards.yaml lovelace-resources.yaml

sorry for that newbie question but yaml not easy

please share your configuration.yaml

zoopster commented 1 year ago

The templates go into the yaml for your dashboard for me it's ui-lovelace.yaml for me it's in the ui subdirectory. The lovelace-*.yaml goes into the config directory. I'd share my configuration.yaml, but it's not a normal one and not relevant to your question, actually.

Madelena commented 1 year ago

Sorry for taking a while to answer this. Life required me to make money to pay rent to have a roof to sleep under. 😥

If you are using UI mode for the Dashboard, !include is not available for use, which means that you will need paste everything in decluttering_templates.yaml, button_card_templates.yaml, and apexcharts_card_templates.yaml over to the Raw Configuration Editor if you want to use any of those templates. For example:

image

Notice the indentation of the contents of apexcharts_card_templates: in the screenshot.

This was how I operated until I switched over to YAML mode about a year ago, when the configuration ballooned to like 14,000+ lines. Obviously, it was not manageable, so I begrudgingly switched over... and thank goodness I did switch over, because otherwise I wouldn't be able to back up and share these codes onto GitHub here with all of you.

So if you are using YAML mode for the Dashboard, in configuration.yaml, I have the following code in that file:

lovelace:
  mode: yaml
  resources: !include lovelace-resources.yaml
  dashboards: !include lovelace-dashboards.yaml

On the same folder as configuration.yaml, I have lovelace-resources.yaml and lovelace-dashboards.yaml.

In lovelace-dashboards.yaml, I have the list of all my dashboards:

ui-dashboard:
  require_admin: false
  show_in_sidebar: true
  icon: mdi:gauge
  title: Dashboard
  filename: ui/ui-lovelace.yaml
  mode: yaml

ui-machines:
...

In lovelace-resources.yaml, I have all the Lovelace Resource URLs, such as:

- url: https://unpkg.com/moment@2.29.3/min/moment.min.js
  type: js
- url: /hacsfiles/lovelace-mushroom/mushroom.js?hacstag=44435037518022
  type: module
- url: /local/metro.css?version=20220902
  type: CSS
...

And then finally, the dashboards are stored under /ui folder, for example, in /ui/ui-lovelace.yaml, I have those lines in it:


title: Dashboard

views:
  - !include views/summary.yaml
...
  - !include views/astrometrics.yaml

decluttering_templates: !include templates/decluttering-card.yaml
button_card_templates: !include_dir_merge_named templates/button-card/
apexcharts_card_templates: !include templates/apexcharts-card.yaml

Hope this helps.