08.08.2022, 06:16
You won't have event.getvalue() in a resident script. encode call should have correct data type set as the second argument.
Code:
value = grp.getvalue('32/1/1')
raw = knxdatatype.encode(value, dt.int64).dataraw
r1 = raw:byte(1) * 0x100 + raw:byte(2)
r2 = raw:byte(3) * 0x100 + raw:byte(4)
r3 = raw:byte(5) * 0x100 + raw:byte(6)
r4 = raw:byte(7) * 0x100 + raw:byte(8)
register = 3204
mb:setregisters(register, r4)
mb:setregisters(register+1, r3)
mb:setregisters(register+2, r2)
mb:setregisters(register+3, r1)