Hi,
I am working on a plugin that uses callback functions such as luup.variable_watch(…) and luup.call_delay(…) and the calls looks like (it’s now hardcoded to drill down the problem):
[code]luup.variable_watch(‘watchSensorVariable’, “urn:micasaverde-com:serviceId:EnergyMetering1”, “Watts”, 12)
luup.call_delay(‘publishPing’, 15, “”, false)[/code]
Callback functions looks like:
[code]function publishPing()
luup.log(“Publish ping message”, 1)
– more code
end
function watchSensorVariable(deviceNo, serviceId, variableName, oldValue, newValue)
luup.log(“watchSensorVariable”,1)
– more code
end[/code]
The problem is that the functions aren’t called and the following get logged:
LuaInterface::CallFunction_Variable func: watchSensorVariable Device_Variable 14 urn:micasaverde-com:serviceId:EnergyMetering1:Watts failed attempt to call a nil value ... LuaInterface::CallFunction_Timer-5 function publishPing failed attempt to call a nil value
I have the code in a .lua file referenced in I_.xml and lua file contains
module(“L_MyModule”, package.seeall)
Do you have any idea why it doesn’t work?