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.

Script from specific part of a 6-byte?
#1
Hello!
I want to create a script that reads/checks a few groupadresses that are 6-byte and only look for a specific part of the 6-byte and if that part is '30'.

Then make an OR-gate that asks if any of my groupadresses shows 30 in the specific byte [6] send out true to a new groupadress else false.

See attached pictures. In logicmachine it is recorded as 'LTRF 3'. And in KNX it is shown as '30'.

Either a persistant script or I need the 6-byte adresses to start the other script that checks for the right byte.

I have tried for a while but cant come up with a solution!
Hope you understand my question.

Thanks for any help.  Smile

Best regards,
Tobias

Attached Files Thumbnail(s)
       
Reply
#2
Add dalitest tag to all DALI test result group addresses. Create an event script, attach it to dalitest tag. Change 1/1/1 to your error status group address. Make sure that error status address is not tagged.

Code:
objects = grp.tag('dalitest')

err = false

for _, object in ipairs(objects) do
  ltrf = object.value.ltrf
  if ltrf == 3 or ltrf == 4 then
    err = true
    break
  end
end

grp.checkupdate('1/1/1', err)
Reply
#3
Thanks for the help so far!

I cant get the event script to start. I see my dali-statuses coming in but my scrift wont activate.
What have I done wrong? See attached pictures.

Best regards,
Tobias

Attached Files Thumbnail(s)
           
Reply
#4
Your event script is not attached to a tag. Go to Scripting > Event-based. Click the relevant script and select the correct tag in "Group address / tag" field.
Reply
#5
I see, I did that now. Didnt know how to "attach a tag". Thanks alot.
But sadly I still dont see a reaction in my script when my dali-statuses activates and are tagged to my script.
Reply
#6
For the status object to change at least on of the test results must report an error.
Reply
#7
Ofcourse! I thought I would get an update even if no one showed an error. But I tested again with an error and it works, the scripts sends an error (true) and when I then remove the error the scripts sends false.

Seems to be working like I want.

Thanks so much for your time and help! You saved me.
Reply


Forum Jump: