Currently, the electrocaloric effect (ECE) is considered for applications in solid-state refrigeration. Direct semi-classical first-principles-based simulation to the case of ultra-thin PbZrO 3 films in order to unveil the unusual electrocaloric potential of antiferroelectrics with phase competition are applied. Strong enhancement of the ECE in the vicinity of the antiferroelectric-ferroelectric phase transition, the coexistence of electric-field tunable positive and negative ECE in antiferroelectrics, and a large ECE in the vicinity of lossless antipolar-polar phase transitions are predicted. Direct simulations demonstrate that phase switching, which occurs with hysteretic losses, gives rise to the irreversible heating which is explained using basic thermodynamics. A refrigeration cycle that tames the irreversible heating is proposed, tested in direct simulations, and found to outperform the conventional cycle based on fully reversible processes. Furthermore, direct simulations reveal critical misconceptions in the application of the controversial indirect approach to the case of ferroics with electric hysteresis. The route to overcoming the uncertainties with this dominant ECE investigation approach is proposed.