ESP Home SET Pin High

How to simply set pin GPIO02 to HIGH ? I am lost

substitutions:
  name: esphome-web-5822df
  friendly_name: ESP-HUMIDITY

esphome:
  name: ${name}
  friendly_name: ${friendly_name}
  min_version: 2024.6.0
  name_add_mac_suffix: false
  project:
    name: esphome.web
    version: dev

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:

# Allow Over-The-Air updates
ota:
- platform: esphome

# Allow provisioning Wi-Fi via serial
improv_serial:

wifi:
  # Set up a wifi access point
  ap: {}

# In combination with the `ap` this allows the user
# to provision wifi credentials to the device via WiFi AP.
captive_portal:

dashboard_import:
  package_import_url: github://esphome/example-configs/esphome-web/esp8266.yaml@main
  import_full_config: true

sensor:
  - platform: dht
    pin: GPIO0 #Pin D3
    temperature:
      name: "Living Room Temperature"
    humidity:
      name: "Living Room Humidity"
    update_interval: 2s

switch:
  - platform: gpio
    name: "GPIO13 Switch"
    pin: GPIO02
    id: GPIO02_switch
    internal: true

web_server:
 port: 80

When do you want to turn the switch on (GPIO02 → High)?

You can control it from your dashboard in home assistant. Or in ESPHome you can use the switch.turn_on action. See: Actions, Triggers, Conditions — ESPHome

Is there any reason that you set it as internal? This way it’s not accessible from HA. Delete that line and it will appear.

Full time without condition