Troubleshoot with Mitsubishi Smart Meter integration

Hi, im working on reading data from a ME96SSRA smart energy meter from mitsubishi but im having some issues. Any help would be greatly apreciated.

The modbus interface specifications of this meter can be found here: https://dl.mitsubishielectric.com/dl/fa/document/manual/pmd/ym-i-lspm-0075/lspm0075e.pdf

My setup is with a Raspberry Pi 3 running a NodeJS script through Modbus RTU.

For example, i want to read the active energy (address 1280 (dec) for Lo and 1281 (dec) for Hi). The data is big endian, so the Hi should be the MSB and the Lo the LSB, so im applying the following:

active energy = (data[hi]65536 + data[lo]) * multiplyingFactor

The total rate power is in the following range: 100kW or more and less than 1000kW, so the multiplying factor should be 1. Nevertheless im getting crazy numbers.

Any suggestions why?

Thanks!

Hello Jose, and welcome to OEM.

Assuming the line in your script is the same as the line in your post, it
looks like you’re missing the multiplication symbol between data[hi] and 65536.
IOW, shouldn’t it read ((data[hi] * 65536) + data[lo]) * multiplyingFactor?

Those registers are words, not bytes? If they are bytes, the multiplier should be 256.
And if signed, don’t forget the sign bit. The p-code for that (bytes - change the numbers for words):

p-code for extracting signed integer
x= ([low byte] + ( [high byte] * 2^8) )
if x > (2^15)
x = (x - (2^16))
return x

1 Like

Yes, words. 16-bit. Sometimes concatenated to make a 32-bit float.
Depending on the instrument, they may be signed or unsigned.

Jose,

Is there any reason you can’t use the data in register 1304?
You’d get a 32-bit float that has a range of 0 to 999999 kWh that way.

Bill, first of all thanks for the fast replies! I found this community searching for some information regarding the PZEM016 smart meter, and actually one of your posts solved my issues back then! Thanks for that!.

No, there is no strong reason for not using register 1304, but wanted to understand how to interpret correctly the number stored in adresses 1280 and 1281. Anyway ill try going directly for adress 1304.

How did you figured out that there where words and not bytes in each address? im a begginer in this, any books or learning material for this you can share?

Thanks again!

YVW, S! Glad to hear it helped.

Learning by doing… I do a lot of that myself. :wink:

Can’t remember when/where it was I actually learned Modbus (I’ve been an ET since '74)
but Google is definitely your friend in this case.

Simply Modbus (http://www.simplymodbus.ca/) and
Real Time Automation (https://www.rtautomation.com/technologies/modbus-rtu/)
have lots of info that should help you get a grip on Modbus.

The document you ( @jidj85 ) linked to actually specifies that - in “Byte Count”!

As well as the registers that represent 32-bit values.

Thank you both!

I’m testing again next Tuesday, will let you know how it goes.

1 Like

Hopefully, thumbsup

Finally I am reading active energy from register 1408 which is fixed in kWh. Working fine. Thanks for the help Bill and Robert.

1 Like

Sounds good! highfive

Would you mind posting your script for any one who follows on please?

Sure, its javascript:

function registerEnergyConsumption(data){
  let activeEnergy = data[0]*65536 + data[1];
  let reactiveEnergyLAG = data[4]*65536 + data[5];
  let reactiveEnergyLEAD = data[8]*65536 + data[9];
  let energyConsumptionRegister = {
          activeEnergy: activeEnergy,
          reactiveEnergyLAG: reactiveEnergyLAG
          reactiveEnergyLEAD: reactiveEnergyLEAD
  }
  return energyConsumptionRegister
}
1 Like