Switch - Change Icon and State or Name

Hello,

I have a switch template and I would like to change the status value for the output.
Instead of ON/OFF I would like to have COME/LEAVE displayed. I managed to change the icon, but I can’t change the state object. Does anyone have an idea?
Is it also possible to change the label name by ON or OFF?

switch:
  ## Come/Leave Funktion
  - platform: template
    switches:
      come_leavefunktion:
        value_template: "{{ is_state('sensor.come_leave_function', '1')  }}"
        friendly_name: "Come/Leave Funktion"
        turn_on:
          service: knx.send
          data:
            type: decimal_factor
            address: 10/0/1
            payload: 0
        turn_off:
          service: knx.send
          data:
            type: decimal_factor
            address: 10/0/1
            payload: 1
        icon_template: >-
          {% if is_state('sensor.come_leave_function', '0') %}
          mdi:home-account
          {% else %}
          mdi:home-export-outline
          {% endif %}

image

I’m not sure, but it may be possible to do this in the front-end.
Take a look at this custom lovelace card called config-template-card and look at the example for the entities card. In the example, you can change the label based on the state. It may not work for your needs, but something you can try out.