Waking up from a deep sleep with two binary sensors

Hi everyone,
I configured two binary sensors on ESP32 D1 Mini:

binary_sensor:
  - platform: gpio
    id: door_sensor
    pin:
      number: 4
      allow_other_uses: true
      mode:
        input: True
        pullup: True
    ...

  - platform: gpio
    id: test_alarm
    pin:
      number: 33
      allow_other_uses: true
      mode:
        input: True
        pullup: True
      inverted: True
    ...

Both of them work as expected. When the ‘door_sensor’ is open, alarm rings. When ‘test_alarm’ button is pressed, the buzzer goes off for a second. The problem is, I cannot use both of them for waking up from a deep sleep.

deep_sleep:
  id: deep_sleep_1
  run_duration: 30sec
  sleep_duration: 3min
  esp32_ext1_wakeup:
    pins:
      -
        number: 4
        allow_other_uses: True
      -
        number: 33
        inverted: True
        allow_other_uses: True
        mode: INPUT_PULLUP
    mode: ANY_HIGH

Pin 4 is LOW by default, and PIN 33 is HIGH. The former wakes up from a deep sleep well. But the latter wakes up instantly after going to a deep sleep since it is HIGH when the button is not pressed. Stuck here. How can I use pin 33 to wake up properly when pressed?

Replying to my own question.
I completely misunderstood how pullup/pulldown internal/external resistors worked. In addition, I messed up the schematic, connecting cables to incorrect button leads. Third, was the problematic flickering pin. The fourth problem was using EXT1 for waking up from a deep sleep with an internal pulldown register.

I spent quite a bit of time researching and scratching my head. All this looked random to me. Now it is all fixed and works as expected. I configured an external pulldown resistor on pin 27. Now pushing the button is waking up from a deep sleep with EXT1 as expected.

1 Like

I am struggling with the same issue, could you post your working yaml file, so I can compare to what I have?