Relay configuration

Hi all,
I’m new in hassio system and I would like to create a button in user interface which turn on a led (connected in a pin of my raspberry) for some seconds and then automatically turn off it. I tried to read many manuals on web but I didn’t understand how to configure my configuration.yaml file for that. I tried with switch or covers functions but they doesn’t works. Can someone post me an example or a good tutorial. I would start with a simple led and in the future I will connect a relay which open a door and then I would like configure it for open doors with vocal function from my google assistant.

Thank you very much
Best regards

The GPIO switch is what you want https://www.home-assistant.io/integrations/rpi_gpio/#switch

# Example configuration.yaml entry
switch:
  - platform: rpi_gpio
    ports:
      11: My LED

Thank you really much Tom,

It works.

I would add another question. I would like that swich activated, turn off automatically after 0.5sec. This because I need to open doors with a simple imput. Maybe you know best way to do that. After that in the future I will integrate it with google assistant. In particular I would like that saying “ok google open door”, hassio turn on a gpio and after 0.5sec turn off it.

Thank you really much for help
Best regard