Dummy button problem with execute

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
ZarysS
New user
Posts: 2
Joined: 08 Jan 2020, 02:36

Dummy button problem with execute

#1 Post by ZarysS » 08 Jan 2020, 02:59

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...

User avatar
ThomasB
Normal user
Posts: 1065
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Dummy button problem with execute

#2 Post by ThomasB » 08 Jan 2020, 04:32

To immediately trigger the Dummy#State rule you should execute a TaskRun after the TaskValueSet. See this:
viewtopic.php?t=5092

- Thomas

Post Reply

Who is online

Users browsing this forum: No registered users and 46 guests