I'have the following lua script:
Code: Select all
--script_device_Tempdroogkast.lua
local sensorcr = 'Cresta' --name of the sensor that gets created when you add t$
local idx = 189 --idx of the humidity sensor you created for scrapping the temp$
commandArray = {}
if devicechanged[sensorcr] then
sCrestaTemp, sCrestaHumidity = otherdevices_svalues[sensorcr]:match("([^;]+)$
sCrestaHumidity = tonumber(sCrestaHumidity)
commandArray['UpdateDevice'] = idx .. '|0|' .. (sCrestaHumidity)
print("Droogkast luchtvochtigheid is " .. sCrestaHumidity .. "% ");
end
return commandArray
The log file gives me the following back:
2016-05-13 08:52:36.065 LUA: Droogkast luchtvochtigheid is 63%
2016-05-13 08:53:19.067 EventSystem: Script event triggered: /home/swokey/domoticz/scripts/lua/script_device_humdroogkast.lua
So the script is executed, but the 'last seen' of the device (189) is then also 8:53 only the humidity is 0%
Any idea why the humidity isn't updated?