24.12.2021, 08:49
You can make simple status mapping via a single script. Add feedback tag to all control objects and map an event script to this tag.
Fill mapping table as needed. Table key (1/1/1, 1/1/3 etc) is the control address, key value is either a single status object address or a table containing multiple addresses.
You will need additional scripts for more complex situations like setting light value to 0% should set binary status to Off.
Fill mapping table as needed. Table key (1/1/1, 1/1/3 etc) is the control address, key value is either a single status object address or a table containing multiple addresses.
Code:
mapping = {
['1/1/1'] = { '1/1/2', '1/1/9' },
['1/1/3'] = '1/1/4',
['1/1/5'] = '1/1/6',
}
status = mapping[ event.dst ]
if type(status) == 'string' then
status = { status }
end
if type(status) == 'table' then
value = event.getvalue()
for _, addr in ipairs(status) do
grp.checkupdate(addr, value)
end
end
You will need additional scripts for more complex situations like setting light value to 0% should set binary status to Off.