I bought used/new-old-stock AXIS cameras off eBay, wired them to a totally separate network and wrote a Kotlin program to record/rotate all the camera video .... I really need to finish up my video/post on that.
There are also tools like Tasmota to replace the proprietary firmware in some "smart" devices, allowing them to be controlled by locally run OpenHAB or Home Assistant instances. I bought some mWave (zigbee) receivers and outlets to try to control things with self-hosted software, but that's been on the backlog of life for like a year.