#Reusing parts of a dashboard?

1 messages · Page 1 of 1 (latest)

leaden hound
#

Hello everybody. I wonder if it’s possibleto outsource parts of the yaml in a dashboard to use that in other dashboards.
My usecase is that I got a generic dashboard for use on desktop and another one optimized for mobile. Yet another for a tablet and another for a chromecast. Many things are the same, but not all. Working with visibility conditions makes managing the dashboard very hard as it gets quite cluttered. So, I wonder if I can reuse parts of the dashboard.

Thanks in advance

marble relic
leaden hound
#

That’s what I am doing right now. But that’s a lot of work if I want to change some details

marble relic
#

you can copy an entire "view" yaml at once

#

then you have a full dash as a starting point to adapt

floral niche
#

I believe if you use full yaml mode you can use yaml anchors to reference/duplicate sections of yaml, but if you want to use the UI at all, there's no support for anything like this.

leaden hound
#

True, but still. If you want to extend that part you’ll have to manually work through all dashboards where u used copy-pasted yaml

fast hare
#

Like karwosts mentioned, using the YAML mode is going to give you the best way of replicating code across your dashboards/views. Incorporating YAML anchors and !includes cut down on the reptition. Because you already have a UI-based dashboard, copying it all into a YAML-based dashboard would be the first step. Then, you set up some YAML anchors and go through your dashboard replacing the code blocks with the YAML anchor reference. Yes, it is a hassle to set up initially, but it will work well for you in the long run.

#

Here's an example of referencing a YAML anchor (used in a Mushroom Chip card): ```yaml

  • type: template
    <<: *battery_chip_template
    entity: sensor.watch5_battery_level
    icon: mdi:watch
slate spade
#

This had been my "hope" for sections but it seems to have been a feature drop and carry on instead of develop and expand on it. On a computer or tablet it could be a level view w/rooms and for mobile you could pick off the room sections as needed.