The study of open quantum systems often relies on approximate master equations derived under the assumptions of weak coupling to the environment. However when the system is made of several interacting subsystems such a derivation is in many cases very hard. An alternative method, employed especially in the modeling of transport in mesoscopic systems, consists in using local master equations (LMEs) containing Lindblad operators acting locally only on the corresponding subsystem. It has been shown that this approach however generates inconsistencies with the laws of thermodynamics. In this paper we demonstrate that using a microscopic model of LMEs based on repeated collisions all thermodynamic inconsistencies can be resolved by correctly taking into account the breaking of global detailed balance related to the work cost of maintaining the collisions. We provide examples based on a chain of quantum harmonic oscillators whose ends are connected to thermal reservoirs at different temperatures. We prove that this system behaves precisely as a quantum heat engine or refrigerator, with properties that are fully consistent with basic thermodynamics. derivations are in general quite involved since they require knowledge of the full set of eigenvalues and eigenvectors of the system's Hamiltonian, something which quickly becomes prohibitive when the number of subsystems increases. Moreover, depending on the approximations employed, one may also arrive at equations which do not generate completely positive maps (the so-called Redfield equations [50]), or equations which contain unphysical heat currents [54]. For these reasons, microscopic derivations of master equations for systems connected to multiple environments still continues, nowadays, to be a topic of great interest.An alternative, more heuristic, approach consists in deriving a master equation for the individual subsystems, neglecting the interaction with the remaining subsystems. The resulting master equation will then contain only local jump operators describing exchanges between the environment E i and its corresponding subsystem S i . Such equations, which we shall henceforth refer to as LMEs (also frequently called boundarydriven master equations), are typically accurate when the dissipation rates are larger than the interaction between subsystems. Due to their computational simplicity, they have been extensively employed over the last two decades in the study of transport in non-equilibrium quantum systems [55][56][57][58][59][60][61][62][63][64][65][66][67][68][69][70][71][72][73].It turns out, however, that the nonlocal terms neglected in the LME may still lead to non-thermal steadystates [74] and play a significant role if the heat exchanges are small, even for weakly interacting parts. As a consequence, it has been found that LMEs may lead to apparent thermodynamic inconsistencies, as pointed out recently by Levy and Kosloff [75]. They have shown that the LME for two coupled quantum harmonic oscillators (QHO) may predict currents from a cold to a hot ther...