For home automation, I use a protocol called Insteon, and its associated hardware (switches and outlets, etc). It works in step with a software component that runs on my Macintosh computers and iPhone and iPads. (That's an old iPad on the wall in the picture that I mounted in a frame.) It offers virtually unlimited programming of the hardware and how it all works together, to a geek's content. I settled on all that software and hardware long before home automation took off in popularity the way it did. Now you have all sorts of protocols and systems available. I don't know much about any of those, as I've only focused on the system I have. Others here use some of those other systems. Maybe they can offer ideas about which one is best.
If you settle on Insteon, I'm your guy.
You might want to start a separate thread about it, with a title that would grab the attention of the other home automaters. Though there must be tons of HA forums out there, that would likely be a better source of information than our meager pool forum. I don't frequent any, sorry, not much help...