ESPHome and native code parallel?

I also wonder…wouldn’t it be easier to connect the optocouler to the buzzer :thinking:

Or directly to GPIO pin?

And then use Frenck’s doorbell?