Running rule first time after 2 sec after boot

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
mackowiakp
Normal user
Posts: 156
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Running rule first time after 2 sec after boot

#1 Post by mackowiakp » 04 Jul 2019, 07:15

How can I run rule listed below, for the first time 2 sec after boot and after that normally, without delay? Can I use %uptime% variable?

Code: Select all

On Clock#Time=All,**:** Do
 7dst,%syshour%,%sysmin%
EndOn

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

Re: Running rule first time after 2 sec after boot

#2 Post by grovkillen » 04 Jul 2019, 08:07

Code: Select all

On System#Boot Do
 TimerSet,1,2
EndOn

On Rules#Timer=1 Do
 7dst,%syshour%,%sysmin%
EndOn

On Clock#Time=All,**:** Do
 7dst,%syshour%,%sysmin%
EndOn
Or a bit more "program like":

Code: Select all

On System#Boot Do
 TimerSet,1,2
EndOn

On Rules#Timer=1 Do
 Event,UpdateDisplay
EndOn

On Clock#Time=All,**:** Do
 Event,UpdateDisplay
EndOn

On UpdateDisplay Do
 7dst,%syshour%,%sysmin%
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:

mackowiakp
Normal user
Posts: 156
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: Running rule first time after 2 sec after boot

#3 Post by mackowiakp » 04 Jul 2019, 08:25

I try something like as You propouse. But the problem is that part of rule:

Code: Select all

On Clock#Time=All,**:** Do
 Event,UpdateDisplay
EndOn
can run in any time, including two seconds waiting period. My goal is to never run this part of script after two seconds period after the boot.

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

Re: Running rule first time after 2 sec after boot

#4 Post by grovkillen » 04 Jul 2019, 16:43

I don't understand what you mean. Can you elaborate?
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:

mackowiakp
Normal user
Posts: 156
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: Running rule first time after 2 sec after boot

#5 Post by mackowiakp » 04 Jul 2019, 16:56

This part of the rule can be run at any time.

Code: Select all

On Clock#Time=All,**:** Do
 Event,UpdateDisplay
EndOn
Also during these 2 sec delay after boot. And my goal is to run, but never during those 2 sec to boot. I do not know if this is clearly described.

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

Re: Running rule first time after 2 sec after boot

#6 Post by grovkillen » 04 Jul 2019, 18:29

Ok, then you should do something like this.

Code: Select all

On System#Boot Do
 TimerSet,1,2
EndOn

On Rules#Timer=1 Do
 Let,1,1
 Event,UpdateDisplay
EndOn

On Clock#Time=All,**:** Do
 If [VAR#1]=1
  Event,UpdateDisplay
 Endif
EndOn

On UpdateDisplay Do
 7dst,%syshour%,%sysmin%
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:

mackowiakp
Normal user
Posts: 156
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: Running rule first time after 2 sec after boot

#7 Post by mackowiakp » 04 Jul 2019, 18:59

THX, SOLVED !!!

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests