http request on event

Hello,

I own a Vera Lite and I would like to program my device so that whenever there is an event going on, an URL is called with some parameters.

I have a webserver which respond to HTTP Get requests and I would like my vera lite controller to call it whenever a light is turned on or off, or when a sensor is triggered, etc.

My URL would look somewhat like this :
http://mywebserver.net/vera/lightturnedon?deviceid=123123

How can I do that?

Thanks in advance for your help!
Alex

Hi,

You can set a variable_watch on all variables and devices and put that in the start up code. However, I am not sure doing an http request on any and all changes will do good for your Vera’s stability.

You would have to write a function that gets called when a variable changes and add the variable_watch

[code]function myMonitor(lul_device, lul_service, lul_variable, lul_value_old, lul_value_new)
– do you thing
end

luup.variable_watch(‘myMonitor’, nil, nil, nil)
[/code]

You might want to set more specific watch functions specific to the devices and variables you want to be monitoring.

Have a look at the wiki for more information [url=http://wiki.mios.com/index.php/Luup_Lua_extensions#function:_variable_watch]Luup Lua extensions - MiOS And… make a backup of your Vera before trying this.

Have fun

Cheers Rene

ALTUI plugin does this natively, for instance it calls IFTTT webhook when a chosen device variables changes