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.

Export objects / GA
#4
Old fashion script (:

Code:
--Export to FTP
objects_table = db:getall('SELECT * FROM objects')
jsonstring = require('json').encode(objects_table)
io.writefile('/www/user/objects.txt', jsonstring)
script.disable(_SCRIPTNAME)

Copy objects.txt from Apps FTP user folder to your other controller

Code:
--Import from FTP
objectstring = io.readfile('/www/user/objects.txt')
newobjects_table = require('json').pdecode(objectstring)
for _, object in ipairs(newobjects_table) do
  exist = grp.alias(object.name)
  if exist == nil then
    objectaddress = knxlib.decodega(object.address)
    grp.create({
      address = objectaddress,
      name = object.name,
      datatype = object.datatype,
      comment = object.comment,
      units = object.units,
      tags = object.tagcache,
      enums = object.enums,
      visparams = object.visparams,
    })
  end
end
script.disable(_SCRIPTNAME)
Reply


Messages In This Thread
Export objects / GA - by pioneersteffen - 20.12.2024, 05:43
RE: Export objects / GA - by admin - 20.12.2024, 07:26
RE: Export objects / GA - by pioneersteffen - 20.12.2024, 08:47
RE: Export objects / GA - by Erwin van der Zwart - Yesterday, 09:55
RE: Export objects / GA - by pioneersteffen - Yesterday, 14:16

Forum Jump: