Grafana: Total costs by integration


Maybe a Grafana expert is around who can help. I use Grafana to monitor the power consumption of specific devices like my coffee machine. The individual figures “left” (coffee01) and “middle” (coffee02) reflect the correct values, i.e., I had a coffee around 08:46 (costs 0.005€) and another one at 11:08 (costs 0.0125€). By selecting the time range to cover both events, Grafana should display the total costs 0.005€ + 0.0125€ = 0.0175€. However, this is not the case as figure “right” illustrates, where the value is 0.2623€ which is totally wrong. After each coffee, a smart plug disconnects the coffee machine. The problem seems that the data for a disconnected plug is not treated as zero. So, starting from the last value before the disconnect at coffee01, Grafana integrates the data until the beginning of coffee02 which is not really how it should be. Any ideas how to fix this problem?

Thanks in advance and kind regards.