I have - in my humble opinion - the following nasty problem which I have tried to solve in many different ways, but always without success. Maybe an expert can provide a solution or hint where I can get further information to solve the problem:
I use Grafana combined with InfluxDB to monitor the power consumption of specific devices in Home Assistant like my coffee machine, which will be the device of choice for the following illustration. 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 logged data for the 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!