The most OSS solution out there would probably bee to use an ESP32-CAM with esphome(esphome.io/components/esp32_camera.html). I think you could even add a motion sensor to that as well. But it would require more work and some electronic knowledge to set up an esp32.