Make a readable Time To Go String for Node Red

I wanted a understandable display of my remaining battery life. The Victron Node provides this in seconds. Using a Function Node, this can be converted into a string and then displayed. Here’s the flow:


In my battery dashboard the value is displayed like this:
2025-07-01 18_35_49-Victron Energy
d= days, h=hours, m=minutes.

When the battery is charging, the running time is displayed as “—”.
flows.txt (7,1 KB)