![]() |
|
MBus and Siemens UH50 meter - Printable Version +- LogicMachine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Gateway (https://forum.logicmachine.net/forumdisplay.php?fid=10) +--- Thread: MBus and Siemens UH50 meter (/showthread.php?tid=5263) |
MBus and Siemens UH50 meter - tomnord - 23.02.2024 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. RE: MBus and Siemens UH50 meter - admin - 23.02.2024 Use a scheduled script. Check this guide: https://kb.logicmachine.net/integration/mbus/ RE: MBus and Siemens UH50 meter - tomnord - 26.02.2024 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. RE: MBus and Siemens UH50 meter - admin - 26.02.2024 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. RE: MBus and Siemens UH50 meter - tomnord - 26.02.2024 None of the meters are responding to adress scans eighter.. It was based on that I thought that values only was available every 15min. RE: MBus and Siemens UH50 meter - admin - 26.02.2024 Have you configured short address on each meter? M-Bus module might use a different baud rate like 1200 or 4800. RE: MBus and Siemens UH50 meter - tomnord - 26.02.2024 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:RE: MBus and Siemens UH50 meter - admin - 26.02.2024 You have outdated firmware. RE: MBus and Siemens UH50 meter - tomnord - 26.02.2024 Code: SW: 20230607RE: MBus and Siemens UH50 meter - admin - 26.02.2024 Install 2024 RC1. RE: MBus and Siemens UH50 meter - BrentW - 18.04.2024 (26.02.2024, 12:45)tomnord Wrote: 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 RE: MBus and Siemens UH50 meter - tomnord - 24.04.2024 (18.04.2024, 11:40)BrentW Wrote:(26.02.2024, 12:45)tomnord Wrote: 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)
endRE: MBus and Siemens UH50 meter - BrentW - 01.05.2024 Thanks for sending through, What were the cable issues if you dont mind me asking? RE: MBus and Siemens UH50 meter - tomnord - 13.05.2024 (01.05.2024, 09:28)BrentW Wrote: Thanks for sending through, There was a fault on the Mbus/RS232 gateway. |