Electrical components are needed to perform the switching and the zero cross detection, those will be discussed in detail in the next section. This section will focus on the control and code part of the problem.
The main hurdle for getting the code to work was to get it to perform the control code in the time alloted. The processor that was chosen for this task is an ESP8266. This processor is cheap and can handle WiFi easily but real time control on it is not very straightforward. The timer libraries that exist for this processor can't run fast enough so instead I used some less documented functions and put the relevant high speed functions in RAM using the ICACHE_RAM_ATTR directive.
Fortunately, this was enough for the loop to run in time and check through all the switches (the lightbulbs will be connected to a socket) to see if it's time to turn the triac on or off.