It there a easy way to copy/backup all my personal lua code which i use in scenes?
I have the tool zerobrane studio where i can script/program and test.
I am looking for an easy way to extract all my scenes from my current vera unit to my pc where i can store it and work offline to change/modify them but also to backup them.
I now do a copy paste from the UI5 into a empty file but this does not work easily.
So is there a way to connect to the vera unit and read all scenes/lua code direct and also backup them?
I mean the code i entered myself in the scenes in the luup tab
And then ALL code from ALL scenes i entered, i now have about 20 scenes and scenes can be triggered (with own luup code) or sheduled.
I search a way to get all the scenes to my local pc including the code i made myself, i mean the exact code as is vissible in the UI or zerobrane editor
In fact, here’s a bit of code which prints out the bits you need (it can run directly in Rex Beckett’s LuaTest window)
local _,x = luup.inet.wget "http://127.0.0.1:3480/data_request?id=user_data2"
local json = require "dkjson"
local j = json.decode (x)
print ""
print "-- Startup Lua:"
print (j.StartupCode)
print "-- Scene Lua"
for _,s in pairs(j.scenes) do
if s.lua then
print ("--",s.name)
print (s.lua)
end
end
Looks like the user_data request includes all the LUA you can specify via the GUI. If you happen to load LUA directly on to the Vera (i.e. uploading by hand) it will not be included here.
If you are not afraid of SSH then you can peek into /etc/cmh-ludl and pull all the LUA out of there. Most of the files are LZO compressed so you will need to decompress them before you can read them.