ESPHOME : simulate the activation of a GPIO (General Purpose Input/Output) pin

hello ,

Hello, I would like to create a button on a web interface that can simulate the activation of a GPIO (General Purpose Input/Output) pin on an ESP32 microcontroller. This would allow me to test and manipulate my pulse counter without having to physically interact with the ESP32 device, such as going outside to manually activate the GPIO pins. The goal is to have a button on the web interface that, when clicked, triggers the pulse counter as if the GPIO pin had been activated. This would provide a convenient way to test and debug the pulse counter functionality without the need for physical access to the ESP32 device.

it this a possible way in ESPHOME ?

kind regards

sensor:
 - platform: pulse_counter
   id : tippingbucket
   pin:
     number: GPIO12  
     inverted: True
     mode: INPUT_PULLUP    
   
   name: 'Rainfallflips'
   update_interval : 10s
   accuracy_decimals: 0



   total:
    name: "rainWater Meter Total" 
    unit_of_measurement: "L"
    id: rainwater_meter_total_esp
    accuracy_decimals: 3
    device_class: water
    state_class: total_increasing
    filters:
      - multiply: 1
      
      
      
button:
 - platform: template
   name: puuls
   id: my_drukknop

   # Optional variables:
   icon: "mdi:emoticon-outline"
   on_press:
     - logger.log: "create event so i can create a software puls to tippingbucket "  


switch:
  - platform: gpio
    pin: GPIOXX
    id: testbutton
    name: "TB"
    on_turn_on:
    - delay: 100ms
    - switch.turn_off: testbutton

and put a jumper wire between this pin and your input pin

hmmm…so i got to go outside for making the jumper wire
thanks for the suggestion