I'm attempting to build a module to give an expected time that a home solar battery will last until. ie. Based on current discharge rate, check the difference between current battery level and full discharge level, work out the time in minutes and add to current time.
I've got it all working as far as working out the time remaining in minutes as an analog value. Adding this to current time is the headache. The screenshot shows a successful output at O78 (top-right) of 110 minutes past midnight. But this is hacked together converting current time to minutes, adding the time remaining, then take off 1440 minutes (24hrs x 60mins) from the previous value. It shows a negative value if before midnight and positive value after..... yep, not very pretty.
A lot of googling hasn't turned up anything. Any suggestions much appreciated.
Kommentar