Page 1 of 1

Clear Command list after command

Posted: Monday 29 August 2016 20:16
by tre4bax
Hi there,

Clearly when you send a command in the command array it is continually reapplied from that point. Is there any way to stop this from happening?

If for example I set a light to off using LUA it then becomes impossible to turn the light back on manually. That just is not going to work for me I need to be able to influence the state of the device and then allow it to control itself from there.

Am I doing something wrong? or is there another way to achieve turning off a light?

Have to say I struggled to figure out how to dimm a light. Eventually worked out the "Set Level: xx %" string. Is there a definitive list of these somewhere as if there is I could not find it.

Many thanks for any help you can give.

Re: Clear Command list after command

Posted: Monday 29 August 2016 23:17
by pvm
Hoe often do you execute the lua script? Is that the reason for not bei g able to turn the light on manually?

Re: Clear Command list after command

Posted: Tuesday 30 August 2016 10:28
by tre4bax
A good question, one I don't really know the answer to. I created the script through the events editor and then just modified the content. It seems to be called regularly but my assumption was that it was called when a switch change was detected.

What I've now realised is that my script is looking for a mood controller and switching off a light based on the status of the buttons. That status is set when the controller is and remains until the next press of a mood controller button. As the script is operating on a timed basis each time it finds the mood controller, examines the value and sets the light to off. If I manually turn the light on it just turns off a few moments later when the script runs again.

Feels like the solution might be to attach the script to the actual mood controller or something?

Re: Clear Command list after command

Posted: Tuesday 30 August 2016 10:35
by tre4bax
Just sussed it. I used the All event to create the script. I hadn't noticed the drop down. Now I have created a device based script I see it iterates the changed devices and all devices every time.

Doh!