Hi All,
I have setup an ESP32 with a switch to notify me that mail has been delivered. The configuration works well and i get notified with the switch is closed. The problem is i would like this to be battery powered and i have setup the deepsleep mode using MQTT, which again works fine BUT when i configure it with the wake up pin in never sleeps, it says setting up deepsleep then wakes up straight away.
esphome:
name: letter-box
platform: ESP32
board: esp32dev
# Enable logging
logger:
substitutions:
devicename: letter_box
# Enable Home Assistant API
#api:
# password: !secret api_password
ota:
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Letter-Box Fallback Hotspot"
password: "xWQLqBBFswGd"
binary_sensor:
- platform: status
name: "${devicename} Node Status"
id: system_status
- platform: gpio
pin:
number: 14
mode: INPUT_PULLDOWN
inverted: True
name: "letter box flap"
device_class: door
mqtt:
broker: 172.16.254.25
discovery: True
discovery_retain: True
username: mqtt-user
password: !secret mqtt_password
birth_message:
will_message:
deep_sleep:
run_duration: 60s
sleep_duration: 60s
wakeup_pin: 14
wakeup_pin_mode: INVERT_WAKEUP
sensor:
- platform: adc
pin: GPIO34
name: "$devicename Battery"
update_interval: 10s
#attenuation: 11db
#filters:
# - multiply: 3.35
switch:
- platform: restart
name: "$devicename Restart"
This is the log output, It does not matter with the switch is open or closed at the time the outcome is the same
[10:28:56][I][deep_sleep:072]: Beginning Deep Sleep
[10:29:01][I][mqtt:214]: MQTT Connected!
[10:29:01][C][deep_sleep:017]: Setting up Deep Sleep...
[10:29:01][I][app:060]: setup() finished successfully!
[10:29:01][D][binary_sensor:036]: 'letter_box Node Status': Sending state ON
[10:29:01][I][app:099]: ESPHome version 2021.10.2 compiled on Oct 25 2021, 10:22:59