Lithium-ion batteries (LIBs) have a wide range of applications in energy storage power stations. However, thermal runaway of LIBs can lead to serious safety accidents and cause significant losses. Therefore, it is particularly important to carry out early security warning of LIBs. And H2 2 is generated along with the growth of lithium dendrites, which can serve as an effective indicator for detecting LIBs before TR. In this paper, In2O3/NiO 2 O 3 /NiO nanocomposites were prepared, and five groups of samples were systematically prepared by adjusting the molar ratio of In and Ni. X-ray diffraction (XRD), scanning electron microscopy (SEM), transmission electron microscopy (TEM), X-ray photoelectron spectroscopy (XPS) and other test methods were used to characterize the prepared nanocomposites. Through experiments, the best samples among several groups of samples were determined. When the test gas is introduced, the resistance change of this optimal sensor is the greatest, indicating the best performance, which is significantly better than pure In2O3 2 O 3 and pure NiO samples. Furthermore, compared to other gases, this nanocomposite sensor exhibits significant selectivity towards H2. 2 . The results show that In2O3/NiO 2 O 3 /NiO is a promising candidate material for room temperature H2 2 detection, and provide suggestions for the development of gas sensors with heterogeneous structures.