04.01.2021, 10:58
DALI bus is slow so you should minimize the number of requests. If you want to update two objects at once better do it like this:
You should also add at least one second delay between queries otherwise you will overload the DALI bus.
Code:
function queryactual(short, addr1, addr2)
local res, err = dalicmd('internal', 'queryactual', { addrtype = 'short', address = short })
if res then
local val = res:byte()
if val > 0 then
val = math.floor(val / 2.54 + 0.5)
val = math.max(1, val)
end
grp.checkupdate(addr1, val)
grp.checkupdate(addr2, val)
end
end
queryactual(0, '1/1/0', '1/2/0')
You should also add at least one second delay between queries otherwise you will overload the DALI bus.