[SOLVED] ESP01S wifi module and relay - how to mount physical button?

thanks for helping me .
now i am trying to get it to be a switch
again thanks for quick response

have a nice evening

Great tips. Helped to reach my target.

  • click on Home Assistant to turn on/off light
  • connect a normal switch to toggle light on/off
captive_portal:

binary_sensor:
- platform: gpio
  pin:
    number: GPIO2
    mode: INPUT_PULLUP
    inverted: True
  name: "btn"
  on_press:
    - delay: 500ms
    - switch.toggle: relay_1
  on_release:
    - delay: 500ms
    - switch.toggle: relay_1
    

switch:
- platform: gpio
  name: "apasaL"
  pin: GPIO0
  id: relay_1
  inverted: True

1

Nice , that you have get it to work .