As @tom_l said, sonoffs are pretty handy and pretty small to fit anywhere (check out Shelly alternatives for an even smaller/different form factor)
Imho, if you just need basic on/off functionality (i.e. you dont want to hook up other sensors on the sonoffs) there is no need to re-flash them.
You can use them out of the box with the following components:
- This, which needs internet connection to operate, meaning you will still have functionality through their original app - if needed- but if your internet goes down or if you dont want to have them exposed, it doesnt work for you.
- This requires no reflashing of the sonoffs and works locally
The first works really well for my needs but i haven’t had the oportunity to personally test out the second yet.