I ran across this and thought I'd share. It's an inline mains-level relay controlled by an ESP8266. Best of all, it's pre-built/packaged and less than $5.00 USD each! By default it communicates with "the cloud" but it's very easy to load your own Arduino sketch on, the examples below have it doing pub/sub with MQTT. Here's the device, there are several versions available on the website, including ones with temp/humidity, or dual relays, this is a photo and link to the single relay:
https://www.itead.cc/sonoff-wifi-wireless-switch.html
Here is the original youtube video I ran across describing, and hacking it:
https://youtu.be/_389pQPLyr8
And here is the youtube guy's website with more info and links to the source he used in the video:
http://www.superhouse.tv/17-home-automation-control-with-sonoff-arduino-openhab-and-mqtt/
I've ordered a couple to play with and will add to this thread when they come in. Interestingly, the ones I ordered mention MQTT in the description, but I don't know if they're already enabled, or just can be, with the alternative firmware loaded. We'll see when they arrive. Happy hacking!
Terry