Time to battery charge?

DeLiGeNnC

New member
Hello!

How can I tell the remaining charge time of the battery?

The battery is charging! Time to expiry: like [hh:mm]
 

420

Active member
Sorry, I don't do much coding. can you write this as code for me?
You want to know howlong it will take to fully charge the battery right?

This is not precise but it should give a good estimate of howlong it will take to fully charge the battery, or maybe you can use it as a starting point to create your own version:

Screenshot_20210906-161512.png

It will calculate the average time it takes (in seconds) to charge 1%, then it will subtract the current battery level from 100 (to get the difference between the two) and multiplies that by the time it takes to charge 1%, and then finally it divides that by 60 to give you the estimated time (in minutes) untill the battery is fully charged.
 

420

Active member
You really did an excellent job. I am thankful to you.
Something just came to my mind... i think It would be even better if you set it up to calculate the time it took to charge the last 1%, instead of the average time to charge 1%, this way it will be able to adjust to changes in power consumption.

I have not thought about how to set this up exactly, but it would be more accurate!
 

Dm114

Well-known member
Something just came to my mind... i think It would be even better if you set it up to calculate the time it took to charge the last 1%, instead of the average time to charge 1%, this way it will be able to adjust to changes in power consumption.

I have not thought about how to set this up exactly, but it would be more accurate!
I used to calculate from the last 3% (instead of 1%) not to be penalized by a sudden increase in battery consumption due to momentarily use of a particularly draining app.

But now I use KWGT whose accuracy is even better.
 

DeLiGeNnC

New member
I didn't fully learn to code. That's why I'm just trying to do what I can think of right now. I still haven't been able to do this application. :)
 

Dm114

Well-known member
I didn't fully learn to code. That's why I'm just trying to do what I can think of right now. I still haven't been able to do this application. :)
You're right: coding is not so easy. Mainly with this kind of app. First, think how you logically would solve your problem, without taking into account the programming language. Then, when you get it, find the actions you'll have to use to convert what your mind has elaborated...

Good luck.
 

Elderfang

New member
Can't figure out how to grab these into macrodroid but they look a lot like what I want for my current battery status macro I am working on. Thank you for sharing your talent with us.
 
Top