Switch template problem configuration

Good morning, I have a problem, I can’t configure something that I have in mind to do based on a switch template.
The idea is to create a switch to turn it on a yeelight lamp, I have been making many changes and I can’t get anything to see if someone can help me and see where I screw up. Thank you and what modification would you have to do to make it work? Thank you

  - platform: template
    switches:
      interruptor1:
        value_template: "{{ is_state('sensor.interruptor1', 'on') }}"
        turn_on:
          service: switch.turn_on
          target:
            entity_id: switch.interruptor1_open
        turn_off:
          service: switch.turn_off
          target:
            entity_id: switch.interruptor1_close

Looks like you’re copying the example on this page. For that to work, you need to have separately-defined switches interruptor1_open and interruptor1_close. In the example, those are assumed to be defined elsewhere.

Please describe what you’re trying to do. What is the sensor, and how are you controlling the yeelight lamp at the moment?

If I have basically copied the example on the page I have tried to modify it to what I had in mind, the intention is to create a switch to turn the light bulb off and on, the bulb is already integrated in homeassistant and has its own creed entity, which I am trying to do is practice things to be able to handle with homeassistant fluently since my programming level is basic and it is difficult for me to understand some and I can not find the correct solutions many times thanks. If you could help me with an example I would appreciate it