i made a sensor go get a nofitication when the postman has a letter
the hardware is esp32-c3
some leds as indicators
a normal closed switch on gpio4 ( with a pulup resistor )
so gpio4 is LOW when triggered
this setup an yaml works on my testbench and when i boot the esp32 when gpio4 is HIGH
then deepsleep and awake works fine
but when i reboot the esp32 when the gpio4 is LOW , then i cant wakeup the esp32 , and stays sleeping forever
i tried the deepsleep settings , ignore , inverted , keepawake
pullup , inverted , etc…
what can i also try to do ?
kind regards
esphome:
name: mini
friendly_name: Mini
deep_sleep:
id: deep_sleep_control
#sleep_duration: 5min
run_duration:
default: 45s # enough to do ota te kunnen doen na reset
gpio_wakeup_reason: 43s #als de pir wakker is , maak hem nog een beetje wakend
wakeup_pin:
number: GPIO4
allow_other_uses: true
inverted: False
wakeup_pin_mode : INVERT_WAKEUP
# Create an interval to check WiFi status and control the light
interval:
- interval: 300ms
then:
if:
condition:
not:
wifi.connected:
then:
- light.toggle: integratedled
esp32:
board: esp32-c3-devkitm-1
framework:
type: arduino
substitutions:
device_name: MiniESP_C3
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "KGLmQ6JLgONOqFZJVVC2Rc6euKyHK32rX/bk7Z2VEO8="
ota:
platform: esphome
password: "4a2cd29cf96d59c1f4fd233eb3c0ae4f"
web_server:
port : 80
mqtt:
broker: !secret mqtt_broker
username: !secret mqtt_user
password: !secret mqtt_password
on_connect:
then:
- delay: 1ms
- light.toggle : blauw
- mqtt.publish:
topic : "mini/brievenbusmqtt"
payload: "postbrief_open"
wifi:
on_connect:
then:
- light.turn_on: integratedled
- delay: 2500ms
- light.turn_off: integratedled
ssid: !secret wifi_ssid
password: !secret wifi_password
output_power: 8.5
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "brievenbusHotspot"
password: "kipkipkip"
captive_portal:
text_sensor:
- platform: wifi_info
ip_address:
name: "IP"
mac_address:
name: " mac"
switch:
- platform: restart
name: " restart"
- platform: gpio
pin: 9
id : latch_uitzetten
name: "latch_uitzetten"
internal: True
output:
- platform: gpio
pin: 8 #heeft de blauwe led in de button
id: led_output
inverted: True
- platform: gpio
pin: 3 #heeft de blauwe led in de button
id: pcbledrood
inverted: False
light:
- platform: binary
name: blauw
output: led_output
id : blauw
- platform: binary
name: integratedled
output: pcbledrood
id : integratedled
sensor:
- platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
name: "wiFi Signal dB"
id: wifi_signal_db
update_interval: 80s
entity_category: "diagnostic"
disabled_by_default: true
internal: true
- platform: copy # Reports the WiFi signal strength in %
source_id: wifi_signal_db
name: "WiFi_Pct"
filters:
- lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
unit_of_measurement: "%"
entity_category: "diagnostic"
button:
- platform: template
name: "gotodeepsleep"
id : gotodeepsleep
on_press:
- deep_sleep.enter: deep_sleep_control
binary_sensor:
- platform: gpio
pin:
number: GPIO4
allow_other_uses: true
inverted: False
name: "postbusklep"
on_press:
then:
- light.toggle: integratedled
- delay: 300ms
- light.toggle: integratedled
- delay: 300ms
- light.toggle: integratedled
- delay: 300ms
- light.toggle: integratedled
- deep_sleep.prevent: deep_sleep_control