adas4190
(Adas4190)
June 5, 2023, 7:54pm
1
Hi, today i have made esp8266 based temp sensor. I have enabled deep sleep and it works buti cannot change deep sleep interval. Regardless of what interval I set it wakes up fter 5 min. Is there solution to it? Did any of you guys encouter similar problem? Im o the latest esphome. Sensor I am using is some bmp280 I think. I would be grateful for help.
Thanks
Dujith
(Charles Evers)
June 5, 2023, 8:04pm
2
Before we begin…
This forum is not a helpdesk
The people here don’t work for Home Assistant, that’s an open source project. We are volunteering our free time to help others. Not all topics may get an answer, never mind one that helps you solve your problem.
[image]
This also isn’t a general home automation forum, this is a forum for Home Assistant and things related to it. Any question about Home Assistant, and about using things with Home Assistant, is welcome here. We can’t help you with e…
Without knowing your code for that sensor in ESPHome, we cannot help.
Also “latest version” is not a version 2022.3.1 should be the version right now.
adas4190
(Adas4190)
June 5, 2023, 9:27pm
3
Sorry for my ignorance. Here is the code:
esphome:
name: sensor-outside
friendly_name: Sensor Outside
on_boot:
priority: -100
then:
- delay: 2min
- deep_sleep.enter: deep_sleep_1
esp8266:
board: nodemcuv2
logger:
api:
ota:
wifi:
ssid: XXWiFi
password: passwdXXX
manual_ip:
static_ip: 192.168.1.XXX
gateway: 192.168.1.1
subnet: 255.255.255.0
fast_connect: True
i2c:
sda: GPIO05
scl: GPIO04
scan: False
id: bus_a
sensor:
- platform: bmp280
temperature:
name: "Outside Temperature"
oversampling: 16x
pressure:
name: "Outside Pressure"
address: 0x76
update_interval: 5s
- platform: adc
pin: A0
name: "Outside Sensor Battery"
device_class: battery
update_interval: 5s
unit_of_measurement: "%"
accuracy_decimals: 0
filters:
- multiply: 9
- calibrate_linear:
- 3 -> 0
- 9 -> 100
deep_sleep:
id: deep_sleep_1
run_duration: 30s
sleep_duration: 600s
esphome version is : 2023.5.5
stevemann
(Stephen Mann (YAML-challenged))
June 5, 2023, 9:41pm
5
Why?
Your code is set to 10 minutes.
I have no idea if this would work, but maybe use a numeric helper entity in Home Assistant and then a value template in the ESPHome code. That’s the limit of my knowledge.
adas4190
(Adas4190)
June 5, 2023, 9:43pm
6
Hi. Thans for the input. I can set any value I want but regardless it will wake up and produce data in ha history graph every 5 mins
stevemann
(Stephen Mann (YAML-challenged))
June 5, 2023, 9:57pm
8
OK, I thought you were trying to dynamically change the sleep time.
Are you sure the ESP is going to sleep? Just watch the device in ESPHome panel and watch if it actually goes to sleep.
adas4190
(Adas4190)
June 5, 2023, 9:59pm
9
I did make sure that it was online when i have flashed it wirelessly with new values. Esp does go to sleep and shows up after 5 min
stevemann
(Stephen Mann (YAML-challenged))
June 5, 2023, 10:01pm
10
You are saying that it goes online for 30 seconds then offline?
stevemann
(Stephen Mann (YAML-challenged))
June 5, 2023, 11:01pm
12
I’ll run your code later tonight to see what it does here. Which ESP board, specifically, are you using?
adas4190
(Adas4190)
June 5, 2023, 11:32pm
13
Nodemcu v2 i belive it is 12F. Thank you
stevemann
(Stephen Mann (YAML-challenged))
June 6, 2023, 3:37am
14
I can’t duplicate your sleep problem. My NodeMCU sleeps for ten minutes reliably.
You do have GPIO16 connected to RST, don’t you?
adas4190
(Adas4190)
June 6, 2023, 4:03am
15
Yes. I will try a different microcontoler then. Thank You
adas4190
(Adas4190)
June 6, 2023, 4:06am
16
I do power it by 9v battery but it should not make any difference. Should it?
stevemann
(Stephen Mann (YAML-challenged))
June 6, 2023, 4:47am
17
Through Vin, it should be OK. But, when the ESP is powering the WiFi transceiver it can draw 200mA, sucking the battery pretty fast. Is the sensor powered all the time? You wouldn’t know if the reboot is from the GPIO16-RST or the battery low because reboot is what waking from deep-sleep does.
Try powering it from a USB supply to rule that out.
I am not ready to suggest a different processor board, but if you have a few handy, then it can’t hurt.
adas4190
(Adas4190)
June 6, 2023, 9:51am
18
I use 9v rechargeble 800mah. It was fresh and I tried 2 of them
adas4190
(Adas4190)
June 6, 2023, 10:08am
19
I have reused microcontoler from previous wled project. Can it ba a problem?
stevemann
(Stephen Mann (YAML-challenged))
June 6, 2023, 8:17pm
20
No. I reuse my ESP boards all the time. I would still want to use a USB power brick without the battery attached to rule out a power issue.