Input list of an EmonTx

I am a newbie to Emoncms and i have a basic question about the input list of the EmonTx V3.4 (i guess my version is 3.4 because i get my EmonTx less than one month ago). I am inserting below a screen image showing the input list of my EmonTx node 15. I have not been able so far to find any explanation on each of the 15 inputs (named keys i think). The key number 2 is pretty easy to understand because 232.6 is clearly the main voltage output but the other 14 keys are not so obvious to identify even if i can make some guess. Is there a document somewhere in the openenergymonitor web site which explains what is what in the inputs list. I found a chart in the EmonTx wiki (see below) but it shows arduino pinout but it is not clear to me how arduino output pins relate to the input list (names keys) of Emoncms inputs list. For instance arduino analog 0 corresponds to AC voltage which corresponds to input no 2 in the input list node 15 of emoncms. As you can see i am completely lost. I would be very grateful if someone could tell me where to find information about the data output (named keys) of EmonTx. I hope my question was clear enough…

Welcome to the OEM forum.

You would need to look at the sketch for the emonTx V3.4 to find out what the items are.

The list is:

  1. Message count (ulong)
  2. Line Voltage (V × 100) (int)
  3. Power 1 (W) int)
  4. Power 2 (W) (int)
  5. Power 3 (W) (int)
  6. Power 4 (W) (int)
  7. Energy 1 (Wh) (long)
  8. Energy 2 (Wh) (long)
  9. Energy 3 (Wh) (long)
  10. Energy 4 (Wh) (long)
  11. Temperature 1 (deg C × 100) (int)
  12. Temperature 2 (deg C × 100) (int)
  13. Temperature 3 (deg C × 100) (int)
  14. Pulse Count (pulses) (ulong)

int = signed integer (2 bytes)
long = signed long integer (4 bytes)
ulong = unsigned long integer (4 bytes)
There is no 15, but the pulse count is an unsigned integer (4 bytes)

A temperature of 300°C is an error. The possible values are:
300.00 : Sensor has never been detected since power-up/reset.
302.00 : Sensor returned an out-of-range value.
304.00 : Faulty sensor, sensor broken or disconnected.
85.00 : Although within the valid range, if it is not close to the expected value, this could
represent an error, and might indicate that the sensor has been powered but not
commanded to measure (‘convert’) the temperature. It might be a symptom of an
intermittent power supply to the sensor.

Or a duff sensor.

Thank you very much for your quick and complete answer. As far as temperature is concerned i understand the 300.00 value as i have not plugged yet any temp. sensor. My concern is concerning energy keys 7 end 8 on which current sensor are plugged. On item 7 (solar prod) the value is 4294964413.00 and the key 8 (Victron out) value is 67590.00. I guess the values are in watt-hour. Does the 4294964413.00 (Wh) makes sense (it means 4294 MegaWh???). It is strange because the power values themself on keys 3 and 4 are correct. Thanks again for your help. JP

Those are signed long integer values, I think you are interpreting them as unsigned. Does the value -2882 Wh (’-’ meaning exported) sound correct?

But I think item 8 is “imported”, so it is interpreted correctly.

I have added the “type” to the list.

Is this your own emonCMS, or

For the moment i just have two current sensors (keys 3 and 4) and one AC-AC transformer hooked up on my EmonTx. The Emoncms 3 et 4 inputs relate to the 2 current sensors and the input 2 relates to the voltage transformer. For me these 3 data are correct.
My understanding of keys 7,8 inputs is that they correspond to the energy of 3 and 4 current sensors which are computed by the arduino sketch (current x voltage x time) and are expressed in Wh as per your previous message. These are raw data given by the emontx, they are not feeds. I have not done any computing on these data, this is why i am not sure to understand your last message
_____ "Does the value -2882 Wh (’-’ meaning exported) sound correct?____

Where this -2882Wh number is coming from? it is not showing on my Emoncms chart node 15.
What do you mean by exported and imported. The only thing i know is that you can have a negative number depending on the current sensor direction when placed on the wire to be measured.
For the moment i am using Emoncms in local but i am preparing to also use
Sorry for all those questions but i am a beginner on using the OpenEnergyMonitor.

Ah, now I understand better.

That is correct.

It is there, but it is not interpreted correctly by emonCMS, because emonCMS has the wrong information. There is a mistake in the file emonhub.conf You can edit it via your web browser. Go down to the definition of Node 15:

    nodename = emontx3cm15
       names = MSG, Vrms, P1, P2, P3, P4, E1, E2, E3, E4, T1, T2, T3, pulse
       datacodes = L,h,h,h,h,h,L,L,L,L,h,h,h,L   
       scales = 1,0.01,1,1,1,1,1,1,1,1,0.01,0.01,0.01,1
       units = n,V,W,W,W,W,Wh,Wh,Wh,Wh,C,C,C,p
       whitening = 1

and change the line datacodes = … to

       datacodes = L,h,h,h,h,h,l,l,l,l,h,h,h,L

Do the same for Node 16 - just in case you ever have another emonTx.
Then the Energy (‘E’) values should be correct.

The number -2882 comes from the rule to interpret a signed value:

  x= ([byte 1] + ( [byte 2] * 2^8) + ( [byte 3] * 2^16) + ( [byte 4] * 2^24)  ) 
    if x > (2^31)
        x = (x - (2^32)) 
    return x  

For you, x = 4294964413
x > 2^31, therefore x = 4294964413 - 2^32 = -2882

For item 8, x ≤ 2^31, therefore you see the correct value.

To us, “import” is power or energy that comes into your home, “export” is power or energy that leaves your home.

The power into your house should be positive at night when there is no sun. If that power is negative, turn the c.t. on the cable to face the other direction. The energy will follow the power.

Don’t worry, we were all beginners once.

I made the modifications of emonhub.conf file for nodes 15 and 16 and the energy data is now correct. I would like to zero out (or reset to zero) the energy keys. How can i do that ? I restarded my Emonmi but it is not doing the job. Thank you again for your very clear explanations… JP

Go into the Feeds page, select the feed, select ‘delete’ and there is an option to delete the data.

Might be worth switching the TX off first.

I am not talking about FEEDS i am refering to INPUTS that is data computed by the Emonpi and transfered to Emoncms. In that case i want to zero out energy of key 7 and 8. (this energy is computed from the current (from the current sensors) x Voltage x time). There should be a way to clear this data so as to start at the same time and compare energy at two points of any solar system. See below a picture of the inputs of node 15 (local emoncms).

The energy values sent from the emonTx count from zero when the sketch in your emonTx starts. You can start the sketch either by temporarily powering down the emonTx, or by pressing the ‘reset’ button.

If the feed does not return to zero then, depending on the processing that you are doing, the emonPi might store the last value received and retain it to add to the present value, thinking that your emonTx has suffered a power failure and you do not want to start again from zero. To prevent that (and I do not know emonCMS well enough to say that this is definitely happening), I think you must stop the emonTx, delete the feed and input, then start the emonTx and recreate the feed. An emonCMS expert will tell us if I am correct.


Note that the emonPi’s emonhub.conf has a wrong definition here for nodes 15 & 16. E1 - E4 are signed values out of the emonTx. P1 - P4 are signed, E1 - E4 must be too so as to cater for anyone who is a nett exporter of energy.

1 Like

Robert, your first assumption is correct, powering down the EmonTx is indeed clearing the energy values. I am just curious, why energy computation was implemented in the EmonPi whereas there is a function in Emoncms that is well doing the job : Power to kWh. JP

I think you are conflating the processing done in the “emon” part of the emonPi with that done in emonCMS, which happens to run on the emonPi (amongst other places - it will run on many web servers). Historically, there has been no energy accumulation in the emonTx and emonPi. There still isn’t in the ‘emon’ part of the emonPi. However, I believe the way it is done in emonCMS assumes that the power is a straight line interpolation between any two readings. This means that if there is a power outage, the total energy will be wrong. By doing the calculation at source, i.e. in the emonTx, and then by detecting a sudden large drop to near zero (which it will see if the emonTx resets) but storing the last “good” value, emonCMS can handle the outage with much better accuracy.