Hello everyone,
I’m very strongly into battery management. I take care of various iOS devices’ batteries by having installed the iOS companion app and using the device_battery_level and device_battery_state to alert me in case of low or high battery (30-70%) as well as switching off the respective charger, so that ideally the battery remains in such ideal conditions.
Use case
Sometimes I’m not home and still in need of charging my phone; I thus use oldschool timers, that switch off after say two hours or so.
What I would like to do is take the percentage of the battery when charging started and when charging finished. When charging started and when it’s finished is relatively easy to identify, because of the change of state of the device_battery_state. I would need to store the percentage of the battery when charging started somewhere in order to afterwards be able to subtract the charged percentage from the initial one to illustrate the percentage gained through charging.
I would then have to set in relation the duration and the percentage gained and I would like to create a history for say 60 days, so that I can examine, how other chargers and speeds and such impact on my charging, so that next time my old fashioned timer can be set to a more exact timing.
I honestly have no idea on how to store these values in the first place, let alone placing the duration and the percentage charged in a history.
I’ve tried using sensors in configuration.yaml, automations, input_numbers, the persistant notification, but everything that was showing was far from my goal.
I am seeking advice now on what you’d think would be the best approach.
Goal
My goal is to have a list that says:
iPhone: Charging duration: 1:25h, Charging percentage: 43%,
Charging duration: 0:53h, Charging percentage: 37%.
May I ask for your recommendations? I’ve so far only used the config.yaml, and automations, I’ve got no experience yet in python or the float & or int values.
Any input is greatly appreciated, thank you very much in advance.