DSM timer , accumalative timer with display

hello everyone , i am a newbie
hope your all keeping well.

sorry if this has been answered before , i did a search and found similar stuff, but that did not work for my flow.
so i have a mqtt device , that gives me a payload of 1 when running and 0 when stopped
i want to make a timer that shows total run time , so every time it sees a 1 , it starts the clock ticking again and adds to the total time. if it sees a 0 the clock stops where it is at. and if it sees the word reset , it resets back to 0
ideally i. would like this to display in a window on dashboard ie " engine total running time "
which would should live the running time.

i have looked at all the nodes available and none seem to fit my needs
if anyone could help me , i would really appreciate it