A battery-powered sensor should sleep almost all the time. In deep sleep an ESP32 uses a tiny fraction of its normal current, wakes up, measures, sends, and sleeps again.
void setup() { // ...read the sensor and send the value... esp_sleep_enable_timer_wakeup(10ULL * 60 * 1000000); // 10 minutes in microseconds esp_deep_sleep_start(); } void loop() {} // never reached