Interesting. I have never had a problem with having a < in lua code. I guess it depends on how you are getting the LUA code uploaded to Vera (I use a copy and paste operation from a text file to the LUA code section of a scene).
You can see what is legal in the LUA language at www.lua.org.
basd82, when you say it is not working, how is it not working? If I was approaching this problem, I probably would put a few logging statements in to see what is exactly happening. The most simple way to do this is using “kwikLog”, as described in the “Conditional Scene Execution” thread in the scene scripting section.
Interesting. I have never had a problem with having a < in lua code. I guess it depends on how you are getting the LUA code uploaded to Vera (I use a copy and paste operation from a text file to the LUA code section of a scene).
It causes a problem in plugin Implementation files because they are treated as XML. I have also not found it to be a problem in scene Lua (at least not in UI5!).
I have found the sollution.
this is luup code i use to switch my light when its dark engough so every one who need can use it
[code]local LOW_LEVEL = 300 – the light level threshold for night
local DEVICE_NO = 34 – the light sensor device number
local LS_SID = “urn:micasaverde-com:serviceId:LightSensor1” – the LightSensor service ID
local LIGHT_DEVICE_NO = 29 – the light device number
local LIGHT_DIM_LEVEL = 60 – the dim level of the light
local currentLevel = luup.variable_get (LS_SID, “CurrentLevel”, DEVICE_NO) or 0
currentLevel = tonumber(currentLevel)
if currentLevel <= LOW_LEVEL then
luup.call_action(“urn:upnp-org:serviceId:Dimming1”, “SetLoadLevelTarget”, {newLoadlevelTarget = LIGHT_DIM_LEVEL}, LIGHT_DEVICE_NO)
else
return false
end[/code]
Best Home Automation shopping experience. Shop at Ezlo!