How to distribute card configs for other users

Hi, I’m interested in a way to distribute (probably via HACS) a set of pre-configured cards for other users to add without them messing with YAML - for example, a few different Apex Charts, or a card showing a specific list of entities. This is using existing cards (like Apex Charts), not new custom cards which generate the HTML themselves.

I want to do that to save users having to copy and paste long sections of YAML for each chart into their own setups, and to give a way for users to get the latest charts, or modifications to existing charts.

Also, I want to do it in a way that allows individual cards to be selected by the user, not by distributing a view out a dashboard.

I’ve looked at the following from Custom Cards | Home Assistant Developer Docs , but they don’t seem to fit what I’m after:

Custom Cards

These seem to require me to build the HTML for the cards, but I’m not after that - I want to use existing types of cards, but with a specific configuration e.g. chart config, a list of entities to display etc.

Custom Strategies

These seem to come the closest, in that I can define a View or Dashboard in code and can provide a list of cards with the relevant config. However, that requires someone to use the whole view, rather than being able to choose to add a single card (with pre-defined config) to a view they already have.

Custom Views

I’ve not tried this, but again it seems to be focused on a whole view, rather than individual cards.

So, have I missed something? Is there a way to package up a card type and its config (such as an Apex Chart, which often has loads of config) so another user can choose to add that individual card pre-configured to their own system?

Hoping that makes sense!

I do not think it exist.
It has been requested a few times, but the reality is that the user will nearly always have to edit and adapt the code in YAML anyway.
Sensors are often names differently and apex charts might have titles on the chart, axis and legends that have to translated/renamed too.

Thanks @WallyR .

I don’t think a solution necessarily needs to preclude users from editing the card, it could just be a way to create an initial version - like a template for a Word document behaves in MS Word.

Alternatively, it could allow some config to be pulled in to modify specific elements, so the user only provides config for the bits likely to change. An Apex chat could easily be a couple of hundred lines, and maybe only a few might be likely to be customised.

Or if there were a way to add a card via code, I could build a bit of a UI to take some inputs then write out the card config with the user’s personalisation with into it.

It just seems like a gap that I can save a card definition as part of a full view or as a dashboard, but not in its own.

Hoping some sort of feature like this comes along at some point.

It’s not a gap.
The custom strategy and custom view is for auto-generated dashboards, where the developers control the naming, availability and visibility of sensors provided by their own integration.
Once the user decides to take over the dashboard controls, then none of those factors are certain anymore and an apex chart is not even linked to an integration, so there is no such factors to rely on in the first place.

I’m looking for a way to distribute a set of independent cards alongside an integration, where the entity names are known.

HACS doesn’t seem to support distributing cards alongside the integration code, so I was looking at a separate repo for the front-end items.

I can distribute a view with a series of graphs, but not the graphs in a way that they can be independently placed on a user’s existing views.

I’m not sure why distributing a view is fine, but distributing the independent cards within that view is not?

Currently the way this is done is by having a couple of files on GitHub where users can copy YAML from, but that hardly feels the right way to do this.

Is there a better way you can recommend please @WallyR ?

Thanks :blush:

There is no better way.
Users that have chosen to control their dashboard themself will quickly come in contact with YAML.
The important part for them is to know which lines they need to change for their setup, which should be the same no matter what distribution you choose.