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.

Can not change parameter visparams when using grp.create
#1
.lua   51.lua (Size: 2.74 KB / Downloads: 2)

Hello,
 I have a homeLynk HW 1.2 , Firmware 1.5.1 in operation for 7 years and now I have implemented scripts to read data from  a Kostal inverte Plenticore plus.
Had succes to read all 125 data point by Modbus TCP. I have generated all KNX Objekts by scripts and it works while using the essetial KNX object parameter with
grp.create.
myobject = grp.create({
    datatype = dt.float32,
    address = Gruppenaddresse,
    name = "Test float32 und visparams",
    units = " W",   
    tags =  "Plenticore",
    visparams=grp_visparams
      })

But I am failing to change the visualisation parameter  with the table of visparams.
After creating the object I read its parameter with
log("Grp lesen",grp.find(Gruppenaddresse))
but do not see the table visparams in the log

Changing the visu parameter manually and  do a
log("Grp lesen",grp.find(Gruppenaddresse))
Now I have suuccess I got the string of visparams as json.

I have attached the script 51.lua with the lua code that is showing the described behaviour.

Need some information if it possible to change visparams by script using my HW/SW combination.
Reply
#2
You have very old firmware which does not support setting visparams in grp.create.
Reply
#3
(12.07.2022, 15:29)admin Wrote: You have very old firmware which does not support setting visparams in grp.create.

Thanks for immediate information. Unfortunatly I expected it.
Reply
#4
You can do this via a direct DB query:
Code:
addr = '32/1/1'

grp_visparams = {
  ["max"]="10000",
  ["min"]="0",
  ["step"]="",
  ["control"]="spinner",
  ["decimals"]="0",
}

json_visparams = json.encode(grp_visparams)

id = knxlib.encodega(addr)
db:query('UPDATE objects SET visparams=? WHERE id=?', json_visparams, id)
Reply
#5
(13.07.2022, 06:13)admin Wrote: You can do this via a direct DB query:
Code:
addr = '32/1/1'

grp_visparams = {
  ["max"]="10000",
  ["min"]="0",
  ["step"]="",
  ["control"]="spinner",
  ["decimals"]="0",
}

json_visparams = json.encode(grp_visparams)

id = knxlib.encodega(addr)
db:query('UPDATE objects SET visparams=? WHERE id=?', json_visparams, id)

Great!!!!!! I took your code proposal, inserted it in my code and it is working. Smile Cool 
Thank you very much for your support.
Reply


Forum Jump: