timer

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
pawell32
Normal user
Posts: 18
Joined: 13 Aug 2020, 07:45

timer

#1 Post by pawell32 » 02 Sep 2020, 15:07

hello,

timer is not working, what am doing wrong ?


On Rules#Timer=1 Do
TimerSet,1,2
LCD,1,1,%systime%
endon

TD-er
Core team member
Posts: 8752
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: timer

#2 Post by TD-er » 02 Sep 2020, 15:09

How do you initially start the timer?
What is the rest of the rules?
Or do you send a command to start the timer?

pawell32
Normal user
Posts: 18
Joined: 13 Aug 2020, 07:45

Re: timer

#3 Post by pawell32 » 02 Sep 2020, 15:14

i want to start the timer on startup.

TD-er
Core team member
Posts: 8752
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: timer

#4 Post by TD-er » 02 Sep 2020, 15:15

And how did you do that in the rules you now have?

pawell32
Normal user
Posts: 18
Joined: 13 Aug 2020, 07:45

Re: timer

#5 Post by pawell32 » 02 Sep 2020, 15:21

i dont`t know how to initiate it

pawell32
Normal user
Posts: 18
Joined: 13 Aug 2020, 07:45

Re: timer

#6 Post by pawell32 » 02 Sep 2020, 15:24

i want to refresh my screen every second

TD-er
Core team member
Posts: 8752
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: timer

#7 Post by TD-er » 02 Sep 2020, 15:32

From the documentation:
https://espeasy.readthedocs.io/en/lates ... ore-events

Code: Select all

on System#Boot do
  timerSet,1,1
endon

On Rules#Timer=1 Do
  TimerSet,1,2
  LCD,1,1,%systime%
endon
Edit:
See also: https://espeasy.readthedocs.io/en/lates ... nds-listed
For recent builds you can also use loopTimerSet.

pawell32
Normal user
Posts: 18
Joined: 13 Aug 2020, 07:45

Re: timer

#8 Post by pawell32 » 02 Sep 2020, 15:38

thank you

timerSet=1,10 -> timerSet,1,1

pawell32
Normal user
Posts: 18
Joined: 13 Aug 2020, 07:45

Re: timer

#9 Post by pawell32 » 03 Sep 2020, 10:25

it shows me every 2 seconds, not every one

User avatar
Ath
Normal user
Posts: 3517
Joined: 10 Jun 2018, 12:06
Location: NL

Re: timer

#10 Post by Ath » 03 Sep 2020, 10:38

pawell32 wrote: 03 Sep 2020, 10:25 it shows me every 2 seconds, not every one
Well, there is a solution for that:
- Use the new LoopTimerSet / LoopTimerSet_ms commands to set up an automatic repeating timer, that will go off every second, as currently you restart the timer and it is scheduled somewhere for the next second, effectively skipping a partial second
/Ton (PayPal.me)

pawell32
Normal user
Posts: 18
Joined: 13 Aug 2020, 07:45

Re: timer

#11 Post by pawell32 » 03 Sep 2020, 11:36

on System#Boot do
timerSet,1,1
endon
On Rules#LoopTimerset=1 Do
timerset,1,1
7dn,%syssec_0%
endon


I don't know how to use it

TD-er
Core team member
Posts: 8752
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: timer

#12 Post by TD-er » 03 Sep 2020, 12:35

Code: Select all

on System#Boot do
  loopTimerSet,1,1
endon

On Rules#Timer=1 Do
  LCD,1,1,%systime%
endon

pawell32
Normal user
Posts: 18
Joined: 13 Aug 2020, 07:45

Re: timer

#13 Post by pawell32 » 03 Sep 2020, 12:40

:(
not working

TD-er
Core team member
Posts: 8752
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: timer

#14 Post by TD-er » 03 Sep 2020, 12:42

What build are you using?
The looptimer has been introduced with build 2020/08/12

pawell32
Normal user
Posts: 18
Joined: 13 Aug 2020, 07:45

Re: timer

#15 Post by pawell32 » 03 Sep 2020, 12:46

ESP_Easy_mega_20200801_normal_ESP8266_4M1M

TD-er
Core team member
Posts: 8752
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: timer

#16 Post by TD-er » 03 Sep 2020, 13:37

So please use a more recent build, if you want to have a more precise timer interval.
The loop timer has only been introduced in later builds.

Smotek7
Normal user
Posts: 142
Joined: 01 Aug 2020, 16:18
Location: SK

Re: timer

#17 Post by Smotek7 » 17 Oct 2020, 12:40

I have problems with the rules.
I'm using the version
ESP_Easy_mega_20200929_test_beta_ESP8266_4M1M
If I create a rule:

On System#Boot do
tone,14,100,05
gpio,12,0
timerSet,1,1
endon

On Rules#Timer=1 do
gpio,12,1
timerSet,2,1
endon

On Rules#Timer=2 do
gpio,12,0
timerSet,1,1
endon

The rule is not executed.
But if I turn on the Old engine.
That's how it works.
What does it cause?

User avatar
Ath
Normal user
Posts: 3517
Joined: 10 Jun 2018, 12:06
Location: NL

Re: timer

#18 Post by Ath » 17 Oct 2020, 13:04

The 'Old' engine is the current way of executing the rules from Rules1..4.txt files, so it should be enabled if you want these to be executed.
That's by design, the design for the 'New' rules isn't completed yet, and not fully backward compatible atm.
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8752
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: timer

#19 Post by TD-er » 17 Oct 2020, 14:19

And to complement Ton's answer.
I don't think the "new rules" as they are implemented right now, will probably not be continued.
Maybe I should relabel them as "experimental" instead of "new"

Smotek7
Normal user
Posts: 142
Joined: 01 Aug 2020, 16:18
Location: SK

Re: timer

#20 Post by Smotek7 » 17 Oct 2020, 15:33

Is it written somewhere, please?
It would be good to write it to the Old engine check box.

User avatar
Ath
Normal user
Posts: 3517
Joined: 10 Jun 2018, 12:06
Location: NL

Re: timer

#21 Post by Ath » 17 Oct 2020, 17:29

When enabling rules, the Old engine is enabled by default. If you disable that, you won't be able to edit the 'Old' rules, so they won't be executed. No reason to disable that option, I would say...
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: No registered users and 101 guests