Was wondering if you’d share your full yaml for point of reference for a novice users like myself.
I’m still trying to figure out how to trigger the wake-up from multiple pins (32 & 26). Would anyone be able to share a snippet of their deep_sleep yaml on a configuration with multiple pins?
Hello,
I’m taking some inspiration from this project, but I want to make mine wireless and thus use a battery which limits powered on time. I have looked through a couple threads, but still not making progress.
I’m using an ESP32 with 6 capacitive touch sensors and I want to know which one woke up the ESP32 so I can perform different actions.
Here is my code so far - granted this only has 2 touch buttons, but once I figure out two I can add more. :
esphome:
name: esp-touch
on_boot:
priority: 900
then:
lambda: |-
id(wake_up_reason) = esp_sleep_get_wakeup_cause();
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: "6cbeb276258987c189ca430f8a73ad1d"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esp-Touch Fallback Hotspot"
password: "X5MyBdidHG69"
captive_portal:
deep_sleep:
run_duration: 10s
sleep_duration: 10min
esp32_ext1_wakeup:
pins:
- 4
- 15
mode: ANY_HIGH
globals:
- id: wake_up_reason
type: int
restore_value: no
initial_value: '0'
sensor:
- platform: template
name: "Touch Reason"
accuracy_decimals: 0
lambda: |-
return (id(wake_up_reason));
# Example configuration entry
esp32_touch:
setup_mode: false
binary_sensor:
- platform: esp32_touch
name: "ESP32 Touch Pad GPIO4"
pin: GPIO4
threshold: 1000
- platform: esp32_touch
name: "ESP32 Touch Pad GPIO15"
pin: GPIO15
threshold: 1000
Any help would be really appreciated and I’m sure others will benefit as I have seen this question asked in many places.
Hello,
I’m also trying to figure out how to trigger wake-up from multiple pins (32 + 35) using a esp32 d1 mini.
GPIO 32 => PIR Motion Dedector
GPIO 35 => Push Button with external pull down resistor
I’m using the following the following configuration:
deep_sleep:
id: deep_sleep_1
run_duration: 120s
esp32_ext1_wakeup:
pins:
- 35
- 32
mode: ANY_HIGH
Boot:
on_boot:
priority: -100
then:
- mqtt.publish:
topic: wakeup/test2
payload: !lambda |-
return "Reason: " + esp_sleep_get_ext1_wakeup_status();
The wakeup it self is working fine on both pins. But when I check the MQTT Message “esp_sleep_get_ext1_wakeup_status();” returns no value.
Nachricht 10 empfangen auf wakeup/test2 um 9:21:
Reason:
ok, the reason seems to be:
if you are using GPIO’s > 30 you can’t use an int as variable, because it would overflow the range.
you need to use unit64_t
how did you do that, are you able to share your code?
This code doesn’t work for, the output is always a 2 - is that right ?
What the F*** is wrong with posting on this forum?
The following works and was tested with ESPHome 2023.12.5
esphome:
name: esp32-wroom
friendly_name: ESP32 wroom
on_boot:
priority: -100
then:
- mqtt.publish:
topic: wakeup/test
payload: !lambda |-
uint64_t wake = esp_sleep_get_ext1_wakeup_status();
uint32_t low = wake % 0xFFFFFFFF;
uint32_t high = (wake>> 32) % 0xFFFFFFFF;
if ((low) & (1<<(13))) {
return "Pin 13 woke me up";
}
if ((low) & (1<<(14))) {
return "Pin 14 woke me up";
}
return "Woke up without an event";
Hello,
How you use other pins for deep sleep wakeup?
Always i have this error in my code:
Only pins 0, 1, 2, 3, 4, 5 support wakeup.
Thanks