Battery Protection for Smartphones and Tablets using Home Assistant (charges only from 20-80%)

Battery Protection for Smartphones and Tablets using Home Assistant (charges only from 20-80%)




Rechargeable batteries last way longer if we do not charge them up to 100% or fully discharge them. This is particularly important …

source

Recommended For You

About the Author: Andreas Spiess

33 Comments

  1. Interesting video. I've got a few of those "USB sonoffs" laying around doing nothing, now, I can put them to a good use. It is good you don't need to pay your wife for drinking beer. That would be too much of a punishment for me.

    Thank you for sharing. Merry Christmas

  2. Do note: that some chargers if you cut off the mains supply, can cause unregulated voltages/currents on the 5V charging port which if not handled by the phone can damage it.

  3. Simplest way to check battery level is termux and termux-battery-status. Then you can have more complex charging protocol. For example you might want more voltage on Monday mornings.

  4. I had that Idea some time ago, but since I didn't want to install additional software on my phone, I built a microcontroller into my charging cable which would monitor the current while charging. If the current goes down below maybe 50%, it recognises this as approaching the last part of the charge curve and imediatly cut the power. That way it would not go all the way to 100% but maybe stop at 90%. Unfortunatly it wasn't that reliable and the phone sometimes ended up uncharged… your solution is definitly better

  5. Here is what Samsung writes in their datasheets:
    "4. Storage

    4.1. Storage conditions

    4.1.1. The cell should be stored within a range of temperatures specified

    in the product specification.

    4.1.2. Otherwise, it may cause loss of characteristics, leakage and/or rust.

    4.2. Long-term storage

    4.2.1. The cell should be used within a short period after charging because

    long-term storage may cause loss of capacity by self-discharging.

    4.2.2. If long-term storage is necessary, the cell should be stored at lower

    voltage within a range specified in the product specification, because

    storage at higher voltage may cause loss of characteristics.

    5. Cycle life

    5.1. Cycle life performance

    5.1.1. The cell can be charged/discharged repeatedly up to times specified in

    the produce specification with a certain level of capacity also specified

    in the product specification.

    5.1.2. Cycle life may be determined by conditions of charging, discharging,

    operating temperature and/or storage."

  6. What I miss in android phones is an actual option to get slower charging. I use a laptop brick for both my laptop and my phone, which charges quickly. But if I connect my phone in the late evening, I'd like it to charge slowly to preserve battery life. And there seems to be no such option..

  7. I prefer Tasmota over ESP home since I don't need to give it fixed IP and I can gift the device to someone else. However, Sonoff has local mode ("SonoffLAN"), so it doesn't need to be flashed anymore, I still flash due to privacy reasons.
    Also, Andreas, if it's not too much of hassle, try to get a second-hand old device rather than buying a brand-new device consuming instead of recycling is just waste of resources.
    I am also not sure why did you over complicated this problem, you could have just rooted your Android and install battery limiter and use 3-meter cable to prevent quick charge.
    Overall as always very educational video! 😀

  8. In general, the "boosted charge" mode often presented as 100% full, adds 12% capacity to some devices at the cost of lifespan. Also, dropping into the CC or pre-conditioning zone (< 60%, not 20%) will cut the number of LiIon/LiPol charge cycles from around 8k to well below 4k (under 1k is common with rapid chargers,)

  9. 6:21 for anyone trying to do this in NodeRED for one reason or another, you may find that the sensor entities of your phone are not refreshed in real-time in NodeRED. To fix this, you create a helper for the sensor you're trying to analyze (like the battery percentage) and then use a Home Assistant automation to set the helper to the same value as the actual sensor. Then you can use the helper in your flow.

  10. I don’t know. My iPhone 13 Pro has been with me since october of 2021 and I’ve been fast-charging it daily. The only battery-preserving measure I’ve enabled is the setting that waits with charging it from 80 to 100% until an hour or two before my morning alarm goes off. Almost 900 charging cycles later and the battery is still healthy at 96%. I think for a lot of us technical people we are prone to be afraid of the discomfort a worn out battery would cause us to the point where we subject ourselves to more discomfort by trying to prevent it. Of course, your scenario of a always plugged-in tablet is very different and it makes a lot of sense to do this stuff there. But that’s the exception.

    But just let your phone be your phone and a battery replacement two or three years in wouldn’t be the end of the world.

    With a replacement battery after three years, your phone could last you five or six years. With no replacement and careful babying the battery and refusing a new one, you could make it four years. And then the phone is old and not worth the investment anymore so you get a brand new one.
    Especially if the old battery is properly recycled, doing a battery replacement is probably the most ecological solution.

  11. Hi Andreas,

    I use a similar system in my house, but instead of using a new tablet, I repurposed an old one with a broken battery. I followed the Great Scott video titled "Solved Samsung's Swelling Battery Problem! (Batteryless Phone)" and replaced the old battery with a diode. In your case, you can remove the new, good battery and replace it with a diode. This way, you'll have a free battery, a fully functional tablet, and one less potential fire hazard (the battery) in your home.
    Merry Christmas and I love your videos.

  12. I get my phone battery level from Owntracks through MQTT. Our Sony Xperia phones have their limit set to 90% from factory and can be set to whatever we want, nothing to DiY there.

  13. Battery charging was a subject for my whole masters & a year in bachelors. Even my work company I was in has a specific division for just battery charge cycles where it displays 100% change only at 80-92% of battery real charge. Won't believe how many phone from a decade ago do this, specially with Qualcomm's quick charge. Higher current directly to & from battery, or more cycles from full to 0 cause the most damage whereas high voltage charging can be balanced while general public fooled with wrong display. Even phone software nowadays just apply a stricter charging curve & display real values only when the software mode is enabled. So instead of targeting anywhere from 85-92%, it'll hard target the set value.

  14. I did the same thing for my Android phone, but found out that triggering from app was unreliable. I ended up setting automation in Tasker, which triggers when battery goes over 80% and then calls Home Assistant script to switch of the charger.

  15. Not related to this video but worth a shot
    Anyone know of a central heating thermostat replacement for one that is a 2 wire rotary wall one
    for a touch wifi one.
    so just removing the wall one and fitting the new one and setting the timer control box next to the boiler to on
    then using a phone app to control the heat

  16. Cool video. I'm watching over my weight too, but my method is somewhat cheaper… I keep the money and buy some more equipment.
    Also for you and your family, the best of wishes for a merry Christmas and a happy New Year!

  17. Lithium ion cells hate being held at high voltage or low voltage!
    This is a particular problem with Lithium NMC cells. Lithium iron phosphate cells are supposed to be more robust but they are less power dense — much heavier — not good for handheld/mobile devices!

  18. At work we have a QA wall with many phones testing our SW, and they're constantly connected to power.
    Finding a way to make them not die prematurely due to battery expansion turned out to be a lot harder than expected, we have a "smart" USB-hub we can turn on/off ports via an API, but this regularly fails (both phones not managing to reconnect, or the hub doing weird stuff). Even though most/many Android phones has options to limit battery level while iPhone doesn't we have yet for an iPhone to fail, while the Android tally is about 20% a year (and yes, we have many iPhones as well).

  19. Had a rich friend of the family with some samsung s and I was trying to tell him about custom roms and cheap replacement parts from China. He just laughed and said "if the phone breaks, just buy another one".

  20. 80% is not a myth. Battery is electoric-and-chemistry (not sure if I translated it right eithout a dictionary). At high state of charge the chemical reaction runs on highest intensives.
    OnePlus phones have a great feature. They charge up to 80% at night. Then charging stops. It will resume at a moment so it will be fully charged by alarm time. So I disconnect it from charger at 100%. So the time the battery is at 100% is reduced to minimum.
    I was thinking about the same as you did in you video, great job!
    Now I'm wondering if I can do something for charging a phone in the car. I don't like it's at 100% when I'm driving all day long. Disconnecting a charger will not be an option since location history will not be as accurate. It feels like I need to do some current limitation to keep the battery at about 80%. The charge level reporting is not an issue, since I'm a software developer. I can build a small app which will read it and will send it over a Bluetooth to arduino/esp device. Sounds like an interesting project!

Comments are closed.