Change icon or entity picture for input boolean based on state in a glance card

I have read numerous posts about this. Tested many codes suggestions but still not getting a definite answer. Can it be done?
In HA 0.106.1
The most common code I get is this but not giving the expected result

input_boolean.media_radio:
  icon_template: >-
      {% if is_state('input_boolean.media_radio', 'on') %} mdi:message-bulleted
      {% else %} mdi:message-bulleted-off
      {% endif %}

No. Input booleans do not support icon_templates. The available configuration variables are listed in the documentation:

This used to be supported in customize.yaml but it’s not anymore for some reason?

It was never supported in core HomeAssistant using customize.yaml. I believe you are mixing up core functionality with CustomUI (which is largely broken now).

You could perhaps use a template sensor or template switch that duplicates the state of the boolean?

This is weird… It must have worked at some point. I have several of them in my customize and I distinctly remember one working fine on a picture lovelace card. I don’t recall ever having to install CustomUI either, but then I did visit the git page in July…

Just noticed there’s an updated version for .110+

It’s never worked outside customui. There’s an icon_template for template entities, maybe you’re thinking of that.

Yes, I could, but it just makes for more entities which I wanted to avoid.

There are a lot of threads around this so I wonder if this is something the team might consider adding to the input_boolean in the future.

EDIT: Just to add to this, I’ve just tried template switch and this doesn’t change the badge icon either.

Mirroring a switch<->input_boolean still works. Just use the switch in your dashboard.
I still hate I need these extra switches for this simple UI enhancement.

    kitchen_auto_lights:
      friendly_name: Kitchen Auto lights
      value_template: "{{ is_state('input_boolean.kitchen_auto_lights', 'on') }}"
      turn_on:
        service: input_boolean.turn_on
        data:
          entity_id: input_boolean.kitchen_auto_lights
      turn_off:
        service: input_boolean.turn_off
        data:
          entity_id: input_boolean.kitchen_auto_lights
      entity_picture_template: >-
          {% if is_state('input_boolean.kitchen_auto_lights', 'on') %}
            /local/switch_on.svg
          {% else %}
            /local/switch_off.svg
          {% endif %}
2 Likes