Make light into switch?

Is there a way to make a device that’s coming up as a light a switch? Because it’s actually a switch. Or template a switch that will turn the light on and off?

The switch is currently “light.mainroomhumidifier” but it needs to be “switch.mainroomhumidifier”

Create a template switch.

Like this:

switch:
  - platform: template
    switches:
      kingsley_games_room_camera_power:
        value_template: "{{ is_state('light.kingsley_games_room_camera_power', 'on') }}"
        turn_on:
          service: light.turn_on
          target:
            entity_id: light.kingsley_games_room_camera_power
        turn_off:
          service: light.turn_off
          target:
            entity_id: light.kingsley_games_room_camera_power

can i do that if i also have template sensors?

it told me a switch was an invalid option for template

Check your indentation. What have you got?

Yes, this will be in a different section of code.

Sorry I shoved it into templates I misunderstood what I was doing. Thanks