Posts: 213
Threads: 62
Joined: May 2018
Reputation:
4
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.
Posts: 7773
Threads: 42
Joined: Jun 2015
Reputation:
447
Posts: 213
Threads: 62
Joined: May 2018
Reputation:
4
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.
Posts: 7773
Threads: 42
Joined: Jun 2015
Reputation:
447
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.
Posts: 213
Threads: 62
Joined: May 2018
Reputation:
4
None of the meters are responding to adress scans eighter.. It was based on that I thought that values only was available every 15min.
Posts: 7773
Threads: 42
Joined: Jun 2015
Reputation:
447
Have you configured short address on each meter? M-Bus module might use a different baud rate like 1200 or 4800.
Posts: 213
Threads: 62
Joined: May 2018
Reputation:
4
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:
Posts: 7773
Threads: 42
Joined: Jun 2015
Reputation:
447
You have outdated firmware.
Posts: 213
Threads: 62
Joined: May 2018
Reputation:
4
Posts: 7773
Threads: 42
Joined: Jun 2015
Reputation:
447
Posts: 25
Threads: 9
Joined: Nov 2019
Reputation:
2
(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
Posts: 213
Threads: 62
Joined: May 2018
Reputation:
4
24.04.2024, 10:45
(This post was last modified: 24.04.2024, 10:47 by tomnord.)
(18.04.2024, 11:40)BrentW Wrote: (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
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
Posts: 25
Threads: 9
Joined: Nov 2019
Reputation:
2
Thanks for sending through,
What were the cable issues if you dont mind me asking?
Posts: 213
Threads: 62
Joined: May 2018
Reputation:
4
(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.
|