Use globalData in dzvents active test?
Posted: Saturday 13 April 2019 23:18
Trying to use a globalData value in the active part of a dzvents script to determine whether to run it or not, like this:
This just errors - looks like it doesn't recognise globalData within the active section:
Is there a way to achieve this?
Thanks
Code: Select all
return {
active = function(domoticz)
return (domoticz.globalData.variablename ~= '')
end,
on = ...
Code: Select all
2019-04-13 22:16:00.503 Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: /home/pi/domoticz/scripts/dzVents/scripts/test.lua:4: attempt to index field 'globalData' (a nil value)Thanks