18.02.2019, 22:58
(This post was last modified: 18.02.2019, 22:58 by Erwin van der Zwart.)
Hi,
Try this:
Try this:
Code:
-- Load needed libs
require('uci')
require('json')
-- Add objects without data type
add_no_dpt = true
jsonstring = [[
-- Paste here your JSON result from http://openrb.com/knxproj/
]]
-- Create formadata
formdata = {
file = jsonstring,
json = true,
addempty = add_no_dpt, -- optional "add groups without data type"
}
-- Function to get vars
function getvar(k)
return formdata[ k ]
end
-- Function upload (dummy)
function upload()
-- empty function must be here as normaly the file gets uploaded
end
-- Execute action to create objects from JSON
res = dofile('/lib/genohm-scada/web/objects/import.lua')
--log(res)
-- Disable current script
script.disable(_SCRIPTNAME)