For those who don't want to, or have the time, to build something like this, there is also an off the shelf solution: the Aqara M2 Hub[1]. I currently use this to control both my portable AC, and an electric fireplace.
And for those who are concerned about security, you can easily restrict this device from accessing the internet using your firewall, and it will continue to function just fine.
I’m running pfsense as my router and TP-Link access points. I run their controller in a container locally and everything works great together. Super happy.
I think for some use cases this setup could be a nice alternative (and cheaper) to ubiquiti.
And for those who are concerned about security, you can easily restrict this device from accessing the internet using your firewall, and it will continue to function just fine.
[1] https://www.aqara.com/us/product/hub-m2