SCD40 deep_sleep is not working

Hi! I have a question regarding the deep_sleep and SCD40.

My goal is:
I would like to use it with a batteries and use the least amount of power to have batteries to live around 3-4 months, for that I would like:

  1. Get metrics
  2. Go to sleep for 5 minutes
  3. Repeat the cycle

Here is my config:

esp32:
  board: esp32-c3-devkitm-1
  framework:
    type: esp-idf

captive_portal:
  
logger:
api:

i2c:
  sda: 8 # pin 21 for an ESP32
  scl: 9 # pin 22 for an ESP32
  scan: true


# Sensors definitions
sensor:
  - platform: scd4x
    id: scd4x_sensor   
    co2:
      name: "SCD40 CO2"
      id: co2_sensor
      filters:
      - filter_out: NaN
      on_value: 
        then:
        - delay: 2s # wait till metrics are published via API
        - deep_sleep.enter:
           id: deep_sleep1
    temperature:
      name: "CO2 temperature"
    humidity:
      name: "CO2 humidity"
    update_interval: 30s                  # must be >= 30 s when using low_power_periodic
    measurement_mode: low_power_periodic  

deep_sleep:
  id: deep_sleep1
  #run_duration: 40s
  sleep_duration: 5min       

After the first measurement the device goes to sleep properly, but after next book it’s keep reporting metrics without going to sleep.

Looks like after reboot/deep_sleep, this on_value option is not working anymore.

Am I missing something here?
Thank you

So what you get on esaphome logs when it doesn’t respect your sleep order?