Page 2 of 2

Re: error if and ife

Posted: 22 Nov 2022, 13:13
by chromo23
Why do you need the 5 sec interval timer?
Because @bledat wants to change the variables in the rules editor as far as i understood... so that this change happens almost immediately there is a loop
and since

Code: Select all

On Clock#Time=All,**:** Do 
is also a kind of loop once a minute i simply put the code into the rulestimer2 because it doesn’t matter if the state change happens in one minute or in 5 seconds after the variable is set.

There is only one relay that hat a 15min toggle and that gets an extra rules timer....

... but somehow i remember that there is a new functionality...
could this:

Code: Select all

longpulse,2,1,900,900,-1
replace that:

Code: Select all

On Rules#Timer=1 Do
  If [Var#1]=2	
    GPIOToggle,14
  Elseif [Var#1]=0  
    GPIO,14,1
  Endif

Re: error if and ife

Posted: 22 Nov 2022, 13:50
by TD-er
Yep, it can....
But I found out that on ESP32 this new infinite longpulse command may have some strange side effects when running for a long time.
At least when running with sub-second intervals.

I have a LED blinking on an ESP32 node on my desk at 300/200 msec on/off times.
Every now and then it seems the LED doesn't turn off. I guess it happens when the ESP is a bit too busy.

For intervals of several seconds, I doubt this will cause any issues, but for sub-second intervals it may sometimes seem to skip.

N.B. you need to set the proper GPIO pin of course.
And it will not evaluate the value of the var#

Re: error if and ife

Posted: 22 Nov 2022, 15:38
by bledad
" can you test it and report? " , as soon as I have a moment, I test

I'm thinking of upgrading , with mqtt and html for each relay
exemple :
bouton.jpg
bouton.jpg (11.52 KiB) Viewed 686 times

Re: error if and ife

Posted: 23 Nov 2022, 14:17
by bledad
" can you test it and report? "
yes it work , a big thank you