Multifunctional Gateways for smart buildings.