Visualization - consumption electricity meter in daily bars

Hey fellas,

I got my new car last week and I would like to use grafana to get an daily overview of the amount energy charged. My charging station has an electricity meter in it and I have access to it through a websocket connection.

All Data are stored in MariaDB.

The meter values are stored in the column “value”. It is just an up countng value and I need the difference between two values to get the amount of charged energy.

Actually this is the issue I’m facing. How do I get the difference between this two values?
When I use InfluxDB it is just “difference()” to achive that goal…

Someone able to help me out here?

1 Like

welcome to the :grafana: forum, @malkem

can you please follow these steps to share your raw unformatted data? That way, the community can try and mock up your problem :+1:


just change the time(1h) to 1d or whatever time you need it to read over (if anyone can convert this to flux please can you pass it on in struggling a bit to get it working)

Hi and thanks for the response!
I dont know how to paste the raw data in a proper way.

Time;Meter1;Meter2
1646919766000;;
1646920530000;2426885;
1646982425000;;3051265
1646983325000;;3052193
1646984225000;;3053122
1646985125000;;3054053
1646986025000;;3054984
1646986925000;;3055917
1646987825000;;3056850
1646988725000;;3057784
1646989068000;;
1646989625000;;3058719
1646990160000;;
1646990526000;;3059657
1646991060000;;
1646991425000;;3060592
1646991960000;;
1646992325000;;3061528
1646993225000;;3062086
1646994125000;;3062086
1646995025000;;3062086
1646995925000;;3062086
1646996825000;;3062086
1646997725000;;3062086
1646998625000;;3062086
1646999525000;;3062086
1647000425000;;3062086
1647001325000;;3062086
1647002225000;;3062086
1647003125000;;3062086
1647004025000;;3062086
1647004925000;;3062086
1647005825000;;3062086
1647006725000;;3062086
1647007626000;;3062086
1647008525000;;3062086
1647009425000;;3062086
1647010326000;;3062086
1647011225000;;3062086
1647012125000;;3062086
1647241718000;2427691;
1647242619000;2428622;
1647243518000;2429557;
1647244418000;2430493;
1647245318000;2431429;
1647246218000;2432367;
1647247118000;2433306;
1647248018000;2434245;
1647248918000;2435183;
1647249818000;2436124;
1647250718000;2437064;
1647251618000;2438004;
1647252518000;2438943;
1647253418000;2439884;
1647254318000;2440822;
1647255218000;2441764;
1647256118000;2442703;
1647257018000;2443643;
1648466773000;;
1648467673000;;
1648468573000;;
1648469473000;;
1648947804000;;

If this matters, I’m using Grafana v8.4.4

I’m not able to choose “difference()”

I am not sure there is a difference() function in MySQL quite like that… :frowning_face: