I've ordered several OpAmps (TLV272ID, MCP6H81-E/SN, TS912D, LMC6482IM, basically every Rail-to-Rail output capable 12V tolerant OpAmp below €2 that Reichelt had in stock).
After completely wasting my time yesterday because I didn't realize my breadboard has separate power rails left/right along the long side...
I managed to get a smooth voltage controlled via PWM using this circuit:
I've tested it with +5V supply on the MCP6H81 and it works as expected.
Good thing I bought some trimmers, since the fancy metal layer resistor kit have flimsy leads that barely make a connection with the breadboard...
Next I'll test it with the 12V aux supply from the lamp and then I'll connect it to the dimming input,
if that works well I'll try to design a proper PCB with some off-the-shelf 12V to 3V3 DC/DC converter module as a supply for the ESP32 devkit.
Maybe there will be a rev.2, I just found an old LDR and I have some spare OpAmps (2-channel ones too),
but currently I have no idea where I could mount that thing to expose it to ambient light.
Now my last concern is protecting the dimming port. The highest voltage I've measured was 11.2V with the stock pot.
I can't imagine an additional .8V would hurt, but just to be on the safe side, I'd like to add a zener diode for protection across the V_DIM output to ground.
That won't interfere (below 11V) with the OpAmp output, does ist?
Edit: BTW I don't know why I constantly mix those up, my Oscilloscope is an Hameg HM203-4, not a 205. Crusty but trusty.