A considerable reduction in energy and raw material waste can be achieved applying AI to real-time IoT data