iOS: There are lots of ways to turn your old iPhone into a basic security camera, but free app Manything includes IFTTT recipes so you can do a ton of stuff once it detects motion.
Like other apps, Manything lets you stream the camera's feed to another iOS device on the web. With ther Manything IFTTT recipes, you can set triggers based on motion, location or time. They have a list of examples, such as recording when you leave the house or sending you a clip every time the device detects motion Those triggers connect them with other IFTTT supported devices like a Nest, WeMo and Phillips Hue. When you come home the lights turn on or when the Nest senses you are away, Manything starts recording.