Hi, hass newb here. I’ve started to configure my new installation and have decided on the “full-control” yaml mode of configuring views in ui-lovelace.yaml
. My question is simple but I haven’t been able to find a solution for it: I want to put the same set of badges on top of all my views. I can already define them using the badges:
list inside a view definition, but I obviously don’t want to repeat them in each of my view. Is that possible?
You can define them in an Anchor and use it in every view.
### YAML Anchor
x-view-badges: &view-badges
- device_tracker.mom
- device_tracker.dad
- device_tracker.tick
- device_tracker.trick
- device_tracker.track
### Lovelace
title: Home
views:
- title: Home
path: home
icon: mdi:home-assistant
badges: *view-badges
cards:
....
Perfect! Thanks. It’s even better since I can customize for certain views if I want, but clutter-free and also free of copypasta errors.