error if and ife

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
User avatar
chromo23
Normal user
Posts: 821
Joined: 10 Sep 2020, 16:02
Location: germany

Re: error if and ife

#51 Post by chromo23 » 22 Nov 2022, 13:13

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

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

Re: error if and ife

#52 Post by TD-er » 22 Nov 2022, 13:50

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#

bledad
Normal user
Posts: 82
Joined: 23 Nov 2020, 10:57
Location: France

Re: error if and ife

#53 Post by bledad » 22 Nov 2022, 15:38

" 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 542 times

bledad
Normal user
Posts: 82
Joined: 23 Nov 2020, 10:57
Location: France

Re: error if and ife

#54 Post by bledad » 23 Nov 2022, 14:17

" can you test it and report? "
yes it work , a big thank you

Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 14 guests