Thanks for the feedback....
I am not a favorite of powering a PIC through a capacitor.
Isolation would be a pre for safety.
You can control the triac with an optocoupler like the ones in the MOC series.
This MOC can easely be controlled by a PIC.
The PIC itself can be powered with a tiny SMPS powersupply.
...
My goal for this project was to build a small simple circuit into the plastic base of the fan. There is limited room, and I probably could not fit a small mains transformer or SMPS into there. Also, I have used MOC series optos with TRIACS, but on 240v AC it also requires a couple of 1W high voltage resistors and a mains rated cap etc. Then to get zero-cross detection that requires a second optocoupler and more mains rated parts etc. And all those mains-rated parts need to be properly spaced apart (ie PCB starts to be needed).
The whole project blows-out in time and effort and now requires a designing and making a PCB and some enclosure to hold the extra volume of parts and transformer etc. Not to mention that now instead of my fan project being neat and self contained it has a clumsy enclosure tacked on and possibly two mains leads.
At this point I am reluctant to go further with my original design on the forum due to the good reasons people like T06afre have raised. But I also don't think it is worth doing the project in the fully isolated overkill way, at least not at the moment with my current time constraints.
I appreciate everyone's feedback, thank you!