If something greater (>) than then luup and Xml

so im writing a plugin and i need to use greater that & lesser than but it runs in the Implementation file the problem is i cant get it to work

using < or > in xml indicates a tag which give me Lua error

sp here is my code

[code]<?xml version="1.0"?>


function virtual_dimmable_light_startup (lul_device)
luup.log (“Virtual dimmable light running…”)
end

virtual_dimmable_light_startup


urn:upnp-org:serviceId:Dimming1
SetLoadLevelTarget

local CompSet
luup.variable_set (“urn:upnp-org:serviceId:Dimming1”, “LoadLevelTarget”, lul_settings.newLoadlevelTarget, lul_device)
luup.variable_set (“urn:upnp-org:serviceId:Dimming1”, “LoadLevelStatus”, lul_settings.newLoadlevelTarget, lul_device)

			local CompSet = luup.variable_get ("urn:upnp-org:serviceId:Dimming1", "LoadLevelTarget", 523)
			
		         local CompSet = luup.variable_get ("urn:upnp-org:serviceId:Dimming1", "LoadLevelTarget", 523)
			if (tonumber (CompSet, 10) == 0) then
				luup.call_action(weofwofejwfowf)
			elseif ((tonumber (CompSet, 10) >= 1) and (tonumber (CompSet, 10) <= 33 )) then
				luup.call_action(weofwofejwfowf)
			elseif ((tonumber (CompSet, 10) >= 34) and (tonumber (CompSet, 10) <= 66 )) then
				luup.call_action(weofwofejwfowf)
			elseif ((tonumber (CompSet, 10) >= 67) and (tonumber (CompSet, 10) <= 100 )) then
				luup.call_action(weofwofejwfowf)
			end			
					
							
			if (tonumber (lul_settings.newLoadlevelTarget, 10) == 0) then
				luup.variable_set ("urn:upnp-org:serviceId:SwitchPower1", "Status", "0", lul_device)
			else
				luup.variable_set ("urn:upnp-org:serviceId:SwitchPower1", "Status", "1", lul_device)
			end
			return 4, 5
						
		</job>
	</action>
</actionList>
[/code]

I have tried replacing it with (“>=” but still nothing

“luup.call_action(weofwofejwfowf)” is really not what im calling but its just a place holder

the function works perfectly when not in the xml format

Save yourself the hassle and split out the lua code into another file. It’s then pretty easy to test the lua code in the AltUI or UI7 lua test box with minor adjustments. Plus an editor that has syntax highlighting will show up misc syntax errors. Notepad++ works well. It’s all easier to read and maintain.

compSet is declared three times in your code and this line is also duplicated:
local compSet = luup.variable_get (“urn:upnp-org:serviceId:Dimming1”, “LoadLevelTarget”, DEVICE_523)
Magic numbers like 512 should be made a ‘Constant’ variable for clarity and easy software rework. You could rename DEVICE_523 to something meaningful.

The following may work. If it doesn’t, it’s close to correct. Need to replace L_MY_FILE_NAME.lua with your lua file name.
Not sure what you have planned for: luup.call_action(weofwofejwfowf)

Lua file:

[code]local THIS_LUL_DEVICE = nil
local DEVICE_523 = 523

local function setLoadLevelTarget(newLoadlevelTarget)

luup.variable_set ("urn:upnp-org:serviceId:Dimming1", "LoadLevelTarget", newLoadlevelTarget, THIS_LUL_DEVICE)
luup.variable_set ("urn:upnp-org:serviceId:Dimming1", "LoadLevelStatus", newLoadlevelTarget, THIS_LUL_DEVICE)

local compSet = luup.variable_get ("urn:upnp-org:serviceId:Dimming1", "LoadLevelTarget", DEVICE_523)
if (tonumber (compSet, 10) == 0) then
	luup.call_action(weofwofejwfowf)
elseif ((tonumber (compSet, 10) >= 1) and (tonumber (compSet, 10) <= 33 )) then
	luup.call_action(weofwofejwfowf)
elseif ((tonumber (compSet, 10) >= 34) and (tonumber (compSet, 10) <= 66 )) then
	luup.call_action(weofwofejwfowf)
elseif ((tonumber (compSet, 10) >= 67) and (tonumber (compSet, 10) <= 100 )) then
	luup.call_action(weofwofejwfowf)
end

if (tonumber (newLoadlevelTarget, 10) == 0) then
	luup.variable_set ("urn:upnp-org:serviceId:SwitchPower1", "Status", "0", THIS_LUL_DEVICE)
else
	luup.variable_set ("urn:upnp-org:serviceId:SwitchPower1", "Status", "1", THIS_LUL_DEVICE)
end

return 4, 5

end

– function needs to be global and is called at start up
function virtual_dimmable_light_startup (lul_device)
THIS_LUL_DEVICE = lul_device
luup.log (“Virtual dimmable light running…”)
end
[/code]

Implementation file:

<?xml version="1.0"?> <implementation> <files>L_MY_FILE_NAME.lua</files> <startup>virtual_dimmable_light_startup</startup> <actionList> <action> <serviceId>urn:upnp-org:serviceId:Dimming1</serviceId> <name>SetLoadLevelTarget</name> <job> <!-- We'll be explicit here, about what's being returned, just for the record --> local jobStatus, timeout = setLoadLevelTarget(lul_settings.newLoadlevelTarget) return jobStatus, timeout </job> </action> </actionList> </implementation>

you are a great man