OpenEnergyMonitor Community

use_kWh format

Tags: #<Tag:0x00007fe7a246d9a8> #<Tag:0x00007fe7a246d840>

I’m pulling data through into MySQL via node-red, but the format is like this: 1611409677752. Do I need to adjust this in MySQL to get the kWh value or am i pulling the wrong item through? Thanks

That, from the size of the number, looks as if - somewhere along the line - you’ve concatenated two or more values. Even if it was Wh rather than kWh, it would still be an unrealistically large value. We don’t display or send power in units of less than 1 W, or energy in units of less than 1 Wh.

EmonLibCM uses a signed long (32 bits) for energy, so the limiting values from the library are -2147483648 or 2147483647. Your number is 3 digits ( ~800 × ) too big even for the maximum we can deal with.

It looks like the timestamp value, see below:


I don’t know what to use in the MQTT input to pull through the 4.8kWh value. Any ideas. At the moment i have emon/emonpi/use_kWh as the topic

the function is pulling through msg.topic and msg.payload. The msg.payload value is the ‘timestamp’ value that I would have thought would be kWh

I don’t work by Unix time :laughing: so I didn’t recognise the number. I’ve no knowledge of MQTT or nodered, you need somebody who understands those.

it looks like the payload is the use_kWh input that i somehow created in the inputs section

when adding a topic in node-red that isn’t an input in emonpi it creates that input in emonpi

Use an MQTT app to explore the MQTT data structure.

Any topic added to the base topic emon will act as an input to emoncms.


using node-red-node-mysql. I’ve changed my flow in node-red from MQTT - Node Red - MYSQL to EMONCMS - Node Red - MYSQL, which is working from the point of view that I get a kWh value in the MySQL table now.