Passing Lua variable to scene via URL

Hi, I have searched around for a method to pass a variable to a Lua scene via URL: “Vera.IP:port/data_request/id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=&RunScene&SceneNum=1”

I can get a scene to run just fine, but what if I want to set a variable in the script the scene runs? I don’t mean a device variable (I saw how to do that). Even if I were able to just set a global variable via URL, that would satisfy my requirements. Is there a way to call a scene while specifying a variable all in one URL?

Thanks for the help!

Do two requests …
The first to run LUA code … in that code set the variable.
Then run your scene (or you can run it right after setting the variable).

…or if you want a bit more flexibility, it’s really easy to write an HTTP request handler which can have any parameters you like (and, in turn, run a scene if necessary.)

You’d use luup.register_handler() to set it up in Startup Lua.

[hr]

Edit: Actually, I previously posted a complete example here:

http://forum.micasaverde.com/index.php/topic,39814.msg296454.html#msg296454

Thanks guys! I actually just found that I could make a virtual device and set a custom variable on that device which would act like my global. I appreciate the responses, though :slight_smile: