Clear Command list after command

Moderator: leecollings

Post Reply
tre4bax
Posts: 22
Joined: Tuesday 23 September 2014 10:18
Target OS: Linux
Domoticz version:
Contact:

Clear Command list after command

Post 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.
pvm
Posts: 550
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: 4.10538
Location: NL
Contact:

Re: Clear Command list after command

Post 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?
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
tre4bax
Posts: 22
Joined: Tuesday 23 September 2014 10:18
Target OS: Linux
Domoticz version:
Contact:

Re: Clear Command list after command

Post 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?
tre4bax
Posts: 22
Joined: Tuesday 23 September 2014 10:18
Target OS: Linux
Domoticz version:
Contact:

Re: Clear Command list after command

Post 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!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests