  Recent results of ground-based telescopes, giving high-quality measurements
of the CMB temperature power spectrum on small scales 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 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 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 SPT and letting the cosmology free to vary, we find that including the
new cosmology-dependent SZ spectra helps tighten the constraints on their
amplitudes by breaking their degeneracy. We report a $5\sigma$ measurement of
the kSZ signal at $\ell=3000$, $\mathcal{D}_{3000}^\mathrm{kSZ} =
3.4^{+0.5}_{-0.3}\,\mu\mathrm{K}^2$ at the 68% confidence level, marginalised
over cosmology, as well as an upper limit on the patchy signal from
reionisation $\mathcal{D}_{3000}^\mathrm{pkSZ}<1.6~\mu\mathrm{K}^2$ (95% C.L.).
Additionally, we find that the SPT data favour slightly earlier reionisation
scenarios than Planck, leading to $\tau = 0.062 ^{+0.012}_{-0.015}$ and a
reionisation midpoint $z_\mathrm{re} = 7.9^{+1.1}_{-1.3}$ (68% C.L.), which is
in line with constraints from high-redshift quasars and galaxies.
