# SleepHelper library (preliminary)

**URL:** <https://community.particle.io/t/sleephelper-library-preliminary/62641>\
**Category:** Libraries\
**Created:** [May 24, 2022, 9:55am UTC](https://community.particle.io/t/sleephelper-library-preliminary/62641 "2022-05-24T09:55:17Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![chipmc](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/chipmc/32/15905_2.png) [@chipmc](https://community.particle.io/u/chipmc)\
**Post date:** [May 24, 2022, 9:17pm UTC](https://community.particle.io/t/sleephelper-library-preliminary/62641/3 "2022-05-24T21:17:07Z")

</div>

@rickkas7 ,

In perusing the documentation, this looks like a fantastic addition to the Particle platform. I am particularly excited about the future development of cloud-based configuration.

One thing that seems clear is that this library could significantly simplify my code and, I hope, take care of some of the issues that have required workarounds. One of these areas is in battery state of charge as the connection state of the device and the time since sleep can both impact SoC readings.

This brings up the first question / feature request: There has been a significant number of posts about the accuracy of state of charge measurements when devices sleep most of the time.

> [@deviceOS@2.2.0 - Low Battery Condition - State of Charge not getting updated](https://community.particle.io/t/deviceos-2-2-0-low-battery-condition-state-of-charge-not-getting-updated/61217/7):
>
> @Rftop , The good news is that I am doing all this work in my home office as I do not have any devices in the field with this release. As my father (almost) said “Test twice, deploy once”. To test this I take the LiPO and discharge it using my LiPO battery station. I typically discharge it to 3.77V (30% SoC) as this is my Low Battery threshold. I then put that battery on a test device and power it on leaving it connected until it reports a value of less than 30% SoC and goes into low batter…

I was wondering if this library addresses these issues or if we need to add an option for .withShouldConnectMinimumSoC() to look at a minimum battery voltage. Perhaps a .withShouldConnectMinimumVcell()?

I understand this library can be extended as you showed with the wake from button example.

Again, I believe this is a major step forward - thank you!

---

_[View the full topic](https://community.particle.io/t/sleephelper-library-preliminary/62641)._
