Page 1 of 1

timer problem

Posted: 03 Mar 2022, 09:25
by Cdrx34
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.

Re: timer problem

Posted: 03 Mar 2022, 11:23
by Ath
Please show your rules, so we can understand what you are doing there.

Re: timer problem

Posted: 03 Mar 2022, 14:52
by Cdrx34
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]

Re: timer problem

Posted: 03 Mar 2022, 16:34
by iron

Code: Select all

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

Re: timer problem

Posted: 03 Mar 2022, 17:28
by Cdrx34
No endif is too much, I had made modifications to try to solve my problem and I forgot to remove it

Re: timer problem

Posted: 03 Mar 2022, 21:23
by Ath
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.

Re: timer problem

Posted: 03 Mar 2022, 23:08
by Cdrx34
Thanks for your feedback.
I will try this way.
The variable [Notifuite#Alarme] is reset by an Android application.

Re: timer problem

Posted: 04 Mar 2022, 21:30
by Cdrx34
Hello,
Still same problem with this code, the time is not in seconds.