For this I needed to bring the 12V of the doorbell back to a level the ESP could work with.
So I attached some leds to the 12V and an LDR to the ESP.
This acted as an opto coupler and works great.
Next step was connecting this to Domoticz, but that was easy.
You can use this to connect the doorbell to any notifying service (telegram, pubsub, Domoticz etc etc)
Full story, breadboard setup, stripboard and software on my weblog:
http://lucstechblog.blogspot.com/2020/02/connecting-12volt-doorbell-to-esp-and.html