Yesterday, 09:55
(This post was last modified: Yesterday, 09:58 by Erwin van der Zwart.)
Old fashion script (:
Copy objects.txt from Apps FTP user folder to your other controller
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)