Mic
September 1, 2013, 5:18pm
#1
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
akbooer
September 1, 2013, 5:26pm
#2
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?
Mic
September 1, 2013, 5:29pm
#3
Ok,
Could i take the motion sensor file and change the luup code in the implementation file?
Thanks
parkerc
September 12, 2013, 8:50pm
#4
Can you put it in the Start Up code?
akbooer
September 12, 2013, 9:01pm
#5
Same as a scene, I think.
At any rate, when I tried it, it gave the same error.
Give it a go!!
akbooer
September 30, 2013, 9:46am
#6
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]