Esp8266 deep sleep interval

Hi, today i have made esp8266 based temp sensor. I have enabled deep sleep and it works buti cannot change deep sleep interval. Regardless of what interval I set it wakes up fter 5 min. Is there solution to it? Did any of you guys encouter similar problem? Im o the latest esphome. Sensor I am using is some bmp280 I think. I would be grateful for help.


Without knowing your code for that sensor in ESPHome, we cannot help.
Also “latest version” is not a version :smiley: 2022.3.1 should be the version right now.

Sorry for my ignorance. Here is the code:


  name: sensor-outside

  friendly_name: Sensor Outside


    priority: -100


      - delay: 2min

      - deep_sleep.enter: deep_sleep_1



  board: nodemcuv2





  ssid: XXWiFi

  password: passwdXXX


    static_ip: 192.168.1.XXX



  fast_connect: True  


  sda: GPIO05

  scl: GPIO04

  scan: False

  id: bus_a


  - platform: bmp280


      name: "Outside Temperature"

      oversampling: 16x


      name: "Outside Pressure"

    address: 0x76

    update_interval: 5s  

  - platform: adc

    pin: A0

    name: "Outside Sensor Battery"

    device_class: battery

    update_interval: 5s

    unit_of_measurement: "%"

    accuracy_decimals: 0


      - multiply: 9

      - calibrate_linear:

          - 3 -> 0

          - 9 -> 100    


  id: deep_sleep_1  

  run_duration: 30s

  sleep_duration: 600s

esphome version is : 2023.5.5

Thank You :slight_smile:

  1. Why?
  2. Your code is set to 10 minutes.

I have no idea if this would work, but maybe use a numeric helper entity in Home Assistant and then a value template in the ESPHome code. That’s the limit of my knowledge.

Hi. Thans for the input. I can set any value I want but regardless it will wake up and produce data in ha history graph every 5 mins

OK, I thought you were trying to dynamically change the sleep time.
Are you sure the ESP is going to sleep? Just watch the device in ESPHome panel and watch if it actually goes to sleep.


I did make sure that it was online when i have flashed it wirelessly with new values. Esp does go to sleep and shows up after 5 min :man_shrugging:t2:

You are saying that it goes online for 30 seconds then offline?


Yes, thats correct

I’ll run your code later tonight to see what it does here. Which ESP board, specifically, are you using?

Nodemcu v2 i belive it is 12F. Thank you

I can’t duplicate your sleep problem. My NodeMCU sleeps for ten minutes reliably.
You do have GPIO16 connected to RST, don’t you?

Yes. I will try a different microcontoler then. Thank You

I do power it by 9v battery but it should not make any difference. Should it?

Through Vin, it should be OK. But, when the ESP is powering the WiFi transceiver it can draw 200mA, sucking the battery pretty fast. Is the sensor powered all the time? You wouldn’t know if the reboot is from the GPIO16-RST or the battery low because reboot is what waking from deep-sleep does.

Try powering it from a USB supply to rule that out.

I am not ready to suggest a different processor board, but if you have a few handy, then it can’t hurt.

I use 9v rechargeble 800mah. It was fresh and I tried 2 of them

I have reused microcontoler from previous wled project. Can it ba a problem?

No. I reuse my ESP boards all the time. I would still want to use a USB power brick without the battery attached to rule out a power issue.