Using the same type of hardware as mentioned for Hubduino, you could also use my HE version of Tasmota if you don't want to compile your own firmware. Once Tasmota is configured the HE driver would detect it as having however many relays you have on it. I'm sure there are better guides, but here is one I found through a quick Google search: