Need help to upgrade deprecated switch template

My previously working config, used to communicate with GitHub - hass-agent/HASS.Agent: Unofficial development project for the HASS.Agent platform. · GitHub

But it stopped working on core 2026.6.4

Can someone help me upgrade it please? Thank you.

switch:
  - platform: template
    switches:
      computer_proxy:
        friendly_name: "LCD Computer"
        value_template: "{{ is_state('sensor.COMPUTER_monitorpowerstate', 'PowerOn') }}"
        turn_on:
          - service: switch.turn_on
            target:
              entity_id: switch.COMPUTER_unmute
          - service: switch.turn_on
            target:
              entity_id: switch.COMPUTER_monitorwake
          - service: switch.turn_on
            target:
              entity_id: switch.COMPUTER_setGamma
        turn_off:
          - service: switch.turn_on
            target:
              entity_id: switch.COMPUTER_mute
          - service: switch.turn_on
            target:
              entity_id: switch.COMPUTER_monitorsleep
        icon_template: >-
          {% if is_state('sensor.COMPUTER_monitorpowerstate', 'PowerOn') %}
            mdi:monitor
          {% else %}
            mdi:monitor-off
          {% endif %}      

  1. Removal of legacy template entities in 2026.6 - stuck as I don't find any template_migration.generate_yaml
  2. also stuck after reading switch template documentation, I created the below, but did not work
# in configuration.yaml, I have `template: !include_dir_merge_list yaml/templates/`
# this is yaml/templates/computer.yaml

- switch:
    - name: computer_proxy
      state: "{{ is_state('sensor.COMPUTER_monitorpowerstate', 'PowerOn') }}"
      turn_on:
        - service: switch.turn_on
          target:
            entity_id: switch.COMPUTER_unmute
        - service: switch.turn_on
          target:
            entity_id: switch.COMPUTER_monitorwake
        - service: switch.turn_on
          target:
            entity_id: switch.COMPUTER_setGamma

      turn_off:
        - service: switch.turn_on
          target:
            entity_id: switch.COMPUTER_mute
        - service: switch.turn_on
          target:
            entity_id: switch.COMPUTER_monitorsleep

      icon_template: >-
        {% if is_state('sensor.COMPUTER_monitorpowerstate', 'PowerOn') %}
          mdi:monitor
        {% else %}
          mdi:monitor-off
        {% endif %}

That's not a valid configuration variable.

You need to add the template migration via HACS, using the 3 dots in upper right, custom repositories.

That is why you don't see it

done and rebooted, still nothing

UPDATE

  • appeared after I further added in integration
  • problem solved after successful migration