This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

grp.update()
#1
Hi all,

I wrote an event-base script, triggered by 1/1/1, to be executed only if even 1/1/2 is true.

group address/tag = 1/1/1 (trigger)


To avoid the script being retriggered during its execution I thought to use this code:

a = grp.getvalue(1/1/1)
b = grp.getvalue(1/1/2)

if (a and b) then
  grp.update('1/1/2', 0)
  ....
  ....actions
  ....
  grp.update('1/1/2', 1)
end

I have two questions:

1) is there a better way to avoid retriggering (i.e. enable/disable script)?

2) why I can see a telegram, on the ETS group monitor, in conjuction with each update instruction even if with grp.update() 
"no KNX/TP telegram is sent, only internal value is changed"?

Thanks
Reply
#2
1. Do you have some long sequence with sleep calls there?
2. ETS is connected via IP so telegrams are visible there.
Reply
#3
Yes,

the original code is something like..

if (a and b) then
action 1
sleep 5 minutes
action2
end

Objectively there are two problems.
The first one is that a script is triggered both with value 0 or 1 of the trgger (this is the reason for the initial AND)
The second one is that each time a trigger is received a "brand new" copy of the same event-based script is executed, so after 5 minutes the first script executes action 2 even if a second script (or a third or..) is still running.

The simplest solution is the use of a.. scene.
It's possible to choose if the scene is executed when trigger address is 0 or 1 and a new trigger restarts the same scene extending the overall time.


Now I only have to make an external AND logic (1/1/1 AND 1/1/2) whose result will trigger the scene
Reply
#4
You will be better to use build in scene to run your actions with the delay as each new trigger will cancel already running scene.
------------------------------
Ctrl+F5
Reply


Forum Jump: