IoT sensor for smart buildings