External led status in HA

Could work.
If I recall correctly the opto coupler has a max voltage of 1.5 volt.

I suggest you wire the opto coupler with a resistor to the ESP and leave the two output ends free.
Then use the multimeter with continuity to see if it closes the switch correctly.

That way you minimize any possible issues if it fails.

Sure - but what resistance shall I use ?

100 ohm could work.
You should not burn the opto coupler with a 100 ohm resistor, perhaps that you need something slightly smaller, but give it a try with 100.
If that doesn’t work then you might need to put two smaller in series.