Need some help with basic LUA
Posted: Wednesday 13 July 2016 9:48
Hi,
I'm trying to get started with LUA.
Grateful if anyone can help me in the right direction.
The script runs and lights the lamp when the temperature is above 20 degrees.
But I get an error message in the log. I suspect that 20 is a string value. But do not understand how to convert the value.
The script:
Error message:
Error: EventSystem: in SovrumTermostat: [string "--..."]:7: attempt to compare number with nil
Best regards, Mikael
I'm trying to get started with LUA.
Grateful if anyone can help me in the right direction.
The script runs and lights the lamp when the temperature is above 20 degrees.
But I get an error message in the log. I suspect that 20 is a string value. But do not understand how to convert the value.
The script:
Code: Select all
commandArray = {}
if devicechanged['Sovrum_Temperature'] > 20 then
commandArray['Skrivbord']='On'
end
return commandArray
Error: EventSystem: in SovrumTermostat: [string "--..."]:7: attempt to compare number with nil
Best regards, Mikael