Recent results of ground-based telescopes, giving high-quality measurements of the cosmic microwave background (CMB) temperature power spectrum on small scales (below 1 deg) motivate the need for an accurate model of foregrounds, which dominate the primary signal at these multipoles. In a previous work, we have shown that cosmological information could be retrieved from the power spectrum of the thermal Sunyaev Zel’dovich (SZ) effect. In this work, we introduce a physically motivated model of the Epoch of Reionisation in the cosmological analysis of CMB data, which is coherent on all scales. In particular, at high multipoles, the power spectrum of the kinetic SZ (kSZ) effect is inferred from a set of cosmological and reionisation parameters by a machine-learning algorithm. First including an asymmetric parameterisation of the reionisation history in the Planck 2018 data analysis, we retrieve a value of the Thomson optical depth consistent with previous results, but stemming from a completely different history of reionisation in which the first luminous sources light up as early as z = 15. Considering the latest small-scale data from the South Pole telescope (SPT) and letting the cosmology free to vary, we find that including the new cosmology-dependent tSZ and kSZ spectra helps tighten the constraints on their amplitudes by breaking their degeneracy. We report a 5σ measurement of the kSZ signal at ℓ = 3000, D3000kSZ = 3.4−0.3+0.5 μK2 at the 68% confidence level (C.L.), marginalised over cosmology, as well as an upper limit on the patchy signal from reionisation D3000pkSZ < 1.6 μK2 (95% C.L.). Additionally, we find that the SPT data favour slightly earlier reionisation scenarios than Planck, leading to τ = 0.062−0.015+0.012 and a reionisation midpoint zre = 7.9−1.3+1.1 (68% C.L.), which is in line with constraints from high-redshift quasars and galaxies.