Hello , I have an esp01 and a button connected to the reset pin. A virtual switch should toggle when I press the reset button and then , the esp01 should return in deepsleep. However , the switch toggles only sometimes but not always and it can takes up to 2 minutes to toggle the switch . Here is my code :
esphome:
name: device-1
friendly_name: Wifi Button
on_boot:
priority: -100.0
then:
- switch.toggle: my_startup_switch
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "______________________________________-"
ota:
password: "____________"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Device-1 Fallback Hotspot"
password: "_____________"
captive_portal:
switch:
- platform: gpio
pin: 4
name: "my startup switch"
id: my_startup_switch
deep_sleep:
id: deep_sleep_1
run_duration: 25s
(I replaced the sensitives areas by lines)
Could anyone help me with my problem and say me what’s causing this?