# Questions about feeds and virtual feeds

**URL:** <https://community.openenergymonitor.org/t/questions-about-feeds-and-virtual-feeds/5695>\
**Category:** Emoncms\
**Created:** [18 November 2017 19:01 UTC](https://community.openenergymonitor.org/t/questions-about-feeds-and-virtual-feeds/5695 "2017-11-18T19:01:26Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jon](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/jon/32/1876_2.png) [@Jon](https://community.openenergymonitor.org/u/Jon)\
**Post date:** [18 November 2017 19:01 UTC](https://community.openenergymonitor.org/t/questions-about-feeds-and-virtual-feeds/5695/1 "2017-11-18T19:01:26Z")

</div>

Lawrence - on the emonPi you can create the imbalance feed in a similar way. Go to the **Inputs** Page, find **power1** and click on the Spanner/Wrench.

Add the **- input** process with for power2 and a Log to feed. And save changes (in the bottom right).

 ![09 PM](https://community.openenergymonitor.org/uploads/default/original/2X/c/c542e9ba95f86237cd4e6a7099414c5cecb57e14.png)  
 ![38 PM](https://community.openenergymonitor.org/uploads/default/original/2X/3/39376ae63bebf8ea3b6abc91e67f0f90bfdd7002.png)

You’ll find your new feed on the **Feeds** page.

PS - my process list includes an **Allow positive** and I cannot remember why I added this!

---

<div class="post-metadata">

**Author:** ![lhgray](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/lhgray/32/36214_2.png) [@lhgray](https://community.openenergymonitor.org/u/lhgray)\
**Post date:** [18 November 2017 19:37 UTC](https://community.openenergymonitor.org/t/questions-about-feeds-and-virtual-feeds/5695/2 "2017-11-18T19:37:07Z")

</div>

I see what you’ve done here, but aren’t you usurping the power1 data feed for another purpose? The power1 key (|feed, the terminology is murky here) is now storing the imbalance not the original power1 data. How would I plot power1, power2 and the imbalance, each with their own database file?

Or am I just hopelessly misunderstanding everything?

This is where I’ve gotten to

Here is my input page

 ![Screenshot-2017-11-18 Emoncms - input view](https://community.openenergymonitor.org/uploads/default/original/2X/4/46b90b3c73c8962656cd9fd3e5f239853de58fdc.png)!

and from the Feeds page, the virtual feeds I would like to use

 ![Screenshot-2017-11-18 Emoncms - feed list](https://community.openenergymonitor.org/uploads/default/original/2X/8/8af825db63b91e0d28ccd3acf3b3fec00661ca15.png)!

---

<div class="post-metadata">

**Author:** ![Jon](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/jon/32/1876_2.png) [@Jon](https://community.openenergymonitor.org/u/Jon)\
**Post date:** [18 November 2017 20:00 UTC](https://community.openenergymonitor.org/t/questions-about-feeds-and-virtual-feeds/5695/3 "2017-11-18T20:00:14Z")

</div>

> [@Data analysis with IoTaWatt Outputs](https://community.openenergymonitor.org/t/data-analysis-with-iotawatt-outputs/5687/5):
>
> but aren’t you usurping the power1 data feed for another purpose?

No, no usurping! A few months ago someone did an excellent job of adding a summary to each process step (Thank you!). Read the **Output:** line and that will tell you if the Output get changed or modified by the process.

The output for **Power to kWh** states: **Output: Does NOT modify value passed onto next process step.**. So to add the imbalance feed, just add a couple of additional process to your existing processes.

 ![24PM](https://community.openenergymonitor.org/uploads/default/original/2X/d/dffd47aa93f2853746f1690874510b5ca12c68a3.png)

**EDIT** :

> [@Data analysis with IoTaWatt Outputs](https://community.openenergymonitor.org/t/data-analysis-with-iotawatt-outputs/5687/5):
>
> How would I plot power1, power2 and the imbalance

To plot, go the the **Setup** \> **Graphs** page. Open up emonpi and click the feeds you want to plot.

 ![07 PM](https://community.openenergymonitor.org/uploads/default/original/2X/f/f9d1d16f162a9132ac7813561f68d7e4ffb1f9bf.png)

PS - I don’t save or **Log to feed** the **power1** or **power2** inputs so I could not add those to the graph. But for your setup they are saved and can be plotted.

---

<div class="post-metadata">

**Author:** ![overeasy](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/overeasy/32/7124_2.png) [@overeasy](https://community.openenergymonitor.org/u/overeasy)\
**Post date:** [18 November 2017 20:38 UTC](https://community.openenergymonitor.org/t/questions-about-feeds-and-virtual-feeds/5695/4 "2017-11-18T20:38:39Z")

</div>

Jon is right about the feeds and logging to feed. There’s always more than one way to skin a cat. But there are a few differences:

- As depicted, you would have to wait for the new feed to accumulate some history. i.e., it’s only useful to analyze future data. There is probably another way to build a feed from historical data in other feeds, but if you had stored the sum of the two main feeds rather than the individual mains, as I have in my [Emoncms.org](http://Emoncms.org) account, it would be impossible because the data just isn’t there, as is the case in Jon’s as well.

- The new feed would require additional storage, so there is a cost in both delay and storage.

It all depends on how casually you want to look at the historic data. Last week, in the aftermath of a large storm that had left a lot of the US Northeastwithout power for several days, I was thinking about downgrading my generator from my loud stinky 6kW diesel to a modern propane fueled inverter type. So I was able to look at my historic power usage graphically with various non-critical loads removed. As it turns out, I can easily get by with a 2kW inverter generator, as long as I’m willing to manually wash dishes, hang the laundry, and rely on what the solar hot-water can produce. That’s the utility of being able to run scripts against your historical data, and that’s what I was trying to convey in the post.

EDIT:

> [@Data analysis with IoTaWatt Outputs](https://community.openenergymonitor.org/t/data-analysis-with-iotawatt-outputs/5687/7):
>
> As depicted, you would have to wait for the new feed to accumulate some history.

I’m missing something here, so fill me in. You do seem to have created a historical imbalance graph, so is that coincidentally something you already had or another way to get in the wayback machine?

---

<div class="post-metadata">

**Author:** ![lhgray](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/lhgray/32/36214_2.png) [@lhgray](https://community.openenergymonitor.org/u/lhgray)\
**Post date:** [18 November 2017 20:57 UTC](https://community.openenergymonitor.org/t/questions-about-feeds-and-virtual-feeds/5695/5 "2017-11-18T20:57:31Z")

</div>

I have something working as Jon described, but yes Bob, I was interested in being able to look at historical data.

I have to think about this some more. I still have questions, but no time at this moment. Thank you for the comments. I’ll be back.

---

<div class="post-metadata">

**Author:** ![Jon](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/jon/32/1876_2.png) [@Jon](https://community.openenergymonitor.org/u/Jon)\
**Post date:** [18 November 2017 21:08 UTC](https://community.openenergymonitor.org/t/questions-about-feeds-and-virtual-feeds/5695/6 "2017-11-18T21:08:22Z")

</div>

> [@Data analysis with IoTaWatt Outputs](https://community.openenergymonitor.org/t/data-analysis-with-iotawatt-outputs/5687/7):
>
> I’m missing something here, so fill me in. You do seem to have created a historical imbalance graph, so is that coincidentally something you already had or another way to get in the wayback machine?

It is a Feed I created when I received the emonPi. No other wayback data!

 ![09 PM](https://community.openenergymonitor.org/uploads/default/original/2X/f/fba291fed9b2a1b3943b5ef234540ff992ce96e9.png)

---

<div class="post-metadata">

**Author:** ![lhgray](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/lhgray/32/36214_2.png) [@lhgray](https://community.openenergymonitor.org/u/lhgray)\
**Post date:** [19 November 2017 18:21 UTC](https://community.openenergymonitor.org/t/questions-about-feeds-and-virtual-feeds/5695/7 "2017-11-19T18:21:34Z")

</div>

> [@Data analysis with IoTaWatt Outputs](https://community.openenergymonitor.org/t/data-analysis-with-iotawatt-outputs/5687/9):
>
> It is a Feed I created when I received the emonPi. No other wayback data!

I understand what’s happening now. In the process list for the power1 input, you have undertaken an additional numerical process and logged the result into a “new” feed. Where did you get the insight to do that? I first thought you were logging into the same feed. I have seen no documentation or instruction that would have suggested that it is what I should have done. My approach was that I needed to create a virtual feed, which is what I did and could see that the current value of the feed was updating correctly. I was failing in being able to store the data and plot the result. I think I can do what I need using your approach, although it will be somewhat more complex than simply calculating an “imbalance” as you did or “Amperage” as I have in my test case.

But I am left wondering. What is the purpose of virtual feeds? When are they needed and how does one use them? Since one cannot simply log them, there is no process for that, they need to be published to MQTT and then logged, somehow. But my understanding does not go that deep yet. So, is there any instruction out there on these matters.

And how does one perform such calculations on historical data? I realize that I could simply export all of the data needed as CSV and perform the necessary computations in a spreadsheet, but that seems cumbersome and time-consuming. I want to use the native abilities of the emonPi system.

> [@Data analysis with IoTaWatt Outputs](https://community.openenergymonitor.org/t/data-analysis-with-iotawatt-outputs/5687/6):
>
> The output for Power to kWh states: Output: Does NOT modify value passed onto next process step… So to add the imbalance feed, just add a couple of additional process to your existing processes.

I saw this and its significance with regard to creating a new feed escaped me. [CAUTION: mini-rant ahead, no reflection on you, Jon] I dislike documentation that only tells you what it doesn’t do as opposed to what is does do. My understanding of this is, (Output: Passes an unmodified copy of the input value onto the next process step)

Enough for now.

---

<div class="post-metadata">

**Author:** ![Jon](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/jon/32/1876_2.png) [@Jon](https://community.openenergymonitor.org/u/Jon)\
**Post date:** [19 November 2017 23:16 UTC](https://community.openenergymonitor.org/t/questions-about-feeds-and-virtual-feeds/5695/8 "2017-11-19T23:16:20Z")

</div>

> [@lhgray](#):
>
> Where did you get the insight to do that?

Mostly from reading thru this forum! And trying other user’s examples!

> [@lhgray](#):
>
> But I am left wondering. What is the purpose of virtual feeds?

I’ve been trying to use them in a way that may be similar to your virtual feeds. I want to look at energy use per each meteorological season (I think Virtual feed was for a tariff). But quite honestly I really haven’t go the hang of this and it doesn’t seem like the output is correct.

 ![59 PM](https://community.openenergymonitor.org/uploads/default/original/2X/7/72707148a78b5642d68b942178ca408dedef91d2.png)  
 ![10 PM](https://community.openenergymonitor.org/uploads/default/original/2X/d/d556462a03f5baa13758e5985a77cd729701f685.png)  
Trystan @TrystanLea or others may be able to lend a hand with virtual feeds.  
&nbsp;

> [@lhgray](#):
>
> And how does one perform such calculations on historical data?

Did you want to post process something? i.e., you’ve got the data and now you have a new idea on how you want it calculated? There is a Post Process page ( **Setup** \> **Post Process** ) that was rolled out a few months ago. I think it is a work in progress but Trystan @TrystanLea would know better than I would.  
&nbsp;

> [@lhgray](#):
>
> I dislike documentation that only tells you what it doesn’t do as opposed to what is does do. My understanding of this is, (Output: Passes an unmodified copy of the input value onto the next process step)

Being a user driven community, much of the documentation comes from us, the users. It is fairly easy to suggest changes. Your recommendation is the perfect example!

---

<div class="post-metadata">

**Author:** ![Robert.Wall](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/robert.wall/32/38246_2.png) [@Robert.Wall](https://community.openenergymonitor.org/u/Robert.Wall)\
**Post date:** [20 November 2017 00:04 UTC](https://community.openenergymonitor.org/t/questions-about-feeds-and-virtual-feeds/5695/9 "2017-11-20T00:04:28Z")

</div>

@Jon

There’s quite a bit in the Archived forums about virtual feeds written by Nuno Chaveiro, I think it’s probably worth looking there if you haven’t done so.

---

<div class="post-metadata">

**Author:** ![Jon](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/jon/32/1876_2.png) [@Jon](https://community.openenergymonitor.org/u/Jon)\
**Post date:** [20 November 2017 00:43 UTC](https://community.openenergymonitor.org/t/questions-about-feeds-and-virtual-feeds/5695/10 "2017-11-20T00:43:13Z")

</div>

> [@Robert.Wall](#):
>
> There’s quite a bit in the Archived forums about virtual feeds written by Nuno Chaveiro

Good memory! (I had forgotten)  
&nbsp;

Virtual Feed - Post-processing data on the fly (first four posts)

> **[Virtual Feed - Post-processing data on the fly | Archived Forum](https://openenergymonitor.github.io/forum-archive/node/10977.html)**

---

<div class="post-metadata">

**Author:** ![lhgray](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/lhgray/32/36214_2.png) [@lhgray](https://community.openenergymonitor.org/u/lhgray)\
**Post date:** [23 November 2017 18:19 UTC](https://community.openenergymonitor.org/t/questions-about-feeds-and-virtual-feeds/5695/11 "2017-11-23T18:19:21Z")

</div>

@Jon, @Robert.Wall, @overeasy  
Thank you all for the help. I have gained a lot of insights from this discussion.

I had seen the archived posts before and they set me on the path of creating virtual feeds. The final output value for my feeds was correct but I could never get them to display. When I tried to plot them, the graph routines would throw a lot of errors, as I said before. But further searching through the forum revealed that you, Jon, had the same problem at one time.

> [@Lots of errors with Virtual Feeds Emoncms 9.8.6](https://community.openenergymonitor.org/t/lots-of-errors-with-virtual-feeds-emoncms-9-8-6/4029/1):
>
> I ran the emonPi update on May 15. And today I just created a new virtual feed. But I am getting LOTS of these errors (below). This happens when creating a new virtual feed and with existing virtual feeds.

And there is no **Post Process page (Setup \> Post Process)** available. My system must be out of date, even though I had only received my emonPi in mid-August. I was running the same emoncms version as you were experiencing problems with. An update of the emoncms to v9.8.18 has resolved all issues. The virtual feeds are now displaying in a graph. I now have the Post Process page. I am interested to see how this concept develops.

Below is my current effort showing the energy consumption in different colours for different tariff rate periods in the day.

 ![Screenshot-2017-11-23 Emoncms - graph](https://community.openenergymonitor.org/uploads/default/original/2X/a/abd3c9d4e0d327252c81be679e5ef28ddd99ecac.png)

Now I hope to create a virtual feed that reflects the accumulated cost based on the tariff rates for each period and hopefully resets to zero each day
