luup.variable_watch in a scene

I try to learn how this function work, for now all i want is if the variable change, turn up a light, here the code:

[code]luup.variable_watch (‘no_dimming’, ‘urn:micasaverde-com:serviceId:RfArduino1’, ‘Received’, 98)

function no_dimming (lul_device, lul_service, lul_variable, lul_value_old, lul_value_new)
luup.call_action(‘urn:upnp-org:serviceId:Dimming1’, ‘SetLoadLevelTarget’, { newLoadlevelTarget=‘90’ }, 52)
end[/code]

Device is 98 and is worcking good, Received is the variable. What i am doing wrong.

I create a scene with this code in the luup section.

Thank
Mic

I don’t think this works in a scene. If you look at the log you will probably find that the function is undefined. I think the callback only works in the context of device code?

Ok,
Could i take the motion sensor file and change the luup code in the implementation file?

Thanks

Can you put it in the Start Up code?

Same as a scene, I think.
At any rate, when I tried it, it gave the same error.
Give it a go!!

Can you put it in the Start Up code?[/quote]

I stand corrected. It should work. The reason it never worked for me is described here…
[url=http://forum.micasaverde.com/index.php/topic,15933.msg129222.html#msg129222]http://forum.micasaverde.com/index.php/topic,15933.msg129222.html#msg129222[/url]