Host a webpage on veralite

Good evening,
I’d like to use the push of IPX800 to start a scene vera on a change of state of an entry.
I have a problem because the Path of the IPX can not contain a field as wide as is necessary to start an event of vera via http.
The idea would be to host a page directly on the command that would launch vera http (in this case more problems for the query length html).
Is it possible to use the vera as “webserver” and to host a html page?

You could use [tt]http://wiki.micasaverde.com/index.php/Luup_Lua_extensions#function:_register_handler[/tt] to register a [tt]HTML[/tt] handler that runs your scene.

Thanks for your answer
how can i use this code ?

luup.register_handler(“lug_WapRequest”,“wap”)

function lug_WapRequest (lul_request, lul_parameters, lul_outputformat)
local lul_html = “\n” …
“Main\n” …
“\n” …
“\n” …
“Choose a room:
\n”
return lul_html
end

I should use the APPS=>Develop Apps=>Test Luup code (Lua) to register my page the first time ?

ok i have found the solution by puting the code in the Startup LUA.
Now i want to execute this command
http://192.168.0.5:3480/data_request?id=lu_action&output_format=xml&DeviceNum=21&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0

Do you know the syntax to put this command in this code ?
luup.register_handler(“lug_WapRequest”,“wap”)

function lug_WapRequest (lul_request, lul_parameters, lul_outputformat)
local lul_html = “\n” …
“Main\n” …
“\n” …
“\n” …
“Choose a room:
\n”
return lul_html
end

Something like

luup.register_handler( "off21", "off21" )
 
function off21( lul_request, lul_parameters, lul_outputformat )
   local httpStatusCode, content = luup.inet.wget( 'http://192.168.0.5:3480/data_request?id=lu_action&output_format=xml&DeviceNum=21&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0' )
   return httpStatusCode
end

should do the trick (use [tt]http://192.168.0.5:3480/data_request?id=lr_off21[/tt] to switch off device #21).

An alternative would be to use a scene and to run the scene via [tt]RunScene[/tt] (but the corresponding service id is rather long …).

Edit:
Bugs corrected (see below).

I have got this error :frowning:
ERROR : Error in lua for scenes and events
when i copy the code in the startup lua

i have already had this kind of error and it was the syntax who was wrong.
I tried delete some space but i didn’t find the error …

a. Replace all ‘21off’ with ‘off21’.
b. The correct URL is: [tt]http://192.168.0.5:3480/data_request?id=[u][b]lr_[/b][/u]off21[/tt]

The handler doesn’t survive a [tt]LuaUPnP[/tt] restart, place the code in the ‘Edit Startup Lua’ window.