Monitoring electrolyte components is an effective means of determining the safety status of lithium-ion batteries. In this study, indium acetate was taken as a ligand to functionalize perovskite CsPbBr 3 nanocrystals, and then the room-temperature electrolyte sensor based on CsPbBr 3 nanocrystals with ligand indium acetate was prepared. The sensor offers high response, longterm stability (21 days), and low detection limits for ethyl methyl carbonate (10 ppm), diethyl carbonate (10 ppm), and ethyl butyrate (1 ppm) gases at room temperature and boasts a fast response/recovery time (1500 ppm, 58.27/103.82 s, 33.58/40.62 s, and 45.05/103.08 s, respectively). Density functional theory results show that the gas sensitivity comes from the adsorption of an electrolyte, which changes the density-of-state distribution so that the electrical response curve changes. And using computational fluid dynamics simulation, it was found that the time required for gas detection by the built-in sensor (3.1 s) was 8.7 times shorter than that of the implantable sensor. This work provides inspiration and rationale for embedding and integrating room-temperature sensors into lithium-ion batteries to monitor safety and health conditions.