Fan Controller for use without a wall switch

If it’s a classic ceiling fan, then the Sonoff iFan04-L for the US and 120VAC or the iFan04-H for others at 220/230 VAC. There’s a lengthy thread here, including ESPHome code to flash to the device. I just ordered one this afternoon, will see about installing it next weekend.