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.

Read many KNX group adresses in one go.
#1
Hi

I would like to have a script that checks the values of several group adresses in KNX at a certain time of day.

How can I set this up in an easy way? I understand I can just do grp.read(), but how can I do this to more than one GA's without having to type in a lot of lines.

BR
Trond
There are 10 kinds of people in the world; those who can read binary and those who don't  Cool
Reply
#2
Tag every object you want to read, for example: read_chk1
In scheduler script loop in your tags like:

myobjects = grp.tag('read_chk1')
for index, value in ipairs(myobjects) do
 -- here your code
end
Reply
#3
Hm...
Did not work. I entered the following:

----------------------------------------------------------
myobjects = grp.tag('Status_value')

for index, value in ipairs(myobjects) do
grp.read(myobjects)


end

grp.read('0/0/3')
-----------------------------------------------

The last grp.read() is just for me to see that the script is running...

I did not get any read requests on the group adresses tagged with 'Status_value'. Maybe the grp.read() is not the correct command to use in my case?

I am rather new to this scripting things, so please bear with me :-)
There are 10 kinds of people in the world; those who can read binary and those who don't  Cool
Reply
#4
Also, keep in mind that read sends a KNX read telegram and does not return object value. If you want to get current object value then you should use grp.getvalue instead.
Reply
#5
Use this for tags:
Code:
myobjects = grp.tag('Status_value')
myobjects:read()
Reply
#6
Hi,

myobjects is a table that is read line by line, each line is now set to value and is (in this case) also a table, value.address is the field you need..

use: grp.read(value.address)

BR,

Erwin
Reply
#7
...so simple...

Worked perfectly! Thanks!
There are 10 kinds of people in the world; those who can read binary and those who don't  Cool
Reply


Forum Jump: