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.

Help me creat feedbacks
#3
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.
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.
Reply


Messages In This Thread
Help me creat feedbacks - by Bitto1998 - 23.12.2021, 12:43
RE: Help me creat feedbacks - by Daniel - 23.12.2021, 15:39
RE: Help me creat feedbacks - by admin - 24.12.2021, 08:49

Forum Jump: