Samsung has agreed to buy SmartThings, a two-year-old startup that makes software to connect household objects and let them be controlled from afar via smartphone. The deal, announced Thursday, gives Samsung a solid foothold in the burgeoning "Internet of things" market. IoT generally involves connecting objects such as cameras, sensors and appliances using a wireless Internet connection and controlling them or collecting data.