The number shown under shower time is a ~current full time stamp. It looks like you’re just passing the inject nodes time stamp. That number is how many milliseconds since 1970. I dont think that is what you want in seconds.
If the start time is saved somewhere, then the difference between the two will be the running shower time.
These states are normally saved as a number, which is the number of second, milliseconds or similar since a specific date.
If you save the start time and the running time in the same program, then the specific date will be the same and the unit will also, so just subtract the running time from the start time.
HA can convert these time numbers to a normal formatted date, but HA might have another unit, so you might have to mulitply or divide with 10,100 or 1000 to get the right conversion…
this may not be exactly what you are looking for, but should point you down the right path. also presumably gets rid of the need to poll a device every second.
it uses one of my favorite nodes, stoptimer-varidelay.
the bottom outputs time in normal format
check out the filter config in particular. i also just noticed i left the state as string, that should be number