start rule after delay

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

start rule after delay

#1 Post by Dick60 » 19 Mar 2019, 19:47

Can anybody help me to finish my set of Rules.

If [kp#SC] = 1.00
TaskValueSet 1,1,[kp#SC]
SendToHTTP 192.168.1.123,8080,/json.htm?type=param=udevice&idx=317&nvalue=2&svalue=[dp#Df]
TaskValueSet 1,1,4
SendToHTTP 192.168.1.123,8080,/json.htm?type=param=udevice&idx=317&nvalue=2&svalue=[dp#Df]
Endif
Endon


This set of rules is working fine but I want to start this part after 5 seconds. Is there a way to get that working?

TaskValueSet 1,1,4
SendToHTTP 192.168.1.123,8080,/json.htm?type=param=udevice&idx=317&nvalue=2&svalue=[dp#Df]
Endif
Endon


I know I have to do something with "TimerSet" but dont know how to implement it

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: start rule after delay

#2 Post by grovkillen » 19 Mar 2019, 21:06

Code: Select all

On kp#SC do
 If [kp#SC]=1.00
  TaskValueSet,1,1,[kp#SC]
  SendToHTTP,192.168.1.123,8080,/json.htm?type=param=udevice&idx=317&nvalue=2&svalue=[dp#Df]
  TimerSet,1,5
 Endif
Endon

On Rules#Timer=1 do
 TaskValueSet,1,1,4
 SendToHTTP,192.168.1.123,8080,/json.htm?type=param=udevice&idx=317&nvalue=2&svalue=[dp#Df]
EndOn

ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: start rule after delay

#3 Post by Dick60 » 19 Mar 2019, 21:23

Thanks for the reply. It works fine for only this entry of my keypad. If I want to use the same for more buttons from my keypad, how does it look like? I think I have to do something with the Endif and Endon but do not know what. Pls advise me.

On kp#SC do
If [kp#SC]=1.00
TaskValueSet,1,1,[kp#SC]
SendToHTTP,192.168.1.123,8080,/json.htm?type=param=udevice&idx=317&nvalue=2&svalue=[dp#Df]
TimerSet,1,5
Endif
Endon

On Rules#Timer=1 do
TaskValueSet,1,1,4
SendToHTTP,192.168.1.123,8080,/json.htm?type=param=udevice&idx=317&nvalue=2&svalue=[dp#Df]
EndOn

If [kp#SC] = 2.00
TaskValueSet 1,1,[kp#SC]
SendToHTTP 192.168.1.123,8080,/json.htm?type=param=udevice&idx=317&nvalue=2&svalue=[dp#Df]
TimerSet,1,5
Endif
Endon

On Rules#Timer=1 do
TaskValueSet,1,1,0
SendToHTTP,192.168.1.123,8080,/json.htm?type=param=udevice&idx=317&nvalue=2&svalue=[dp#Df]
EndOn

If [kp#SC] = 3.00
TaskValueSet 1,1,[kp#SC]
SendToHTTP 192.168.1.123,8080,/json.htm?type=param=udevice&idx=317&nvalue=2&svalue=[dp#Df]
TimerSet,1,5
Endif
Endon

Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: start rule after delay

#4 Post by Dick60 » 19 Mar 2019, 21:53

I've got it. Had put test more.
Thanks!

Code: Select all

On kp#SC do
 If [kp#SC]=1.00
  TaskValueSet,1,1,[kp#SC]
  SendToHTTP,192.168.1.123,8080,/json.htm?type=param=udevice&idx=317&nvalue=2&svalue=[dp#Df]
  TimerSet,1,5
 If [kp#SC] = 2.00
TaskValueSet 1,1,[kp#SC]
SendToHTTP 192.168.1.123,8080,/json.htm?type=param=udevice&idx=317&nvalue=2&svalue=[dp#Df]
TimerSet,2,5
If [kp#SC] = 3.00
TaskValueSet 1,1,[kp#SC]
SendToHTTP 192.168.1.123,8080,/json.htm?type=param=udevice&idx=317&nvalue=2&svalue=[dp#Df]
TimerSet,3,5
Endon
Endif

On Rules#Timer=1 do
 TaskValueSet,1,1,2
 SendToHTTP,192.168.1.123,8080,/json.htm?type=param=udevice&idx=317&nvalue=2&svalue=[dp#Df]
EndOn
On Rules#Timer=2 do
 TaskValueSet,1,1,4
 SendToHTTP,192.168.1.123,8080,/json.htm?type=param=udevice&idx=317&nvalue=2&svalue=[dp#Df]
EndOn
On Rules#Timer=3 do
 TaskValueSet,1,1,6
 SendToHTTP,192.168.1.123,8080,/json.htm?type=param=udevice&idx=317&nvalue=2&svalue=[dp#Df]
EndOn

Post Reply

Who is online

Users browsing this forum: No registered users and 36 guests