Generate custom icon packs for Home Assistant from a directory of SVGs
Used by:
This script can either be used manually or configured via Github Actions.
generate.py <svg directory> <set name> <icon prefix>
This will generate <set name>-icons.json
which you can then copy to your Home Assistant installation.
- Add
example_workflow.yaml
to the appropriate directory within your Github repo - Update the call to this script within the workflow with your desired prefix and SVG folder name. The default prefix is 'af' with SVGs stored in a directory called
svg
so the line is set topython3 generator/generate.py svg af
- Commit an icon to the repo
- Check that the action completed successfully. Malformed SVGs (or ones we haven't accounted for) will cause the action to fail. If you think the SVG is normal please raise an issue in this repo with the file so we can add support for that particular format.
- Clone or copy the repo to somewhere within your Home Assistant
www
directory. - Reference the file either in
configuration.yaml
or a lovelace config
configuration.yaml
frontend:
extra_module_url:
- /local/af-icons.js
lovelace
resources:
- type: js
url: /local/af-icons.js
- Restart Home Assistant
- Use your icons the same way you would any other. ie:
mdi:sun
vsaf:better-sun
(not a real icon)
The format of the generated js and the installation instructions are based on Emanuele's custom brand icons repo.