timer problem

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Cdrx34
New user
Posts: 6
Joined: 09 Jun 2020, 20:44

timer problem

#1 Post by Cdrx34 » 03 Mar 2022, 09:25

Hello,
Following the update of my esp8266 to the latest firmware, I find myself having a timer problem in a rules.

The timer runs fine but the timeout is not seconds:
If I put 4s I have about 15min
If I but 5s that this counts in several hours.

The NTP is apparently correctly configured, do you have an idea of ​​the problem?

Thanks in advance for your feedback.

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

Re: timer problem

#2 Post by Ath » 03 Mar 2022, 11:23

Please show your rules, so we can understand what you are doing there.
/Ton (PayPal.me)

Cdrx34
New user
Posts: 6
Joined: 09 Jun 2020, 20:44

Re: timer problem

#3 Post by Cdrx34 » 03 Mar 2022, 14:52

My project will allow the filling of a swimming pool automatically with a notification if the solenoid valve is driven too long.

Code: Select all

on Niveau#Niveau = 1 do
	if [Notifuite#Alarme]=0
		gpio,14,1
		timerSet,1,120
	endif
endon

on Niveau#Niveau = 0 do
		gpio,14,0
	endif
endon

on Rules#Timer=1 do
	notify 1
	gpio,14,0
	TaskValueSet 11,2,1
endon[/i][/i]

User avatar
iron
Normal user
Posts: 221
Joined: 24 Sep 2016, 08:37
Location: Greece
Contact:

Re: timer problem

#4 Post by iron » 03 Mar 2022, 16:34

Code: Select all

on Niveau#Niveau = 0 do
		gpio,14,0
	endif
There is an IF missing here. no ?
-D

Cdrx34
New user
Posts: 6
Joined: 09 Jun 2020, 20:44

Re: timer problem

#5 Post by Cdrx34 » 03 Mar 2022, 17:28

No endif is too much, I had made modifications to try to solve my problem and I forgot to remove it

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

Re: timer problem

#6 Post by Ath » 03 Mar 2022, 21:23

I'd re-do the rules a bit, like this:

Code: Select all

on Niveau#Niveau do
  if %eventvalue1%=1
    if [Notifuite#Alarme]=0 // When is this variable reset?
      gpio,14,1
      timerSet,1,120
    endif
  else
    gpio,14,0
  endif
endon

on Rules#Timer=1 do
  notify 1
  gpio,14,0
  TaskValueSet Notifuite,Alarme,1 // Names assumed correct?
endon
Not sure if that TaskValueSet command is mapped right, but it's more readable and portable to use the names instead of the numbers.
/Ton (PayPal.me)

Cdrx34
New user
Posts: 6
Joined: 09 Jun 2020, 20:44

Re: timer problem

#7 Post by Cdrx34 » 03 Mar 2022, 23:08

Thanks for your feedback.
I will try this way.
The variable [Notifuite#Alarme] is reset by an Android application.

Cdrx34
New user
Posts: 6
Joined: 09 Jun 2020, 20:44

Re: timer problem

#8 Post by Cdrx34 » 04 Mar 2022, 21:30

Hello,
Still same problem with this code, the time is not in seconds.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Semrush [Bot] and 45 guests