Pie Chart showing the status of my robot

  • What are you trying to achieve?

I want to build a pie chart that shows the percentage of the time my robot was in a specific status-mode, pretty much like the image shows.

I want it to monitor the status over the whole history, so i can see after multiple months what my robot did the most and what it did less.

For example: if it runs 100 seconds and was charging 50s, sleeping 25s and walking 25s, it should result in my example graph.

  • How are you trying to achieve it?

I’ve written a c# programm to insert data in the following format, whenever the status of the robot changes: “Status,Status=“Walking” Duration=50”

So in the example, that would mean that the robot walked for 50 seconds, then switch status to maybe charge or sleep. As soon as he switched status, the duration of the previous status gets send to the influxdb and the duration counter starts ticking for the following status.

  • What happened?

My problem: i want to add up all the values for “walking”, “sleeping” and “charging” in grafana, so that i result in a total walking-time etc., so that i can show how long it did what.

So the robot ist walking for 10 seconds, then charging for 20s and then walking for 10s again, it should be a pie chart showing 50% walking and 50% charging.

Is there a way to achive this in grafana and influxdb? i could also change up the data format if needed…

thanks in advance for your help, im really a beginner with grafana and influxdb and its driving me crazy