I would love to take credit for this fantastic work, however the installation below is from one of the first supporters of machinon. Benny has done a fantastic work, see it for yourself:
I hope that Benny and I can co-write an article in the future, in the meantime, I think is best if you read his blog directly here: https://domotics.home.blog/
To give you some background, he is using machinon device which runs with a Raspberry Pi 3B+ inside. The machinon uses Domoticz Open Source software out of the box, which drives other relay drivers and also some wireless devices.
You can see even wiring diagram here, I think they are great! https://domotics.home.blog/2019/02/12/what-is-connected-to-what-in-my-house/