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.

MBus and Siemens UH50 meter
#1
I have 3 UH50 heatmeters that is battery operated. They only update data each 15min. What is the correct way to set up LM as GW for these devices?
I use a MBus to RS232 gateway.
Reply
#2
Use a scheduled script. Check this guide: https://kb.logicmachine.net/integration/mbus/
Reply
#3
That's probably right, but when the meter only sends each 15mn, it is in sleep mode the remaining time. It's turning into quite a challange to sync LM and meter.
Reply
#4
M-Bus provides both data and power over two-wire connection. This means that the M-Bus module is permanently powered even though the meter itself uses battery power. You can probably read the data at any time but it won't be real-time measurements.
Reply
#5
None of the meters are responding to adress scans eighter.. It was based on that I thought that values only was available every 15min.
Reply
#6
Have you configured short address on each meter? M-Bus module might use a different baud rate like 1200 or 4800.
Reply
#7
yes, i think so.. strange.. I also have the secondary adresses of the meters, but how does the mbus.scansecondary function work?

i only get this error;
Code:
attempt to call field 'scansecondary' (a nil value)
stack traceback:
Reply
#8
You have outdated firmware.
Reply
#9
Code:
SW: 20230607
Reply
#10
Install 2024 RC1.
Reply
#11
(26.02.2024, 12:45)tomnord Wrote:
Code:
SW: 20230607

Hi Tomnord, 

Any update on how you went with this integration? 
We are also integrating with the UH50 using Mbus and the meters do have some peculiar behaviours.

Brent
Reply
#12
(18.04.2024, 11:40)BrentW Wrote:
(26.02.2024, 12:45)tomnord Wrote:
Code:
SW: 20230607

Hi Tomnord, 

Any update on how you went with this integration? 
We are also integrating with the UH50 using Mbus and the meters do have some peculiar behaviours.

Brent

I got it to work, had some issues with cables. All values ar updatet each 15min, but previous value is stored in mBus buffer. 
Script below with separated GA's.
Code:
-- config init
if not meters then
  require('mbus')

  -- time to wait between each meter read
  sleeptime = 10
  -- use /dev/RS232 serial port with 2400 baud rate
  mbus.init('/dev/RS232', 2400)

  -- meter definition
  -- addr - short address
  -- id - number from data table where value resides
  -- div - optional divisor for convertion to the final value
  meters = {
    { ga = '3/0/0', addr = 10, id = 4, div = 10}, --  kW, dpt 14.
    { ga = '3/0/1', addr = 10, id = 2}, --  kWh dpt 12.
    { ga = '3/0/2', addr = 10, id = 5, div = 1000 }, --  m3h dpt 14
    { ga = '3/0/3', addr = 10, id = 6 }, --T1    dpt 12.
    { ga = '3/0/4', addr = 10, id = 7 }, -- T2   dpt 12.
    { ga = '3/1/0', addr = 20, id = 4, div = 10 }, --  kW
    { ga = '3/1/1', addr = 20, id = 2}, --  kWh
    { ga = '3/1/2', addr = 20, id = 5, div = 1000 }, --m3h
    { ga = '3/1/3', addr = 20, id = 6 }, --T1   
    { ga = '3/1/4', addr = 20, id = 7 }, --T2  
    { ga = '3/2/0', addr = 30, id = 4, div = 10 }, --kW
    { ga = '3/2/1', addr = 30, id = 2}, --kWh
    { ga = '3/2/2', addr = 30, id = 5, div = 1000 }, --m3h
    { ga = '3/2/3', addr = 30, id = 6 }, --T1   
    { ga = '3/2/4', addr = 30, id = 7 }, --T2    
  }

  -- reset meter values on first run
  for _, meter in ipairs(meters) do
    meter.value = 0
  end
end

-- read each meter
for _, meter in ipairs(meters) do
  res = mbus.getdata(meter.addr)

  -- read ok
  if type(res) == 'table' then
    data = res.data[ meter.id ]
    value = nil

    -- get current value
    if type(data) == 'table' then
      value = tonumber(data.value)
    end

    -- value is valid and different from previous read
    if value and meter.value ~= value then
      -- apply divisor if set
      div = meter.div
      dpt = div and dt.float32 or dt.uint32
      if div then
        value = value / div
      end

      -- update group address value
      grp.update(meter.ga, value, dpt)
      meter.value = value
      --log(meter.ga, meter.value, dpt)
    end
  end

  -- wait for next read
  os.sleep(sleeptime)
end
Reply
#13
Thanks for sending through, 

What were the cable issues if you dont mind me asking?
Reply
#14
(01.05.2024, 09:28)BrentW Wrote: Thanks for sending through, 

What were the cable issues if you dont mind me asking?

There was a fault on the Mbus/RS232 gateway.
Reply


Forum Jump: