It's a cool project, but for these kind of things I'd rather use a Shelly1. Runs locally, can easily be flashed with Tasmota firmware and it connects to my Home Assistant instance. This thing has never failed me and it's only $15, way cheaper than a Pi (keep the RBPi as your Home Assistant server!)
Although I've grown cautious of products like Shelly which use Wifi as they will become obsolete once their Wifi security protocol becomes broken (like WEP en WPA). But then again the same probably goes for more expensive Zigbee and Zwave devices.