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.
There are also devices that do RF. I have a Broadlink RM4 Pro [0] - and whilst the vendor software sucks, there is a Home Assistant integration [1], or several libraries - I've used a Go one [2] though I did modify it a bit as I wasn't totally happy with how it was written.
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