Remaining battery charge time.

Post your questions and help other users.

Moderator: Martin

Post Reply
akapelis
Posts: 41
Joined: 13 Jul 2016 20:51

Remaining battery charge time.

Post by akapelis » 21 Jun 2017 21:33

I know it is useless, but I would like to write a flow to calculate (approximately) the remaining battery charge time in minutes.
The parameters I used (in a script) are:

InitialCharge = battery_level (Used only once at the beginning of the flow - Suppose it is 20%)
Charge_Difference = battery_level - InitialCharge; //(suppose its 70%-20%= 50%)
Charge_Difference2 = 100-InitialCharge; //(100% - 20% = 80%)
Minutes_now = getDate ();
Minutes = ((Minutes_now-triggertime)/1000)/60;
Remaining_minutes=(Minutes*Charge_Difference2)/Charge_Difference;

The trigger is "Power source connected".

The result is wrong because the 95% charge, tells me that missing 80 minutes or more to fully charge.
Thanks for any suggestion :-)

User avatar
Bingwu
Posts: 114
Joined: 26 Feb 2016 10:26

Re: Remaining battery charge time.

Post by Bingwu » 23 Jun 2017 08:20

Ciao Akapelis!

Maybe your problem is at the divisors.
Perhaps this information will help you: http://automagic4android.com/forum/view ... sion#p8246 (or http://automagic4android.com/forum/view ... 727#p17724)

regards
Peter

akapelis
Posts: 41
Joined: 13 Jul 2016 20:51

Re: Remaining battery charge time.

Post by akapelis » 25 Jun 2017 15:52

Thanks Peter, I'll try it.

Post Reply