Page 1 of 1

Dummy button problem with execute

Posted: 08 Jan 2020, 02:59
by ZarysS
Hello, I have problem to execute event when state of dummy is changing.

First I wanted to sync state of button connected to GPIO with switch in domoticz, I followed this thread: https://www.domoticz.com/forum/viewtopic.php?t=18249
I did:
on 433v1#State do
if [Dummy#State]=1
TaskValueSet 1,1,0
sendtohttp domoticzip,8080,/json.htm?param=switchlight&type=command&idx=27&switchcmd=Off
else
TaskValueSet 1,1,1
SendToHTTP domoticzip,8080,/json.htm?param=switchlight&type=command&idx=27&switchcmd=On
endif
endon
433v1 button is set to push button active low

and on domoticz:
On Action: http://espip/control?cmd=taskvalueset,1,1,1
Off Action: http://espip/control?cmd=taskvalueset,1,1,0
And it is working well

Then I want to do some action when dummy state is changing
on Dummy#State do
if [Dummy#State]=1
gpio,12,1
gpio,16,1
gpio,13,0
delay,1500
gpio,14,0
else
gpio,13,1
gpio,14,1
gpio,12,0
delay,1500
gpio,16,0
endif
endon
Nevermind where I'm changing state of dummy (domoticz or button) always I have to wait 30-55s(randomly) for the GPIO state to change.

Where is problem?, It should happen immediately...

Re: Dummy button problem with execute

Posted: 08 Jan 2020, 04:32
by ThomasB
To immediately trigger the Dummy#State rule you should execute a TaskRun after the TaskValueSet. See this:
viewtopic.php?t=5092

- Thomas