Well, starting from that, your list of medicines could become “trips” with known mileage/usage information.
Also, as you indicated, you’d want to be able to enter new trips with formerly unknown usage information.
You would still need a log (with a date/time stamp) of when you took the trip. You could add a button to the “trips” screen “record this trip” which could automatically log an entry for you, and you could have a screen that allows you also manually to enter a log.
Then you’d use @ThinhDinh’s method of calculating a running total of the mileage/usage information to determine when to charge the battery: Running Totals - #2 by ThinhDinh
That said, you’'d need to modify the running total only to assess rows that had only accumulated since the last charge.
That would be the basics, I think.