Solid-state NMR measurements at 21.1 T recorded with a Hahn-echo pulse sequence: a 133Cs spectra at 20 kHz magic angle spinning (MAS) of crystalline CsI, the CsI–DB21C7 powder, the FAPbI3 thin film treated with CsI–DB21C7 (thin film) and a sample of FAPbI3 mixed with CsI–DB21C7 complex (bulk). b 14N spectra at 5 or 10 kHz MAS and ambient temperature of the treated samples and powders prepared by mechanochemical synthesis of pure FAPbI3. c Schematic representation of inhomogeneous (1 × 4 and 2 × 2) and homogeneous (4 × 1) models (M1–M3) of Cs-doped FAPbI3 structures and their DFT-calculated band gap (Eg) values associated with each configuration. The difference in the bandgap between the experimental and theoretical values is mainly due to finite temperature effects (more details provided in the supplementary materials). d Density of states of FAI-terminated pristine FAPbI3, FAPbI3 containing a FA+ vacancy and Cs+-treated FAPbI3 with a FA+ vacancy. For readability purposes, the density of states has been mirrored for the treated system.