We demonstrate a microfiber Bragg grating as the reflective refractometer with the function of self-photoheating. The rare earth-doped fiber provides not only the photosensitivity to the UV modulation but also the effective pump laser absorption and photoheating conversion. The rare earth-doped microfiber Bragg grating, which is cladding-removed by the hydrofluoric acid, can detect the tiny refractive index change with a resolution of 10 <sup xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">-4</sup> RIU scale. The self-photoheating could be realized by 980 nm pump absorption and non-radiative transition process of the ytterbium and erbium ions, which are well-preserved by the core structure after etching. Monitored by the reflective grating signal, the photoheating can manipulate 30 °C increase of the device in the air, 8 °C in the ethanol, and 4 °C in the water. The second time-scale heating/cooling response allows the sensor to act as ad optical switch for engineering temperature. The work may open a new route for accelerative biosensing and pollutant determination and treatment.