Have been trying to run the script every 5 seconds.
Code: Select all
return {
active = true,
on = {
timer = {'every 5 seconds'},
devices = {'Power'},
},
execute = function(dz, livepower)
local DomDevice = 'Power'
local IP = '192.168.0.53'
local DomValue = otherdevices_svalues[DomDevice]
local str = DomValue
local words = {}
for word in str:gmatch("([^;]+)") do table.insert(words, word) end
DomValue= words[5]
if ((words[5]) == '0') then
DomValue = "-" .. words[6]
end
runcommand = "curl http://" .. IP .. "/control?cmd=LCD,1,1," ..DomValue.. " " ;
os.execute(runcommand);
end
}