I suspect this has been done before, but last year I put together an automation that would stop my phone charging once it reached a certain battery charge level (say 80%). The aim was to reduce the battery degradation I had seen with my previous phones (typically around 50% degradation after two years). I had read some information suggesting that charging the battery to a high voltage, and/or keeping it at high voltage was detrimental to battery life.
I’ve finally put together a blog post describing what I did.
After around 8 months of using this and other methods to limit my battery charge level, the results seem promising, but it’s probably still a bit early to tell if or how much it’s improving the situation.
This looks really cool, though I will have to ask you what kind of phone you are using. I ask this because iPhones for example already do this with software since iOS 13.
If that is the case your results might deceive you. But I like the idea!
Hi @jimz011 , I have an Android phone which doesn’t have that functionality.
However, I think the new iPhone charging algorithm doesn’t actually prevent charging over a certain level; it just aims to reduce the time the phone spends above 80% charge by attempting to predict when you are going to unplug it, and only fully charging it as that time approaches. This has the benefit of giving you a full charge when you want it (hopefully), but does still mean the battery regularly sees the high voltages that might increase degradation. It’s a good step though, and no doubt something similar will appear in Android which could make my automation obsolete!
ive done something similiar, but expect looking at that google template i use the ha app 2.0 integration for iphone (perhaps this works with the android app as well) which also reports battery level & state paired with a energymonitoring plug u can determin if the phone is connected or not
Yes, I had thought about switching to using the Home Assistant app, but it was released after I set this up, and I haven’t bothered to do that yet. I’m also a bit reluctant to have another app doing location tracking, if Google Maps is already doing it.
So how do you detect if the phone is connected? Do you make sure the smart plug is turned on and then assume a phone is connected when the power consumption jumps?
im on the way to try your approach because i really had problems with ha 2.0 to work reliably, the sensors often only updates if u had used the app bevor - probably a problem of my old iphone 6 (low mem, no real multitasking). The energymonitor is included because of that lack of reliability and it therefor checks if the state really matches the situation = if the battery pushes a command (in my case battery > 95%) he looks if something is connected then turns the plug off=)
I’ve found the Google Maps reporting to be reasonably reliable on an Android device, although it can be delayed by a number of minutes sometimes. Not sure how well it would work with an iPhone, but hopefully it would be similar.
ill try, but except of the lack reliability probably because of my old hardware i would advertise you for the ha 2.0 integration, its really amazing what that app can and how easy it gets integrated in ha and what tons of sensors u get
… But then I noticed that my battery level wasn’t updating quickly enough, and therefore I was waking up to my phone being at 95%+. After reviewing the Android App documentation, I found that each location request also updates the battery level and state.
This automation calls a script:
- alias: 'Update Phone Battery Level for Charging'
initial_state: 'on'
trigger:
- platform: state
entity_id: switch.string_lights_switch
from: 'off'
to: 'on'
action:
- delay:
minutes: 2
- service: script.update_angelo_phone_battery_1
This script then creates a 5 minute loop that moves back and forth between another script until the phone’s charger has been turned off. Script 1
This worked a treat last night. My phone was on 79% when I woke up at 6:30 AM. I also set my phone (Oppo Reno 5G) to automatically switch off at 3:00 AM every morning to conserve battery when it should have charged to 80%.
im sorry, I can’t. I have rewritten my node red completely and this got kicked out because as mentioned bevor there was a lack of reliability which only got this working if the app got opened. but if you try to recreate and get to problems you could post them here and ill try to fix that!