This gives you internal (chip) temperature readout of ESP32. Will run at 53 °C and go above if it is doing anything. In case the temperature is steady, try using a hair dryer to heat it up. If still steady then temperature sensor is disabled on your ESP32.
.h file goes into main folder of ESPhome
.yaml is best to open your yaml file and just replace everything except ota password