Wrong kWh scale factor in cost calculations

This is a possibly obvious issue that I can’t track down. I am using the Octopus Agile and My Electric 2 apps to calculate cumulative and half-hourly costs using data from an EmonPi stored by EmonCMS. The current energy consumption figures are correctly reported in Watts. However, the half hourly and cumulative costs are wrong by a factor of 1000. It seems that somewhere the division by 1000 to convert from instantaneous watts to kWh is not occurring. I assume that this is because there is a parameter somewhere that hasn’t been set correctly. But where? I have no idea where to look.
The data is being collected on a feed from power (on monitor 1) with a conversion from power to kWh (the kwh variable) and the kWh accumulation (the kwhacc variable). I assume that it is the kwh variable which is wrong but I can’t find any way of scaling it correctly.

Welcome, Gordon, to the OEM forum.

I can’t believe that a bug like that has gone undetected in emonCMS for so long, so I suspect you’re picking up a value in watts thinking it is kilowatts (or an energy in Wh vs kWh). But as you’ve not said any more about where or how emonCMS is getting its data (“monitor 1” - what is this?), and what processing steps you have on the Inputs page (you might need a “× 0.001” there), we can’t offer a more detailed suggestion.

No suggestion of a bug! As I said, I assume that there is an incorrectly set parameter in my setup. However, since I find the whole user-interface utterly confusing to navigate, that is not surprising.
I have only one feed - the power measured by the CT clamp attached to port 1 on the EmonPi which is identified as a PHPFINA feed in the feeds page and is measured in Watts. Somewhere (I can’t find it now) I have defined three variables Power, kwh (using to the convert to kWh transformation, and kwhacc (using the accumulation transformation). There was no opportunity to define conversion factors or anything. Beyond that I am completely at a loss!

OK, knowing you have an emonPi is a great help.

The path for the data (in excruciating detail) is:

Voltage and current are measured by a cut-down 2-channel emonTx (the “emon” bit) which piggy-backs on a Raspberry Pi inside the emonPi. This is where the power (three of them, each input plus their sum) is calculated.
This is sent over a serial link into the RPi, and arrives in “emonHub”. Here it picks up its identity (“Node 5” or “emonpi”). You can see the data coming in if you go to Setup → Emonhub It looks like this:
2023-01-15 15:27:16,102 DEBUG RFM2Pi 4256270 NEW FRAME : OK 5 54 0 43 0 97 0 163 93 0 0 0 0 0 0 0 0 0 0 0 0 115 94 33 0 0 0 0 0 221 85 33 0 140 22 35 0 (-0)

emonHub sends it (MQTT Publishing: emon/emonpi/power1 54 etc) to the Inputs page of emonCMS.
There is where you “Process” the input - you can scale it, add a constant of do various conversions, and it’s probably in one of those conversions that you’ve defined a “Feed” - feed being the database where the data is stored. You can see the list of processed by clicking on the Spanner icon at the right-hand side of the Inputs page.
This is what mine looks like:

All three ‘processes’ send data to a Feed, the first explicitly, the others by implication - the Feed is named in the process step, click on the ‘Pencil’ icon to see the details (then ‘Cancel’ as you don’t want to change it).
While looking at the process list, click on the drop-down of the first box beneath “Add process” and you’ll see a list of all the things you can do to an input. (It won’t do any damage until you click “Add”.)

Once the data is in a Feed, you can use it in a “Dashboard” for a live view, or use one of the Apps as you are doing. The “Feeds” page really just confirms what you’ve got in the way of Feeds.

I know there’s a lot to learn, that’s a very potted outline of what happens, which will probably confuse you even more for the first few readings. Do come back if you need more clarification - we rely on people like you who don’t know their way around yet to help us improve the documentation.

I think that the whole problem lies in how processes are defined. I am looking at the same emonpi process list setup page as you.
A. Log to feed - ok. Mine is the wattage from the power1 monitor (totuse).
B. Power to kWh - ??? You have used a different argument kWh1, which seems to be a different feed. I had made what seems to be the natural assumption that if one gives the item 1 argument (totuse), then EmonCMS will convert that from a constant power flow (500W) to energy use (0.5 kWh) i.e. multiply by 0.001. That is what the definition “Convert a power value in Watts to a cumulative kWh feed” appears to mean.
C. Power to kWh/d - ??? Similar. You have a separate argument whereas the definition implies a conversion of the kWh value to a daily power consumption.
The power1 feed seems to be ok, the graphs are ok. However, I have no idea what the two apps are doing. The My Electric 2 app is showing totally absurd values varying from negative kWh today to 180 kWh today with small variations in the current power consumption. The Octopus Agile app is showing equally silly numbers for the value of Import. As I said I am completely bemused by the discrepancy between the descriptions and the behaviour of the apps.

“kWh1” is name I gave to the Feed. If you read the blue “Help” text for the first process: " Output: Does NOT modify value passed onto next process step." this tells you that the value that started at the top of the list (power in watts) is passed down the list unchanged to the third process. (And if you look at “Log to feed”, this is the same.)
Likewise the name I gave the Feed is “kWh1 per day” and this receives the power in watts passed down from process 2, and passes it on down the list to the next process (if there is one, else it falls off the end into oblivion).

My “My electric” is set up like this:

Screenshot 2023-01-15 18:52:15

(and clearly not been updated with the price for a while!).