The Planck experiment has measured the Cosmic Microwave Background (CMB) angular spectrum with unprecedented accuracy, and these results are likely to remain the state-of-the art for a decade or more. Since these measurements are going to be used to forecast Euclid's ability to test alternative dark matter models, we aim to set the final CMB constraint on the cross section of dark matter-photon scattering in the early universe. As the formalism has not been published in the literature yet, we present the key steps to derive the full set of linearized Einstein and Boltzmann equations and elucidate necessary modifications to the line of sight and the tight coupling approximation. These approximation schemes are commonly used in Boltzmann codes to reduce computational costs, but the tight coupling regime has been neglected in previous works related to dark matter-photon interactions. Our computations account for a dark matter sound speed, which was neglected in previous work. We find that its effect is negligible on the CMB spectra but fairly important on the linear matter power spectrum. We then analyse the Planck data, with and without the 2015 polarisation data at high multipoles. In both cases our constraint on the ratio of the elastic scattering cross section to the dark matter mass becomes more stringent with respect to previous constraints. The change is about 35% when the full Planck dataset is added (which includes E-mode polarisation at high multipoles and the lensing potential power spectrum) and about 20%. when we only account for the polarisation data at low multipoles and the full temperature spectrum. Our most conservative limit reads as σDM-γ <= 2.25× 10-6 σTh(mDM/GeV) at 95% confidence. We do not expect this limit to change by adding the recently published SPT data.