This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Integrate Noark 1F electricity meter and write to M-Bus to change tariff
#1
Hello!

I checked M-Bus manual and this thread but didn't find any information...
https://openrb.com/m-bus-integration-in-lm
https://openrb.com/docs/mbus.htm
https://forum.logicmachine.net/showthrea...light=mbus

We have about 185 Noark EMS 1P 1M electricity meters. Plan is to integrate these to LM using Techbase TB-MBUS-200-RS232 converter.

Is it possible to send custom M-Bus packet to change tariff? Noark one phase electricity meters allow to change tariff only using M-Bus write command.  

Here is electricity meter manual (page 17 and 20):
https://cdn.noark-electric.eu/documents/..._1m_en.pdf
Reply
#2
Try this, make sure that only one script is accessing the serial port at any time moment.
Code:
require('serial')

port, err = serial.open('/dev/RS232', {
  baudrate = 9600,
  parity = 'even',
  duplex = 'full',
})

port:flush()

addr = 0x01 -- short address
tariff = 0x02 -- selected tariff

data = { 0x53, addr, 0x51, 0x09, 0x7C, 0x01, 0x54, tariff }

len = #data

buf = { 0x68, len, len, 0x68 }
cs = 0

for _, char in ipairs(data) do
  buf[ #buf + 1 ] = char
  cs = cs + char
end

buf[ #buf + 1 ] = bit.band(cs, 0xFF)
buf[ #buf + 1 ] = 0x16

data = string.char(unpack(buf))

port:write(data)

res = port:read(1, 0.5)

if res then
  if res:byte(1) == 0xE5 then
    log('write ok')
  else
    log('reply error')
  end
else
  log('no reply')
end

port:close()
Reply
#3
Thanks!
Gonna try it
Reply


Forum Jump: