I prototype the whole thing using relays and tested system using esp8266 and mqtt.
Then I built one of the switches with the opto's and triacs and used it to run one setting (high on fan)
I ran that for a while and switched it on and off without problems.
Then built the board using the same switch setup only with 8 switches, 3 for speed control running through caps pack, one for light, 4 for H-Bridge to reverse motor direction.
this entire setup is just proof of concept will only ever be used and handled under experimental conditions by me only.
If I continue with project I plan to build board to UL specs. I have been researching these they don't sound too awfully hard but I will have engineer to help to fine tune equipment.
I just built this.
If you notice at the beginning this post it showed someone that was doing without getting into the fan but by intercepting the mains at installation, this got me thinking it must be PWM now after doing a tad bit of research I found that you either phase shift or chop. The phase shifting seems more difficult so I thought the chop was the easiest.
That is why I posted the above data about chop