# Calculation of integral of two datasets for photovoltaics power generation

**URL:** <https://discourse.nodered.org/t/calculation-of-integral-of-two-datasets-for-photovoltaics-power-generation/79067>\
**Category:** General\
**Created:** [8 June 2023 18:40 UTC](https://discourse.nodered.org/t/calculation-of-integral-of-two-datasets-for-photovoltaics-power-generation/79067 "2023-06-08T18:40:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lessi](https://avatars.discourse-cdn.com/v4/letter/l/c37758/32.png) [@lessi](https://discourse.nodered.org/u/lessi)\
**Post date:** [8 June 2023 18:40 UTC](https://discourse.nodered.org/t/calculation-of-integral-of-two-datasets-for-photovoltaics-power-generation/79067/1 "2023-06-08T18:40:27Z")

</div>

Hello,

I have some photovoltaic panels and would like to know how much energy I am producing and actually using.  
The panels are connected to a shelly from which I get the current generated power (among other data) in regular intervals. Moreover my electric meter is read out by a tasmota device. All this data is already available in Node-Red and is displayed with grafana. It is important to note that the electric meter is NOT counting backwards! Thus if I am produce more power than I am using, it goes to the public net for free. I would like to calculate the integral over these two curves over short time slices (maybe every minute) as the generated and the consumed power is changing all the time. Then I would substract these datasets from each other to see how much of the generated power actually benefited me.

I also get the accumulate total energy production/concumption from both devices, which could be used.

Any idea how to implement that?

Cheers

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [8 June 2023 20:08 UTC](https://discourse.nodered.org/t/calculation-of-integral-of-two-datasets-for-photovoltaics-power-generation/79067/2 "2023-06-08T20:08:00Z")

</div>

Are you sending the data to influxdb? If so you can use the integral function of influxdb to do it.

---

<div class="post-metadata">

**Author:** ![lessi](https://avatars.discourse-cdn.com/v4/letter/l/c37758/32.png) [@lessi](https://discourse.nodered.org/u/lessi)\
**Post date:** [8 June 2023 20:34 UTC](https://discourse.nodered.org/t/calculation-of-integral-of-two-datasets-for-photovoltaics-power-generation/79067/3 "2023-06-08T20:34:14Z")

</div>

Yeah, I am using influxdb. Do you have a good source where I can find more Infos?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [8 June 2023 20:37 UTC](https://discourse.nodered.org/t/calculation-of-integral-of-two-datasets-for-photovoltaics-power-generation/79067/4 "2023-06-08T20:37:01Z")

</div>

It should be in the influxdb docs. In fact I know it is because I remember seeing it. The section on Querying.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [7 August 2023 20:37 UTC](https://discourse.nodered.org/t/calculation-of-integral-of-two-datasets-for-photovoltaics-power-generation/79067/5 "2023-08-07T20:37:11Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
