Help with deep_sleep

HI, i’m trying to setup deep sleep.

My aim is to wake on deep sleep when a binary sensor (reed switch) goes open, then return to deep sleep when the binary sensor closes.

I have tested my binary sensor and know that it is working fine,

I’ve also tried with the touch component,

I also keep getting the error that my GPIO is used in two places.

Do I HAVE to have a separate wakeup pin source to wake from deep_sleep?

Thanks

esphome:
  name: test
  friendly_name: test

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: 

ota:
  password: 

wifi:
  networks:
  - ssid: !secret wifi_ssid
    password: !secret wifi_password
  fast_connect: true


captive_portal:
  
deep_sleep:
  wakeup_pin: GPIO26
  wakeup_pin_mode: INVERT_WAKEUP
  id: deep_sleep_1

binary_sensor:
  - name: "my_binary"
    platform: gpio
    id: my_binary
    pin: GPIO26
    filters:
      invert:
    on_release:
      - deep_sleep.enter:
          id: deep_sleep_1

You haven’t said your usage for this setup. It’s possible that even if it worked you could open and close the reed switch before the esp could send out a message if it’s connecting back to HA. If it is to work as it seems you suggested then you could connect a reed switch between the power and the Vcc pin on the esp so the device would power on/off depending if magnet needed. I use a normally closed reed switch on a device in a plastic box in this manner so instead of opening the box and detaching power when I need to I just bring the magnet up to it. I power my deep sleep esps via 3.3v rather than going through the 5 v regulator to save energy. I tend to use simple barebones boards to again save energy.
Dont try and connect 5v to the 3.3vcc pin. :face_with_spiral_eyes:

Short answer: just add allow_other_uses: true to both configs for the same pin (deep_sleep and binary_sensor) and it should compile just fine.