IoT edge devices have become more popular due to the rapid growth in IoT applications in recent years. Task scheduling reduces latency and application computation times, while improving quality of service. In this paper, we introduce a new version of Artificial Hummingbird Algorithm (AHA) with Opposition-Based Learning (OBL), chaos mechanism, and Differential Evolution (DE) algorithm, called CODA. AHA is improved by using DE algorithms to determine the optimal configuration of chaotic maps and OBL for determining the optimal initial population. As a result of CODA's high ability, local optima can be avoided and exploration of a region of interest can be improved. CODA is then utilized to schedule tasks in fog computing systems. Analytic Hierarchy Process (AHP) is used to determine the priority of tasks. Task scheduling is primarily intended to reduce energy consumption, duration, and costs. To compare CODA's performance with that of other well-known meta-heuristics, 50 basic functions were used as benchmarks. Additionally, the proposed scheduling scheme is evaluated through different simulations. Energy consumption, makespan, and cost are better as a result of the implemented algorithm. When compared to the existing algorithms that include Artificial Hummingbird Algorithm (AHA), Gravitational Search Algorithm (GSA), Moth-Flame Optimization (MFO), Seagull Optimization Algorithm (SOA), Salp Swarm Algorithm (SSA), Whale Optimization Algorithm (WOA), Sine Cosine Algorithm (SCA), Particle swarm optimization (PSO), Multi-Verse Optimizer (MVO), and Differential evolution (DE), the proposed CODA shows better output in satisfying the task scheduling process. On average, the CODA-based task scheduling model outperforms other research studies in terms of makespan by 46%, cost by 8%, and energy consumption by 41%.