PeterH:
You're going to be switching main electricity? That is quite easy to do, and quite hard to do safely - are you sure you understand the risks and know how to address them?Will this device be mains powered?
If you're using TCP/IP over WiFi networking then you have almost unlimited options available to you - I'd be inclined to go for a web service based architecture with a central database and command+control server.
Do you have a budget per device?
1: I most definitely do not understand the risks and how to address them. Would you be willing to share some knowledge?
2: The device will be mains powered.
3: That is the goal. I'll most likely go with a simple LAMP stack on the Raspberry Pi.
4: Budget for device is approximately $60.
Thank you so much for time!