ESPHOME - magnetic garden gate sensor

Hi,
I am working on a project to create a solar powered garden gate sensor. There is plenty of examples out there for solar weather stations on running on esp but I am stripping the sensor part and replacing it with magnetic reed sensor.

I think I have got all the parts sorted (just waiting for aliexpress to deliver all the bits) but the one thing that I still need to sort out is the deep sleep matter. I want the device to only wake up when the gate is opened or closed so reading the esphome docs I will have to use ESP32 as they only appear to have the option to use wake up pins. I have a couple of NodeMCU ESP32 boards available so I was thinking about using that (unless someone can suggest something less power hungry)
The magnetic sensor has two wires one connected to GND second one to a GPIO pin ( I picked pin 4 as according to the esphome documentation that is one of the wakeup pins)
My basic config base on what I understand about the deep sleep and wake up pin:

binary_sensor:
  - platform: gpio
    pin:
      number: 4
      mode: INPUT_PULLUP
    name: "Garden gate open"
    device_class: door

deep_sleep:
  wakeup_pin: 4

Is that correct?