11.06.2018, 22:51
(This post was last modified: 12.06.2018, 12:24 by Erwin van der Zwart.)
Hi,
DPT 19 is not available in the controller, only way to do it is to use the 250 byte object (raw dpt) and build the telegram yourself.
You can try this sample, it's not 100% filled according the standard but for time and date it should work, if you want it 100% correct you need to complete OCT2 and OCT1
BR,
Erwin
DPT 19 is not available in the controller, only way to do it is to use the 250 byte object (raw dpt) and build the telegram yourself.
You can try this sample, it's not 100% filled according the standard but for time and date it should work, if you want it 100% correct you need to complete OCT2 and OCT1
Code:
now = os.date('*t')
wday = now.wday == 1 and 7 or now.wday - 1
OCT08 = now.year - 1900
OCT07 = now.month
OCT06 = now.day
OCT05 = bit.bor(bit.lshift(wday, 5), now.hour)
OCT04 = now.min
OCT03 = now.sec
OCT02 = 0 -- subfields like working day and dst not specified in this sample
OCT01 = 0 -- subfields like quality of clock not specified in this sample
knx_raw_dpt = string.char(OCT08) .. string.char(OCT07) .. string.char(OCT06) .. string.char(OCT05) .. string.char(OCT04) .. string.char(OCT03) .. string.char(OCT02) .. string.char(OCT01)
grp.write('1/1/1', knx_raw_dpt)
Erwin