Emonhub scaling factor for 4 bytes types

I’m using emonhub with EmonHubJeeInterfacer to read data from serial and to feed it into MQTT/Emoncms.
I wrote my own sketch to accumulate S0-pulses from my electricity meter.
Besides actuals, I record also the total accumulated power consumption.
In order to support the full range of the meter I need to use a 4 byte type to transport the data.
A typical output on the serial line looks like this:

OK 9 210 105 7 0 72 248 70 0 250 90 0 0 158 234 140 0 187 11 7 0 (-0)

This is my emonhub configuration section:
nodename = nanoBot
firmware = nanobot.ino
hardware = arduino-nano
names = curPower,curPulseCount,intervalTime,accPulseCount,totPulseCount,totEnergy
datacodes = H, H, L, L, L, L
scales = 0.1,1,1,1,1,1,0.01
units = VA, p, us, p, p, kWh

The issue: The scalig does not work properly.
For the types “L” and “I” the scaling is ignored.
By the way what is the difference between L and I, both of them are 4 byte long.

This is an example from the log:
2017-08-18 14:53:48,262 DEBUG Pulse2Pi 29 NEW FRAME : OK 9 22 105 7 0 144 119 71 0 53 92 0 0 217 235 140 0 202 11 7 0 (-0)
2017-08-18 14:53:48,264 DEBUG Pulse2Pi 29 Values : [2690.2000000000003, 7, 4683664, 23605, 9235417, 461770]

While scaling is calculated for the first data element, it is ignored for the last.

Additionally, within emoncms there are no decimals at all?!
MQTT shows the decimals for the first data element.

What I’m doing wrong?


You must have the same number of values in each line. You have 6 names, 6 datacodes, 7 scale factors and 6 units.

The full specification for emonhub configuration: emonhub/configuration.md at emon-pi · openenergymonitor/emonhub · GitHub

Short-form lookup for the datacodes:

Oops, first I need to return my master degree.
I thought I checked the amount of parameters several times.
However, for emonhub and MQTT the issue is solved. Thanks.

But emoncms still does not show decimals for “totEnergy”.
The value in front of the decimal point is correct.
Interestingly, it works fine for “curPower”

Let’s assume the emonhub log shows this:
Publishing: emonhub/rx/9/values 585.5,1,3074184,30489,9242301,4621.18

Textual output of the feedview of emoncms:
nanoBot accPulseCount 2s 30489
nanoBot rssi 2s 0
nanoBot curPower 2s 585.5
nanoBot curPulseCount 2s 1
nanoBot totPulseCount 2s 9242301
nanoBot intervalTime 2s 3074184
nanoBot totEnergy 2s 4621

It became more weird after deleting the feeds in emoncms.
Afterwards only RSSI does show up, but nothing else.
emoncms’ log does not show any relevant entries.

Any ideas?