Value to Time format

Hello,
Would you please help with the following issue?
I am posting to grafana data from the flow sensor, including the flow rate and number of litres passed(Ltr). I know that my system will stop after 1000 ltr. So I can calculate how many litres are left every second from (1000 - Ltr), and I can find how many minutes are left till the finish by ((1000-Ltr)/flowrate)). So, I only get a decimal value, for example (750.65). How can I visualise this value in my dashboard like (hh:mm:ss)? Thank you

welcome @hayderismael

What is your datasource?

1 Like

Influx db is my data source, which I save the flow rate and number of litres. There are many other data like pressures and temperatures. All work very well without problem and are shown perfectly in Grafana. I need one more visualisation for time to finish; for example, 750.65 = 12:30:39, so I can understand that after 12 hrs, 30 min, and 39 sec, the process will be completed. Thank you.

1 Like

I tried the override method but not quiet there

ok this works?

1 Like

That’s perfect , thank you so much @yosiasz

1 Like

If you want to get fancy there are count down timer plugins which will show countdown

1 Like

Thanks, @yosiasz, As the number of remaining litres decreases over time, the time will count down as a result. I tried your way, and it works. The fancy thing is to find when it finished; for instance, if the time now is 10:00:00 and it needs 5 hours to finish, the value shown will be 15:00:00 or 03:00:00 pm. I am trying to find how to add value to the now /current time in the dashboard.

1 Like

Hi @hayderismael

Does this help accomplish the above?

1 Like

Thanks alot @grant2 for your reply. Yes, it helped as I followed it to generate the current time and date. I tried to add the (hh:mm:ss) for how long the operation needs to be finished as per @yosiasz, which also worked to find the time at the finish, which meant what time the operation would be completed. I tried this, as shown in the pictures below, but I got a number followed by Tri.

I think you need to fix the override:
image

Thanks for the reply @grant2 . I fixed it, and I didn’t get the correct time; I believe I missed something. In the example below, I calculated the duration till the operation is finished, so how can I add that duration to the current time? From this example, the current date and time = 27/10/2023 14:31:39, and it needed 17:49:14 (T2F) to finish the operation; how can I add T2F to time, T2F + Time, to find the time at the finish, which should be 28/10/2023 08:20:53.

A = Total number of litres.
B = Flow rate in mL/min.
1000 is the total litres of water.
T2F = number of seconds till finish, and it converted to duration by override as per @yosiasz
I appreciate your support.

I believe the reason you cannot add the two values is because they are not compatible in their current form. Can you convert the time to epoch timestamp in milliseconds and the T2F to be milliseconds, then try to add them? You can do this via Influx or Grafana transformation.

1 Like

Thanks for your answer. It did not work. It only adds the duration as a number to the time stamp epoch, which increases the time few seconds only. It may need to find a way to add the duration as an interval to the current time, but not sure how to do this. Sorry for any inconvenience.

Great @grant2 . It is done. The expression T2F was multiplied by 1000 to convert it to msec and then added to the Time. Now it is perfect.

1 Like

That’s great! I knew you were getting close.

And as my brother @yosiasz said…

I got this rocking:
countdown_timer

What is the type of visulisation that allows you to enter value manually? This is interesting.

I feel a song coming!

image

Code from here was pasted into Text panel.
image

Also this plugin may offer some countdown functionality.

and this