Siemens to buy smart grid vendor for $381 million