![]() ![]() In the above config blank birth/will are now commented out. I also had blank birth and will messages to disable availability reporting and make the graphs look better, I don’t know if that exposes different behaviour. At the moment it seems that readings are scheduled on a variable basis. My update interval was set to 43mins, I have removed it for now, and am inclined to set it to something very small and rely on my automation to make the device sleep again. It is important to know that if your sensor update_interval is longer that your run_time it has no effect, or at least that is what I was told by Otto, the update_interval time elapsed is not stored anywhere on non volatile storage, so gets reinitialized every time the device wakes from sleep. Otto has told me that run_duration starts being counted after MQTT is connected, this is important to know, so that should take care of variable time connecting to wifi and connecting to mqtt broker. When I deploy this on another remote network I get different behavior. I did some testing on my network and my bme280 + esp32 was waking and sending readings and going back to sleep within 2 seconds, then sleeping for an hour. I am facing challenges with deep_sleep too. You could take a reading every 15 to 30 minutes and get the same sort of graph, except at the the times right when you turn the pile (if you ever do). And to be honest even that is probably overkill for a compost heap. It just means you only get an update every 4 minutes. So if you designed your battery for that, then longer wake and sleep should be the same average drain. Your previous 10s wake 20s sleep duty cycle is the exactly equivalent battery drain to 2 min wake 4min sleep. It’s a different story for analogue sensors that have to report in regularly as you are discovering. If (id(reed_switch).state) return "topic1" īut you still have to wait for the first reading from the sensor.īoth my mailbox and lane gate binary sensors wake for 2 minutes but as they only have to wake when something changes (or every 6 hours to report the are still there) they spend 99% of their time asleep and one 18650 cell and a 5W 5V solar panel runs them forever. Something like below - but to get status, you would probably need to make a template… and you would have to do it for each sensor… : You should be able to put something int he “on boot” of ESPHome config: How to publish sensor states at boot? ESPHome topic: home/outside/compost_bin/ota_mode Topic: home/outside/compost_bin/availability But how do I tie it all together? How can I get it to read a measurement from the DS18B20 on wakeup and then post it to a MQTT topic, before going back to sleep? I’ve got the sensor working, deep sleep working and MQTT broker connection working. I want the sensor to deep sleep for a while, wake up and measure the temperature using a DS18B20 and post the result on a MQTT topic, and then go back to sleep. ![]() I’m creating a battery powered temperature sensor for my compost bin. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |