Lua_Parser scripts - global tables

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!
Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post
Post Reply
boe666
Posts: 21
Joined: Thursday 19 January 2017 17:14
Target OS: Raspberry Pi
Domoticz version:
Contact:

Lua_Parser scripts - global tables

Post by boe666 » Monday 14 May 2018 9:54

Version:3.9439
Platform:Pi2

I have no access to otherdevices_svalues and other global tables - are empty.
The example from wiki:
function LogVariables(x,depth,name)
for k,v in pairs(x) do
if (depth>0) or ((string.find(k,'device')~=nil) or (string.find(k,'variable')~=nil) or
(string.sub(k,1,4)=='time') or (string.sub(k,1,8)=='security')) then
if type(v)=="string" then print(name.."['"..k.."'] = '"..v.."'") end
if type(v)=="number" then print(name.."['"..k.."'] = "..v) end
if type(v)=="boolean" then print(name.."['"..k.."'] = "..tostring(v)) end
if type(v)=="table" then LogVariables(v,depth+1,k); end
end
end
end
-- call with this command
LogVariables(_G,0,'');
Print NOTHING.
Is it error or not ? Will be fixed ?

boe666
Posts: 21
Joined: Thursday 19 January 2017 17:14
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Lua_Parser scripts - global tables

Post by boe666 » Wednesday 16 May 2018 9:54

Nobody can say something about this problem? Without access to global tables in lua_parses - domoticz can't be functional.

dannybloe
Posts: 1405
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi
Domoticz version:
Location: Ermelo
Contact:

Re: Lua_Parser scripts - global tables

Post by dannybloe » Saturday 19 May 2018 9:16

Use dzVents and you don't have to do all of this and still code in Lua.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.

Post Reply

Who is online

Users browsing this forum: adkollau, Exabot [Bot], JeroenL and 4 guests