Local .svg icons not loading

HI

managed to have MDI draw several new cool icons, which aren’t uploaded to Hassio yet, so have to work with the .svg files.

organized these in /config/www/icon, and reference them as

  templates:
    icon: "if (state === 'on') return 'mdi:test-tube';
                            else return '/local/icon/test-tube-off.svg';"

any thoughts on why that wont work? the template works fine, I use it all over the place in my setup with great results (i think). Would have hoped this .svg could do for the time being

Cheers,
Marius

your template is not correctly formatted.
In YAML / Jinja2, an IF statement goes like this:
{% if condition == 'state' %}value_if_true{% else %}value_if_false{% endif %}
so your template need to be something like:
"{% if state == 'on' %}mdi:test-tube{% else %}/local/icon/test-tube-off.svg{% endif %}"

i will try of course, but just like to let you know that i have many templates like this, that work just perfectly… with 2 or even 3 mdi: icons that is.
check home-assistant-custom-ui/docs/templates.md at master · andrey-git/home-assistant-custom-ui · GitHub

my issue here was the .svg icon, hence my uncertainty

did give it a try, the sag’s just won’t show up.
guess Ill have to wait for the mdi icons to be imported …