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.

trigging with tag
#2
Hi here is example script which does what you ask for, you can convert yours same way.
Code:
--// when input = 1 then output (100%) ; when input = 0 then output (25%)

onValue = 255 -- remember that when object will have scale dpt then values are from 0-100
offValue = 64



----------------------------------------------Optional change-----------------------------------------------

PIR_name = 'PIR'
DALI_name = 'SetValue'



-----------------------------------------------------------------------------------------------
DaliOutName, found = string.gsub(grp.alias(event.dst), PIR_name, DALI_name)


myobject = grp.find(DaliOutName)
log(myobject)


if event.getvalue()  then
  if  found == 1 then
    if grp.find(DaliOutName) then   -- check if output group exists

          grp.write(DaliOutName, onValue) --//
    else
      alert('Group address '..DaliOutName ..' does not exist' )   
    end 
  else
    alert('Group address has not correct name %s', event.dst)   
  end 

 
else
 
  if found == 1 then
    if grp.find(DaliOutName) then
      grp.write(DaliOutName, offValue) --//
    else
      alert('Group address '..DaliOutName ..' does not exist' )   
    end   
  else
    alert('Group address has not correct name %s', event.dst)
    end
end
 
-----------------------------------------------------------------------------------------------
------------------------------
Ctrl+F5
Reply


Messages In This Thread
trigging with tag - by vidar.karlsen@gk.no - 15.02.2021, 09:29
RE: trigging with tag - by Daniel - 15.02.2021, 10:44

Forum Jump: