High selectivity and sensitivity sensing of H2S gas play a decisive role in the early detection of sulfide solid-state battery failure. Herein, we construct the CsPbBr3 perovskite-based sensor that exhibits outstanding gas-sensing performance to H2S at room temperature, including high selectivity, fast response/recovery speed (73.5/275.6 s), humidity insensitivity, and long-term stability (6 weeks without degradation). The excellent selectivity of CsPbBr3 for H2S results from the formation of lead–sulfur (Pb–S) bonds exclusive to other molecules and upshifted the Fermi level at the perovskite interface by density functional theory (DFT) calculations. The in-situ experiments reveal the interaction of Pb–S bonding and the transformation of H2S molecules on the perovskite surface. The simple synthesis method and unique sensing mechanism based on perovskite semiconductors help build the room-temperature metal halide perovskite (MHP)-based gas sensors with high selectivity and fast response/recovery speed for solid-state battery failure detection in the future.