I'm trying to modify the following circuit to switch a mains load using a sparkfun esp8266 thing:
I've modified it like this (I know the symbol inside the optoisolator is wrong - sorry about that. The hi-link is a solid state mains to 5V DC PSU):
It looks like, when triggered, the OI allows the mains to trigger the triac, which switches the main load. Is that OK?