Garage Door Controller problem

Hi all,
looking for help because I am lost right now.

I built a new garage door controller using a nodemcu and ESPHOME.
My goal is to replicate the one that I actually use since 3 years running on a Pi.
On my Pi I drive a 2-relay module from a python script ; Relay 1, connected directly to my garage door opener [to operate the door]. Relay 2, connected to my garage door opener throught a 1uf capacitor [to operate the light of the door opener].

Setup of the GPIO
gpio.setup(23, gpio.OUT)
gpio.setup(24, gpio.OUT)
gpio.output(23, True)
gpio.output(24, True)

The way I trigger each PIN
gpio.output(23, False)
time.sleep(0.2)
gpio.output(23, True)

Here’s how I setup the GPIO / switch on my ESPHOME new controller

> switch:
>   - platform: gpio
>     pin: 
>         number: D6
>         inverted : True
>         mode: OUTPUT
>     id: relay2
>     restore_mode : ALWAYS_OFF
> 
>   - platform: gpio
>     pin:
>       number: D7    
>       inverted : True        
>       mode: OUTPUT
>     id: relay1
>     restore_mode : ALWAYS_OFF
>     
>   - platform: template
>     name: "Garage  Door Switch 2"
>     lambda: |-
>           if (id(garage_door).state) {
>             return true;
>           } else {
>             return false;
>           }    
>     turn_on_action:
>     - switch.turn_on: relay1
>     - delay: 500ms
>     - switch.turn_off: relay1
>     turn_off_action:
>     - switch.turn_on: relay1
>     - delay: 500ms
>     - switch.turn_off: relay1

I did some test by changing the mode of the GPIO but I can’t make it work.
The actual behavior is that the “circuit” of the door opener goes crazy when I connect my new controller.

The wall buttons (light and open/close door) stop working. By using the ESPHOME switch, it works randomly ; the light switch turn on light…for 5 seconds ?! ; the door switch open the door but only if the light is on.

If I connect only one relay, the one for the door, it works great. It is really when I have both relay connected…but exactly the same setup work #1 on the Pi.

Any clue of a mistake I did ?

Is this maybe a power issue? Try driving the relay using a transistor and seperate power supply, rather than directly?