If you want to have your own programmable/smart AC-light dimmer for your household, get a DIY kit for these first. Sparkfun and Adafruit probably have these kits.
It is very unsafe to build AC-based circuits without much knowledge of (power) electronics.
And finally, read up on PWM, zero crossing and isolations. They are not as easy as you think.