Svg icons in place of mdi in templates

Good day! Please tell me if it is possible to install custom icons in templates from the folder /local/icons/ in such a solution? I have the result does not work!

- platform: template
  sensors:
    detect_motion_cam:
      friendly_name: "detect-motion"
      value_template: >-
        {% if is_state('binary_sensor.motion_detect', 'on') %}
          Detect
        {% else %}
          Not_detect
        {% endif %}
      icon_template: >-
        {% if is_state('binary_sensor.motion_detect', 'on') %}
          /local/icons/motion_detection_on.svg
        {% else %}
          mdi:walk
        {% endif %}

You should be able to, and your config looks correct. I’m not sure about svg. Try png.

Unfortunately png doesn’t work either! already tried all formats, so only mdi:motion-sensor work, and user icons do not want to work!

I’ve definitely used /local/icons/my_icon.png before. It wasn’t in an icon_template though:

(towards the bottom of the config)

Well, yes there is a way to install custom svg icons, but requires some work.
You extract certain parts of an svg file and wrap it in an html file with various tags and place it in your www/icons directory and then tell HA where the files are at. The work is creating the html file from svg.

I have done a few myself, and here is where I started from to learn how:

I used inkscape to create my svgs, then modified Thomas’ python script to read the svg file and create the html file. Like I said, it can be done, but takes some work.

And can be if you not hampers on much detail as you this did!