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.

Log all bus traffic
#6
My simple variant for sending all data to SYSLOG server

In User Libraries need create function syslog:


Code:
function syslog(message)
 require('socket')

 local client = socket.udp()
 if client then
   client:sendto(message, '192.168.19.254', 514)
   client:close()
 end
end


After this markup all objects with tag "All"

Create new event-based script "Send all messages to SYSLOG" for tag "All"

Code:
name = grp.alias(event.dst)
-- Fix Group name for empty values
if (name == nil or name == '') then
 name = "Noname"
end

value = '"'..name..'" '..event.src..' '..event.dst..' '..event.type..' '..knxdatatype.decode(event.datahex, grp.find(event.dst).datatype)..' 0x'..event.datahex
syslog(value)

Sample of log:
2016-04-26T22:52:34.084297+03:00 192.168.16.200 "Wind speed (m/s)" 1.0.1 5/0/6 groupwrite 2.6 0x0104
2016-04-26T22:52:39.817766+03:00 192.168.16.200 "Wind speed (m/s)" 1.0.1 5/0/6 groupwrite 4.5 0x01C2
2016-04-26T22:52:42.632619+03:00 192.168.16.200 "Wind speed (m/s)" 1.0.1 5/0/6 groupwrite 2.7 0x010E
2016-04-26T22:52:45.231188+03:00 192.168.16.200 "Wind speed (m/s)" 1.0.1 5/0/6 groupwrite 3.3 0x014A
2016-04-26T22:52:50.097556+03:00 192.168.16.200 "Wind speed (m/s)" 1.0.1 5/0/6 groupwrite 1.6 0x00A0
2016-04-26T22:52:51.595747+03:00 192.168.16.200 "Noname" 1.3.2 2/2/3 groupwrite 21.4 0x0C2E
2016-04-26T22:52:57.809525+03:00 192.168.16.200 "Temp in room 37" 1.3.22 2/1/24 groupwrite 24.02 0x0CB1
Reply


Messages In This Thread
Log all bus traffic - by gjniewenhuijse - 12.04.2016, 14:21
RE: Log all bus traffic - by edgars - 15.04.2016, 08:41
RE: Log all bus traffic - by gjniewenhuijse - 19.04.2016, 14:09
RE: Log all bus traffic - by admin - 20.04.2016, 10:08
RE: Log all bus traffic - by Ruslan - 20.04.2016, 12:21
RE: Log all bus traffic - by Ruslan - 26.04.2016, 19:54

Forum Jump: