10.11.2021, 19:17
Hi Klaus,
you could use such script and customize handleLog function according to your needs.
You could look also into these posts:
https://forum.logicmachine.net/showthrea...ght=eibdgm
https://forum.logicmachine.net/showthrea...ght=eibdgm
you could use such script and customize handleLog function according to your needs.
Code:
if not client then
require('genohm-scada.eibdgm')
objects = grp.all()
datatypes = {}
for _, object in ipairs(objects) do
datatypes[ object.id ] = object.datatype
end
function handleLog(src, eventType, ga, value, rawEvent)
local isLoggedAddress = src:find("15.15.%d+") ~= nil
if isLoggedAddress then
log(src, eventType, ga, value, os.time())
end
end
function writehandler(event)
local dpt, dst = datatypes[ event.dstraw ], event.dst
local value = nil
if dpt then
value = knxdatatype.decode(event.datahex, dpt)
end
handleLog(event.src, event.type, dst, value, event)
end
client = eibdgm:new({ timeout = 0.5 })
client:sethandler('groupwrite', writehandler)
end
-- handle knx
client:step()
You could look also into these posts:
https://forum.logicmachine.net/showthrea...ght=eibdgm
https://forum.logicmachine.net/showthrea...ght=eibdgm
Done is better than perfect