Please do not try this unless you are comfortable with both home wiring and soldering. You will need both hot and neutral wires to power the pi. Please only wire it in parallel with other loads. If you are confused, don't try it my way. You can get the same result by plugging it into a nearby power outlet and running the cable in through the faceplate. I'll make a print file with a hole just for that purpose. It won't look as nice but you won't burn your house down because you missed up the wiring.
I originally made some simple tasks in IFTTT to turn my lights on full, dim, and off when webhooks are triggered. Since I have two bulbs in my master bedroom, I had to make six tasks: 3 for each bulb. Even though I made six tasks, the same actions on both bulbs were triggered with the same webhook command. This made the python script simpler for my pi.
My beadboard prototype worked perfectly with IFTTT so I soldered up a through hole prototype board to take up less space. The lights changed one at a time and there was a bit of a delay, but it does what I wanted.
Meanwhile, I designed and 3D printed a custom faceplate that will hold three large button faces on the front, with holders for the prototype board, pi, and a power supply inside. From the front, it looks almost like something you'd find in a hardware store, but on the back there will be magic.
After finishing the prototype build with proper wiring and printed parts, I discovered a portion library to directly control my bulbs. Huzzah! No more IFTTT! After rewriting my python code, the lights responded instantly to button presses!
I'm already planning the next revision with a button switch to actually kill power to the bulbs in case something goes wrong with the wifi.