The sun
Producers can only photosynthesise with the presence of sunlight. And with sunlight, producers will be able to have chemical potential energy stored within in which will be transferred to primary consumers when consuming producers. The same happens with secondary consumers and tertiary consumers but they receive less energy each time.