Temperature-dependent photoluminescence (PL) as well as thermoluminescence (TL) were studied in the Eu2+-doped hydrides LiMH3 (M = Sr, Ba) and the corresponding deuterides. Here, thermally stimulated luminescence was observed for the first time in a Eu2+-doped hydrides and deuterides. The onset temperature of quenching (T95 %) and the quenching temperature (T50 %) were determined from photoluminescence intensities, and the energy barrier for thermal quenching was estimated. Then, a scheme with the localization of divalent and trivalent lanthanide 4f and 5d levels for the example LiSrH3 was proposed. In deuterides, the quenching temperatures are slightly higher than in hydrides, which can be related to the influence of the different phonon frequencies. In the TL measurements we observed very shallow and intense TL glow peaks in all samples. We also used density functional methods in order to show qualitative trends for the stability of possible defects. The model calculation suggest that energetically favo...