Global variables always nil
Posted: Thursday 24 May 2018 22:44
Hi,
I have created a "global_data.lua", stored in "/home/pi/domoticz/scripts/dzVents/scripts"
all three of them are always "nil". When trying to print , f.e.:
I always get the error
there is no other global_data.lua file on my raspi. Also tried to move it to "/home/pi/domoticz/scripts" , same problem. User Variables table in domoticz web interface is empty.
Any ideas?
I have created a "global_data.lua", stored in "/home/pi/domoticz/scripts/dzVents/scripts"
Code: Select all
return {
helpers = {},
data = {
testini = { initial = 12.4 }
testinix = { initial = 12 }
timedOff = { initial = false }
}
}
Code: Select all
domoticz.log(domoticz.globalData.testinix, domoticz.LOG_INFO)
Code: Select all
2018-05-24 22:22:21.675 Error: dzVents: Error: An error occured when calling event handler TestGlobalVar
2018-05-24 22:22:21.675 Error: dzVents: Error: /home/pi/domoticz/scripts/dzVents/runtime/Utils.lua:62: attempt to concatenate local 'msg' (a nil value)
Any ideas?