Welcome, Leo, to the OEM forum.
I can’t help you with MQTT or Domoticz, but I can tell you how to decode
It is a string of bytes with the value given as a decimal number. But you need some more information to know what the bytes represent. Your emonHub configuration file will tell you (look in emonCMS → Setup → Emonhub → Edit config) and find Node 5. It starts “[[5]]”
It might be like mine
[[5]]
nodename = emonpi
[[[rx]]]
names = power1,power2,power1pluspower2,vrms,t1,t2,t3,t4,t5,t6,pulse1count,pulse2count,E1,E2
datacodes = h, h, h, h, h, h, h, h, h, h, L, L, l, l
scales = 1,1,1, 0.01, 0.01,0.01,0.01,0.01,0.01,0.01, 1, 1, 1, 1
units = W,W,W, V, C,C,C,C,C,C, p, p, Wh,Wh
My guess is you won’t have pulse2count, E1 & E2.
All the numbers match 1:1 left to right, so the first element is power1, the datacode is h, the scale factor is 1, and the units are w.
The full list of datacodes is here: emonhub/configuration.md at emon-pi · openenergymonitor/emonhub · GitHub
The part you need to look at is datacodes =
h is a signed int16_t (2 bytes), L is an uint32_t and l is an int32_t (both 4 bytes)
You decode your data like this:
OK - no checksum error
5 - the node ID the data comes from
145 0 - power1, 2 bytes, value = 145 + 0×256, this is then multiplied by the scale factor 1.3 (why? - it should not be necessary, do you have a different c.t. or a.c. adapter to our ‘standard’ ones?)
0 0 - power2, 2 bytes, value = 0 + 0×256, this is then multiplied by the scale factor 1
etc.
The pseudo-code to decode the bytes is
for extracting signed integer
x= ([1st byte] + ( [2nd byte] * 2^8) )
if x > (2^15)
x = (x - (2^16))
return x
or
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
and for an unsigned integer, ignore if x >
…