Multiplying series together in a graph

Hi,

I’ve got two time based series, and I want a graph of them multiplied together. Spent a fair bit of time searching, but no luck. Data is stored in influxdb, coming from an openhab install.

I can get the two series shown separately easily enough

SELECT “value” FROM “Solis_AC1Volt” WHERE $timeFilter
SELECT “value” FROM “Solis_AC1Amp” WHERE $timeFilter

but I want to display a graph of the power generated (Volts * Amps)

Can this be done in grafana?

Cheers,

Darren.

Hi,

When using influxdb and grafana you cannot combine two queries. However, looking at influx documentation I can see that they have support for multiplication.

However, from the information I’ve found influxdb doesn’t support joining two measurements (like in your case) and applying mathematical functions. If you had the values from Solis_AC1Volt and Solis_AC1Amp in the same measurement/table the multiply function should work. Another option would be to write a measurement of power generated.

Marcus

Incase some one else finds this post , this worked for me

SELECT (mean(“v”) * mean(“a”)) AS “VA” FROM
(SELECT mean(“V”) AS “v” FROM “all-energy-monitors” WHERE (“device” = ‘energy-79593ph2’) AND $timeFilter),
(SELECT mean(“A”) AS “a” FROM “all-energy-monitors” WHERE (“device” = ‘energy-79593ph2’) AND $timeFilter)
GROUP BY time($__interval) fill(linear)

1 Like