![]() Even though I'm using Arduino as the IDE, I'm still using the 2 functions provided by espressif libraries, which are:Įsp_err_t esp_sleep_enable_timer_wakeup(uint64_t time_in_us) I'm able to send the device to sleep for a little over 3 hours maximum, but if I insert a higher amount of time (expressed in microseconds) it causes an overflow. The issue I'm having is about the DeepSleep feature. The board is ESP32-based, from WaveShare displays. It is going to be much easier to turn it on and off that way.I'm currently working on a IoT project. I will probably get rid of MQTT for preventing deep sleep and implement a button for this purpose. Id(inside_temperature_bmp_received).state &įormat: "All sensors updated after %.1f seconds of uptime. Id(inside_temperature_dht_received).state & Will be false even if only one sensor fails. # Only specifying an id without a name will implicitly set this to true. # Internal components will not be exposed to the frontend (like Home Assistant). Again huge thanks to user Mahko_Mahko on Home Assistant Community for providing his configuration example. logger.log: "One or more sensor updates missing" ![]() logger.log: "Data from all sensors received" binary_sensor.is_on: all_updates_received delay: 2000ms # DHT11 is a really slow sensor #Then the ESP goes back to sleep when they're done (unless told to stay awake) #Sensor updates are turned off and manually requested on boot. Then: # At this priority, pretty much everything should already be initialized. I included his practices in my configuration to make it work. Here is the config I have written with the help of your example: # Huge thanks to user Mahko_Mahko on Home Assistant Community for providing his configuration example. I made it! Thanks to your config example I managed to trigger deep sleep after all the sensors send their data. logger.log: "OTA mode enabled - deep sleep mode disabled" Esphome always sends the readings on boot. # Update interval has no effect when deep sleep is in use and it is longer than run_duration. # Enable fallback hotspot (captive portal) in case wifi connection fails The following is my current config: esphome: Has anyone managed to achieve something similar? Since I have very little experience with ESPHome and setting up automations, I would really appreciate any help on this topic. Maybe it could be done with on_value automation on sensor? My guess is the wanted behavior could be achieved by setting up automation in combination with some scripts. ![]() So the run_time should be set to at least 1 minute in order to get the readings, but my goal is to enter deep sleep automatically as soon as all the sensors are done sending their data. Based on the logs, it takes from 3s up to 50s between BMP280 and DHT11 reading. I noticed that especially DHT11 is very inconsistent with reporting values. My goal is to keep the ESP awake for enough time to read and report the values from both sensors and go to sleep after that. I have two sensors connected to my ESP32 - DHT11 for humidity and BMP280 for temperature and pressure. Hello, I have been struggling for the past day to understand how to make sensors work in combination with deep sleep.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |