Philips agrees to buy US firm Electrical Geodesics