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:
[[9]]
nodename = nanoBot
firmware = nanobot.ino
hardware = arduino-nano
[[[rx]]]
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?
Thanks,
TriCX