Have you seen youtube channel superhouse?
It’s a long video but it’s a really great system he built.
Wish I could build something like that but we have a rented apartment.
Watch it all. It may be a bit slow but it will probably give you a good idea.
For my light switches i use a custom built Shelly 1 like device and flashed them with ESPHome. These cost me a bit over 5 euro
I have swapped the physical switch for a blind plate with a touch sensitive sensor behind it.
When Home Assistant fails, the lights still work. I have also done that for my motion detection.
Had some power sockets that i did not use and converted them to a motion sensor, also built with a custom Shelly 1 and a blind plate. One must: a strong and stable WiFi network.
I am using this for over a year now and i have had zero isssues with them