error if and ife

Moderators: grovkillen, Stuntteam, TD-er

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

error if and ife

#1 Post by bledad » 19 Nov 2022, 16:45

hello, on esp8266 i have do a error , i have put ife instead if
now , i've no access
is there any way to get the access back?
thank you

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

Re: error if and ife

#2 Post by Ath » 19 Nov 2022, 16:49

Where did you put that 'ife'?
If that's in rules, it should be ignored, as that's an unknown command, it would be strange if that could block access to the ESP.

Do you have access to the serial log?
/Ton (PayPal.me)

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

Re: error if and ife

#3 Post by bledad » 19 Nov 2022, 16:51

yes in the rules , i've no access at serial log

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

Re: error if and ife

#4 Post by Ath » 19 Nov 2022, 17:16

What is happening if the lines after the wrong ife statement are executed?

In what eventhandler is that code?, for a specific sensor, every minute using the on Clock#time=all,**:** do, or a system event like on system#boot do ?
/Ton (PayPal.me)

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

Re: error if and ife

#5 Post by TD-er » 19 Nov 2022, 17:25

When the ESP may enter some kind of "boot loop" and thus never really completes a boot, it will start disabling tasks one by one.
Then controllers and as last resort disable all tasks and all controllers and the rules.

So if it has entered such a boot loop, it should after some time become available again with some parts disabled.

N.B. this will only be disabled in memory, so unless something is being saved, the process will be repeated the next time the ESP will reboot.

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

Re: error if and ife

#6 Post by bledad » 19 Nov 2022, 17:37

in Clock#time=all,**:** do
it reboot , reboot .....

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

Re: error if and ife

#7 Post by TD-er » 19 Nov 2022, 18:41

Ah that's indeed something that won't be detected by that algorithm.

Do you know what it tries to do to make it crash?
Tweaking the boot loop detection is for sure something I need to do, but maybe it is better to actually fix the crash reason ;)

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

Re: error if and ife

#8 Post by bledad » 20 Nov 2022, 11:42

ok , the algorithm is good , it took a long time , I was able to access it and correct the error
thank you very much

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

Re: error if and ife

#9 Post by Ath » 20 Nov 2022, 13:27

Ah, great, the safety measures work as intended.

Can you share the Rules code that caused this boot loop? (if you don't want to publish here, a PM is also fine, for us to learn, and possibly prevent future issues)
/Ton (PayPal.me)

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

Re: error if and ife

#10 Post by bledad » 20 Nov 2022, 13:39

no problem :
origine :

Code: Select all

On System#Boot Do
	LoopTimerSet,1,900
Endon

On Rules#Timer=1 Do
	If [Var#1]=1
		GPIOToggle,14
    	Else
    		GPIO,14,1
Endon

On Clock#Time=All,**:** Do
  	If  %syssec_d% > 36000 and %syssec_d% < 68400 //de 10h a 19h
        	Let,1,0 // 1 = pompe bassin en marche 
   	Else
        	Let,1,0       
  	Endif
modif :

Code: Select all

On System#Boot Do
	LoopTimerSet,1,900
Endon

On Rules#Timer=1 Do
	If [Var#1]=1
		GPIOToggle,14
    	Else
    		GPIO,14,1
Endon

On Clock#Time=All,**:** Do
  	Ife  %syssec_d% > 36000 and %syssec_d% < 68400 //de 10h a 19h
        	Let,1,0 // 1 = pompe bassin en marche 
   	Else
        	Let,1,0       
  	Endif

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

Re: error if and ife

#11 Post by TD-er » 20 Nov 2022, 21:03

There are other issues too...

Code: Select all

On Rules#Timer=1 Do
	If [Var#1]=1
		GPIOToggle,14
    	Else
    		GPIO,14,1
Endon
Missing an "endif" before the "endon"

Code: Select all

On Clock#Time=All,**:** Do
  	If  %syssec_d% > 36000 and %syssec_d% < 68400 //de 10h a 19h
        	Let,1,0 // 1 = pompe bassin en marche 
   	Else
        	Let,1,0       
  	Endif
Missing an "endon"
Also this block doesn't "do" anything as both set the variable to the same value.

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

Re: error if and ife

#12 Post by bledad » 21 Nov 2022, 09:43

yes , hi have missing endif , but it works !!

Code: Select all

On Rules#Timer=1 Do
	If [Var#1]=1
		GPIOToggle,14
    	Else
    		GPIO,14,1
    	endif	
Endon
for this :

Code: Select all

On Clock#Time=All,**:** Do
  	If  %syssec_d% > 36000 and %syssec_d% < 68400 //de 10h a 19h
        	Let,1,0 // 1 = pump start  0 =pump stop
   	Else
        	Let,1,0       
  	Endif



  	If  %syssec_d% > 3600 and %syssec_d% < 28800//de 1h a 8h chaudiere
                gpio,4,0
   	Else
        	gpio,4,1      
  	Endif


//relais 2 pin 12 fontaine

  // if  %syssec_d% > 39600 and %syssec_d% < 72000 //de 11h a 20h
  //   gpio,12,0
 //  else
 //    gpio,12,1
 //  endif

//relais 1 pin 13 sonnette
   if  %syssec_d% > 28800 and %syssec_d% < 72000 //de 7h a 20h
     gpio,13,0
     //Publish,actions_bouton,sonnette_status#1
   else
     gpio,13,1
     //Publish,actions_bouton,sonnette_status#2
   endif

   if [rel2#Value1]=3
     gpio,16,0
   else
     gpio,16,1
   endif 
    
endon         
  
I had not put all , i set the variable to the same value , because i stop with 0 or start with 1
this is what I found the best to not put the relay "on" when I don't need it
that's why I had put " ife " instead of "if"
is there any other solution not to run a loop ?
without putting "//" on each line?

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

Re: error if and ife

#13 Post by chromo23 » 21 Nov 2022, 09:58

bledad wrote: 21 Nov 2022, 09:43 is there any other solution not to run a loop ?
without putting "//" on each line?
There is. You could add a variable check to all your if statements that need to be "switched" and declare this variable somewhere.

Code: Select all

On System#Boot Do
	Let,99,1 //change this to 0 to deactivate your statement
Endon

On Clock#Time=All,**:** Do
  	If  [var#99]=1 and %syssec_d% > 36000 and %syssec_d% < 68400 //de 10h a 19h
        	Let,1,0 // 1 = pump start  0 =pump stop
   	Else
        	Let,1,0       
  	Endif
 Endon
  	
Edit: advantage of that is, that you can control this with commands via http or other protocols
Last edited by chromo23 on 21 Nov 2022, 10:06, edited 2 times in total.

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

Re: error if and ife

#14 Post by bledad » 21 Nov 2022, 10:03

yes good idea

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

Re: error if and ife

#15 Post by Ath » 21 Nov 2022, 10:09

Disadvantage of that it will always execute the "else" part of the code, that may not be what you want...
Alternative would be to add an extra "if" around the code that is to be excluded.
/Ton (PayPal.me)

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

Re: error if and ife

#16 Post by bledad » 21 Nov 2022, 10:13

?? ,example , because i do google translate , my english is very bad

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

Re: error if and ife

#17 Post by chromo23 » 21 Nov 2022, 10:18

Ath wrote: 21 Nov 2022, 10:09 Disadvantage of that it will always execute the "else" part
True, but i thought thats what he wanted....

bledad wrote: 21 Nov 2022, 10:13example

Code: Select all

On Clock#Time=All,**:** Do
   If  [var#99]=1
  	If  %syssec_d% > 36000 and %syssec_d% < 68400 //de 10h a 19h
        	Let,1,0 // 1 = pump start  0 =pump stop
   	Else
        	Let,1,0       
  	Endif
   Endif
 Endon

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

Re: error if and ife

#18 Post by bledad » 21 Nov 2022, 14:32

hi , thank you , i've redone my rules for 8 relay
where let variable if 0 = stop , 1 = forced work , automatique work

it's good for you ??

Code: Select all

// relais
//1=13,2=12,3=14,4=16,5=4,6=5,7=3,8=1
Let,1,0
Let,2,0
Let,11,0 // relais 1 > 0 = arret , 1 = marche force , 2 = marche auto
Let,12,0 // relais 2 > 0 = arret , 1 = marche force , 2 = marche auto
Let,13,0 // relais 3 > 0 = arret , 1 = marche force , 2 = marche auto
Let,14,0 // relais 4 > 0 = arret , 1 = marche force , 2 = marche auto
Let,15,0 // relais 5 > 0 = arret , 1 = marche force , 2 = marche auto
Let,16,0 // relais 6 > 0 = arret , 1 = marche force , 2 = marche auto
Let,17,0 // relais 7 > 0 = arret , 1 = marche force , 2 = marche auto
Let,18,0 // relais 8 > 0 = arret , 1 = marche force , 2 = marche auto




On System#Boot Do
	LoopTimerSet,1,900 //timer 15 minutes
Endon

On Rules#Timer=1 Do
	If [Var#1]=1 // actif suivant heures
		GPIOToggle,14 //marche arret 15 minutes
    Else
    	GPIO,14,1
	endif
Endon

On Clock#Time=All,**:** Do // boucle suivant horaires

	if [Var#11]=2 // relais 1  sonnette
	    if  %syssec_d% > 28800 and %syssec_d% < 72000 //de 7h a 20h
			gpio,13,0
     	else
			gpio,13,1
		endif
	endif	

	if [Var#12]=2 // relais 2 fontaine auto
		if  %syssec_d% > 39600 and %syssec_d% < 72000 //de 11h a 20h
			gpio,12,0
		else
			gpio,12,1
		endif
	endif	


    if [Var#13]=2 // relais 3 en auto pompe bassin
  	    If  %syssec_d% > 36000 and %syssec_d% < 68400 //de 10h a 19h
        	Let,1,1  
   	    Else
        	Let,1,0       
  	    Endif
	endif
	
	if [Var#15]=2 //relais 5 en auto chaudiere
	    If  %syssec_d% > 3600 and %syssec_d% < 28800//de 1h a 8h chaudiere
            gpio,4,0
   	    Else
        	gpio,4,1 
        endif			
  	Endif
	
Endon

if [Var#11]=0 //relais 1 stop
   gpio,13,1
endif   
if [Var#11]=1 //relais 1 marche force
   gpio,13,0
endif  

if [Var#12]=0 //relais 2 stop
   gpio,12,1
endif   
if [Var#12]=1 //relais 2 marche force
   gpio,12,0
endif
  
if [Var#13]=0 //relais 3 stop
   gpio,14,1
endif   
if [Var#13]=1 //relais 3 marche force
   gpio,14,0
endif  

if [Var#14]=0 //relais 4 stop
   gpio,16,1
endif   
if [Var#14]=1 //relais 4 marche force
   gpio,16,0
endif  

if [Var#15]=0 //relais 5 stop
   gpio,4,1
endif   
if [Var#15]=1 //relais 5 marche force
   gpio,4,0
endif  

if [Var#16]=0 //relais 6 stop
   gpio,5,1
endif   
if [Var#16]=1 //relais 6 marche force
   gpio,5,0
endif  

if [Var#17]=0 //relais 7 stop
   gpio,3,1
endif   
if [Var#17]=1 //relais 7 marche force
   gpio,3,0
endif  

if [Var#18]=0 //relais 8 stop
   gpio,1,1
endif   
if [Var#18]=1 //relais 8 marche force
   gpio,1,0
endif  

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

Re: error if and ife

#19 Post by Ath » 21 Nov 2022, 14:45

You have a lot of these:

Code: Select all

if [Var#11]=0 //relais 1 stop
   gpio,13,1
endif   
if [Var#11]=1 //relais 1 marche force
   gpio,13,0
endif 
I think that can be shorter, and thus faster to process like this:

Code: Select all

if [Var#11]!=2 // not auto
   gpio,13,![Var#11] // Inverted state
endif 
Also, this part might not always work as intended:

Code: Select all

On Rules#Timer=1 Do
  If [Var#1]=1 // actif suivant heures
    GPIOToggle,14 //marche arret 15 minutes
  Else
    GPIO,14,1
  endif
Endon
The GPIOToggle will do exactly that, toggle the state from 1 to 0 or from 0 to 1.
What if it is set to 0 elsewhere, then it would turn off when you wouldn't expect it to, so might be better to change that to gpio,14,0
/Ton (PayPal.me)

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

Re: error if and ife

#20 Post by chromo23 » 21 Nov 2022, 14:50

Not quite.. the last part is outside a ruleblock (on-do-endon)
that will lead to issues..

try this:

Code: Select all

On Clock#Time=All,**:** Do // boucle suivant horaires

	if [Var#11]=2 and  %syssec_d% > 28800 and %syssec_d% < 72000 	//auto mode
	  gpio,13,0
     	elseif [Var#11]=1  	//always on
	 gpio,13,0
        else 				//always off if var#11 anything is else than 2 or 1 or time is outside you defined area 
         gpio,13,1
	endif	

	
Endon
Edit: maybe ignore this code. It works only once a minute... so when changing var#11 the change will physically appear worst case 1min after.
Edit: Now i understand your code.. you declare all the values in rules at the beginning.. (and also there you need a ruleblock!) so maybe it doesn’t matter iff the change happens 1min later?

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

Re: error if and ife

#21 Post by bledad » 21 Nov 2022, 15:06

ok , i understand
why 1min later?

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

Re: error if and ife

#22 Post by chromo23 » 21 Nov 2022, 15:11

This could be it:

Code: Select all

On System#Boot Do
   LoopTimerSet,1,900 //timer 15 minutes
  //declare the variables ar boot!!!
  // relais
  //1=13,2=12,3=14,4=16,5=4,6=5,7=3,8=1
  Let,1,0
  Let,2,0
  Let,11,0 // relais 1 > 0 = arret , 1 = marche force , 2 = marche auto
  Let,12,0 // relais 2 > 0 = arret , 1 = marche force , 2 = marche auto
  Let,13,0 // relais 3 > 0 = arret , 1 = marche force , 2 = marche auto
  Let,14,0 // relais 4 > 0 = arret , 1 = marche force , 2 = marche auto
  Let,15,0 // relais 5 > 0 = arret , 1 = marche force , 2 = marche auto
  Let,16,0 // relais 6 > 0 = arret , 1 = marche force , 2 = marche auto
  Let,17,0 // relais 7 > 0 = arret , 1 = marche force , 2 = marche auto
  Let,18,0 // relais 8 > 0 = arret , 1 = marche force , 2 = marche auto
Endon

On Rules#Timer=1 Do
	If [Var#1]=1 // actif suivant heures
		GPIOToggle,14 //marche arret 15 minutes
  	Else
    		GPIO,14,1
	Endif
Endon

On Clock#Time=All,**:** Do // boucle suivant horaires

	If [Var#11]=2 and  %syssec_d% > 28800 and %syssec_d% < 72000 	//auto mode
	  GPIO,13,0
  	Elseif [Var#11]=1  	//always on
	  GPIO,13,0
  	Else 				//always off if var#11 anything is else than 2 or 1 or time is outside you defined area 
   	  GPIO,13,1
	Endif	

  	If [Var#12]=2 and  %syssec_d% > 39600 and %syssec_d% < 72000 //de 11h a 20h
	  GPIO,12,0
  	Elseif [Var#12]=1  	
	  GPIO,12,0
  	Else 				
   	  GPIO,12,1
	Endif	

	If [Var#13]=2 and %syssec_d% > 36000 and %syssec_d% < 68400 //de 10h a 19h
	  GPIO,1,0
  	Elseif [Var#13]=1  	
	  GPIO,1,0
  	Else 				
          GPIO,1,1
	Endif	

   	If [Var#15]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//de 1h a 8h chaudiere
	  GPIO,4,0
  	Elseif [Var#15]=1  	
	  GPIO,4,0
  	Else 				
   	  GPIO,4,1
	Endif	
Endon

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

Re: error if and ife

#23 Post by bledad » 21 Nov 2022, 15:16

yes ok , but if , by example , i want start relay 6 ( gpio 5 ) with Let variable without time ?,

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

Re: error if and ife

#24 Post by chromo23 » 21 Nov 2022, 15:20

bledad wrote: 21 Nov 2022, 15:16 yes ok , but if , by example , i want start relay 6 ( gpio 5 ) with Let variable without time ?,

Code: Select all

On System#Boot Do
  Let,16,1 // relais 6 > 0 = arret , 1 = marche force , 2 = marche auto
Endon

On Clock#Time=All,**:** Do // boucle suivant horaires
	If [Var#16]=2 and  %syssec_d% > 28800 and %syssec_d% < 72000 	//auto mode
	  GPIO,5,0
       	Elseif [Var#16]=1  	//always on
	  GPIO,5,0
       	Else 				//always off if var#11 anything is else than 2 or 1 or time is outside you defined area 
         GPIO,5,1
       	Endif
Endon

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

Re: error if and ife

#25 Post by chromo23 » 21 Nov 2022, 15:24

bledad wrote: 21 Nov 2022, 15:06 ok , i understand
why 1min later?
because this:

Code: Select all

On Clock#Time=All,**:** Do // boucle suivant horaires
checks only every minute which state your variable has...

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

Re: error if and ife

#26 Post by chromo23 » 21 Nov 2022, 15:27

Maybe it is also good to explain as good as possible what you want to do. This makes helping you a lot easier. (you can use pseudo code if you want)

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

Re: error if and ife

#27 Post by bledad » 21 Nov 2022, 15:37

ok for 1 minute
but you lost me with toggle
i want start and stop gpio 14 every 15 minutes of 10h am to 7h pm
the code work :

Code: Select all

On System#Boot Do
	LoopTimerSet,1,900
Endon

On Rules#Timer=1 Do
	If [Var#1]=1
		GPIOToggle,14
    	Else
    		GPIO,14,1
Endon

On Clock#Time=All,**:** Do
  	If  %syssec_d% > 36000 and %syssec_d% < 68400 //de 10h a 19h
        	Let,1,0 // 1 = pompe bassin en marche 
   	Else
        	Let,1,0       
  	Endif[
endon/code]

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

Re: error if and ife

#28 Post by chromo23 » 21 Nov 2022, 15:46

Do not forget to close a rulesblock or if-statements!!!!!!

Code: Select all

On Rules#Timer=1 Do
	If [Var#1]=1
		GPIOToggle,14
    	Else
    		GPIO,14,1
       ENDIF  //important!!!!!!
Endon

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

Re: error if and ife

#29 Post by bledad » 21 Nov 2022, 15:49

ok ,sorry , I had modified in my code, but not in the paste

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

Re: error if and ife

#30 Post by chromo23 » 21 Nov 2022, 15:50

And this can not work:

Code: Select all

On Rules#Timer=1 Do
	If [Var#1]=1
		GPIOToggle,14
    	Else
    		GPIO,14,1
    	Endif
Endon

On Clock#Time=All,**:** Do
  	If  %syssec_d% > 36000 and %syssec_d% < 68400 //de 10h a 19h
        	Let,1,0 // 1 = pompe bassin en marche 
   	Else
        	Let,1,0       
  	Endif
Endon
because after one minute var#1 will be 0 and this will never happen:

Code: Select all

If [Var#1]=1
	GPIOToggle,14

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

Re: error if and ife

#31 Post by bledad » 21 Nov 2022, 15:56

sorry , another bad paste

Code: Select all

On Rules#Timer=1 Do
	If [Var#1]=1
		GPIOToggle,14
    	Else
    		GPIO,14,1
    	Endif
Endon

On Clock#Time=All,**:** Do
  	If  %syssec_d% > 36000 and %syssec_d% < 68400 //de 10h a 19h
        	Let,1,1 // 1 = pompe bassin en marche 
   	Else
        	Let,1,0       
  	Endif
Endon

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

Re: error if and ife

#32 Post by bledad » 21 Nov 2022, 16:01

with the toggle code , this ( with new code ), it's good ?

Code: Select all

 if [Var#13]=2 and  %syssec_d% > 36000 and %syssec_d% < 68400 //de 10h a 19h
        	Let,1,1 
        elseif [Var#12]=1
			gpio,14,0
   	    Else
        	Let,1,0       
  	    Endif
	endif

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

Re: error if and ife

#33 Post by TD-er » 21 Nov 2022, 16:05

You have one endif too many in your piece of code:

Code: Select all

if [Var#13]=2 and  %syssec_d% > 36000 and %syssec_d% < 68400 //de 10h a 19h
  Let,1,1 
elseif [Var#12]=1
  gpio,14,0
Else
  Let,1,0       
Endif
N.B. have not looked at what you're trying to do here, only looked at the syntax and matching if/endif

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

Re: error if and ife

#34 Post by chromo23 » 21 Nov 2022, 16:40

bledad wrote: 21 Nov 2022, 15:56 sorry , another bad paste

Code: Select all

On Rules#Timer=1 Do
	If [Var#1]=1
		GPIOToggle,14
    	Else
    		GPIO,14,1
    	Endif
Endon

On Clock#Time=All,**:** Do
  	If  %syssec_d% > 36000 and %syssec_d% < 68400 //de 10h a 19h
        	Let,1,1 // 1 = pompe bassin en marche 
   	Else
        	Let,1,0       
  	Endif
Endon
This will work....

bledad wrote: 21 Nov 2022, 16:01 with the toggle code , this ( with new code ), it's good ?
yes, with some minor changes

Code: Select all

If [Var#13]=2 and  %syssec_d% > 36000 and %syssec_d% < 68400 //de 10h a 19h
  Let,1,1 
Elseif [Var#13]=1 //< i guess this should be var#13 instead of var#12 
  gpio,14,0
Else
  Let,1,0       
Endif

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

Re: error if and ife

#35 Post by bledad » 21 Nov 2022, 16:54

yes , than you
you can verifier the final code ?

Code: Select all

// relais
//1=13,2=12,3=14,4=16,5=4,6=5,7=3,8=1
Let,1,0
Let,2,0
Let,11,0 // relais 1 > 0 = arret , 1 = marche force , 2 = marche auto sonnette
Let,12,0 // relais 2 > 0 = arret , 1 = marche force , 2 = marche auto fontaine
Let,13,0 // relais 3 > 0 = arret , 1 = marche force , 2 = marche auto bassin
Let,14,0 // relais 4 > 0 = arret , 1 = marche force , 2 = marche auto
Let,15,0 // relais 5 > 0 = arret , 1 = marche force , 2 = marche auto chaudiere
Let,16,0 // relais 6 > 0 = arret , 1 = marche force , 2 = marche auto
Let,17,0 // relais 7 > 0 = arret , 1 = marche force , 2 = marche auto
Let,18,0 // relais 8 > 0 = arret , 1 = marche force , 2 = marche auto




On System#Boot Do
	LoopTimerSet,1,900 //timer 15 minutes
Endon

On Rules#Timer=1 Do
	If [Var#1]=1 // actif suivant heures
		GPIOToggle,14 //marche arret 15 minutes
    Else
    	GPIO,14,1
	endif
Endon

On Clock#Time=All,**:** Do // boucle suivant horaires
	// relais 1 sonnette
	if [Var#11]=2 and  %syssec_d% > 28800 and %syssec_d% < 72000 	//auto mode
		gpio,13,0
   	elseif [Var#11]=1  	//always on
		gpio,13,0
    else 				//always off if var#11 anything else than 2 or 1
        gpio,13,1
	endif	
	
	//relais 2 fontaine
	if [Var#12]=2 and %syssec_d% > 39600 and %syssec_d% < 72000 //de 11h a 20h
		gpio,12,0
	elseif [Var#12]=1 
		gpio,12,0
	else
		gpio,12,1
	endif
		

	//relais 3 pompe bassin
    if [Var#13]=2 and  %syssec_d% > 36000 and %syssec_d% < 68400 //de 10h a 19h
       	Let,1,1 
    elseif [Var#13]=1
		gpio,14,0
   	Else
       	gpio,14,1      
  	Endif
	
	
	//relais 4
	if [Var#14]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//
		gpio,16,0
	elseif [Var#14]=1
		gpio,16,0
   	Else
       	gpio,16,1 
    endif			
  	
	
	//relais 5 chaudiere ete hiver
	if [Var#15]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//de 1h a 8h chaudiere
        gpio,4,0
	elseif [Var#15]=1
		gpio,4,0
   	Else
       	gpio,4,1 
    endif			
  	
	
	//relais 6
	if [Var#16]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//
        gpio,5,0
	elseif [Var#16]=1
		gpio,5,0
    Else
       	gpio,5,1 
	endif			

	
	//relais 7
	if [Var#17]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//
        gpio,3,0
	elseif [Var#17]=1
		gpio,3,0
    Else
       	gpio,3,1 
    endif			

	
	//relais 8
	if [Var#18]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//
        gpio,1,0
	elseif [Var#18]=1
		gpio,1,0
	Else
       	gpio,1,1 
    endif			

Endon

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

Re: error if and ife

#36 Post by TD-er » 21 Nov 2022, 16:57

Those let calls at the begin will not be used or executed.

Rules act on events, so have to be in blocks like these:

Code: Select all

on ... do
 ....
endon

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

Re: error if and ife

#37 Post by chromo23 » 21 Nov 2022, 17:13

Maybe this is it?

Code: Select all

On System#Boot Do
  // relais
  //1=13,2=12,3=14,4=16,5=4,6=5,7=3,8=1
  Let,1,0
  Let,2,0
  Let,11,0 // relais 1 > 0 = arret , 1 = marche force , 2 = marche auto sonnette
  Let,12,0 // relais 2 > 0 = arret , 1 = marche force , 2 = marche auto fontaine
  Let,13,0 // relais 3 > 0 = arret , 1 = marche force , 2 = marche auto bassin
  Let,14,0 // relais 4 > 0 = arret , 1 = marche force , 2 = marche auto
  Let,15,0 // relais 5 > 0 = arret , 1 = marche force , 2 = marche auto chaudiere
  Let,16,0 // relais 6 > 0 = arret , 1 = marche force , 2 = marche auto
  Let,17,0 // relais 7 > 0 = arret , 1 = marche force , 2 = marche auto
  Let,18,0 // relais 8 > 0 = arret , 1 = marche force , 2 = marche auto
  LoopTimerSet,1,900 //timer 15 minutes
Endon

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

On Clock#Time=All,**:** Do // boucle suivant horaires
	// relais 1 sonnette
  if [Var#11]=2 and  %syssec_d% > 28800 and %syssec_d% < 72000 	//auto mode
    gpio,13,0
  elseif [Var#11]=1  	//always on
    gpio,13,0
  else 				//always off if var#11 anything else than 2 or 1
    gpio,13,1
  endif	
	//relais 2 fontaine
  if [Var#12]=2 and %syssec_d% > 39600 and %syssec_d% < 72000 //de 11h a 20h
    gpio,12,0
  elseif [Var#12]=1 
    gpio,12,0
  else
    gpio,12,1
  endif
	//relais 3 pompe bassin
  If [Var#13]=2 and  %syssec_d% > 36000 and %syssec_d% < 68400 //de 10h a 19h
    Let,1,2
  Elseif [Var#13]=1 //< i guess this should be var#13 instead of var#12 
    gpio,14,0
    Let,1,1
  Else
    Let,1,0       
  Endif	
	//relais 4
  if [Var#14]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//
    gpio,16,0
  elseif [Var#14]=1
    gpio,16,0
  Else
    gpio,16,1 
  endif			
	//relais 5 chaudiere ete hiver
  if [Var#15]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//de 1h a 8h chaudiere
    gpio,4,0
  elseif [Var#15]=1
    gpio,4,0
  Else
   gpio,4,1 
  endif			
	//relais 6
  if [Var#16]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//
    gpio,5,0
  elseif [Var#16]=1
    gpio,5,0
  Else
    gpio,5,1 
  endif			
	//relais 7
  if [Var#17]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//
    gpio,3,0
  elseif [Var#17]=1
    gpio,3,0
  Else
    gpio,3,1 
  endif			
	//relais 8
  if [Var#18]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//
    gpio,1,0
  elseif [Var#18]=1
    gpio,1,0
  Else
    gpio,1,1 
  endif			
Endon

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

Re: error if and ife

#38 Post by bledad » 21 Nov 2022, 17:18

I had thought about it , but i will have to reboot at each variable change ?

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

Re: error if and ife

#39 Post by chromo23 » 21 Nov 2022, 17:22

bledad wrote: 21 Nov 2022, 17:18 I had thought about it , but i will have to reboot at each variable change ?
Thats why it is so helpful, to give the whole picture of what you want to do...
And if you are not good with code you can always tell us with your own words what should happen/ what you want to achieve .

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

Re: error if and ife

#40 Post by TD-er » 21 Nov 2022, 17:23

I did format the code a bit more so it is readable with consistent indents:

Code: Select all

On System#Boot Do
  // relais
  //1=13,2=12,3=14,4=16,5=4,6=5,7=3,8=1
  Let,1,0
  Let,2,0
  Let,11,0 // relais 1 > 0 = arret , 1 = marche force , 2 = marche auto sonnette
  Let,12,0 // relais 2 > 0 = arret , 1 = marche force , 2 = marche auto fontaine
  Let,13,0 // relais 3 > 0 = arret , 1 = marche force , 2 = marche auto bassin
  Let,14,0 // relais 4 > 0 = arret , 1 = marche force , 2 = marche auto
  Let,15,0 // relais 5 > 0 = arret , 1 = marche force , 2 = marche auto chaudiere
  Let,16,0 // relais 6 > 0 = arret , 1 = marche force , 2 = marche auto
  Let,17,0 // relais 7 > 0 = arret , 1 = marche force , 2 = marche auto
  Let,18,0 // relais 8 > 0 = arret , 1 = marche force , 2 = marche auto
  LoopTimerSet,1,900 //timer 15 minutes
Endon

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

On Clock#Time=All,**:** Do // boucle suivant horaires
  // relais 1 sonnette
  if [Var#11]=2 and  %syssec_d% > 28800 and %syssec_d% < 72000   //auto mode
    gpio,13,0
  elseif [Var#11]=1    //always on
    gpio,13,0
  else         //always off if var#11 anything else than 2 or 1
    gpio,13,1
  endif  
  
  //relais 2 fontaine
  if [Var#12]=2 and %syssec_d% > 39600 and %syssec_d% < 72000 //de 11h a 20h
    gpio,12,0
  elseif [Var#12]=1 
    gpio,12,0
  else
    gpio,12,1
  endif
    

  //relais 3 pompe bassin
  If [Var#13]=2 and  %syssec_d% > 36000 and %syssec_d% < 68400 //de 10h a 19h
    Let,1,2
  Elseif [Var#13]=1
    gpio,14,0
    Let,1,1
  Else
    Let,1,0       
  Endif
  
  
  //relais 4
  if [Var#14]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//
    gpio,16,0
  elseif [Var#14]=1
    gpio,16,0
  Else
    gpio,16,1 
  endif      
    
  
  //relais 5 chaudiere ete hiver
  if [Var#15]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//de 1h a 8h chaudiere
    gpio,4,0
  elseif [Var#15]=1
    gpio,4,0
  Else
    gpio,4,1 
  endif      
    
  
  //relais 6
  if [Var#16]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//
    gpio,5,0
  elseif [Var#16]=1
    gpio,5,0
  Else
    gpio,5,1 
  endif      

  
  //relais 7
  if [Var#17]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//
    gpio,3,0
  elseif [Var#17]=1
    gpio,3,0
  Else
    gpio,3,1 
  endif      

  
  //relais 8
  if [Var#18]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//
    gpio,1,0
  elseif [Var#18]=1
    gpio,1,0
  Else
    gpio,1,1 
  endif      

Endon
But it is a bit unclear to me what you want to do here.
How are the variables being set after the unit boots? Some other events?

You can set variables via commands or other events. No need to reboot for each test.

However, I would like to know what you're trying to achieve here.

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

Re: error if and ife

#41 Post by Ath » 21 Nov 2022, 17:24

bledad wrote: 21 Nov 2022, 17:18 I had thought about it , but i will have to reboot at each variable change ?
You can run the command

Code: Select all

event,system#boot
from the Tools page, that will only run the rule, no other stuff, unless you added that in the rules
/Ton (PayPal.me)

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

Re: error if and ife

#42 Post by chromo23 » 21 Nov 2022, 17:25

You could change the code to this:

Code: Select all

On System#Boot Do
  Let,1,0
  Let,2,0
  LoopTimerSet,1,900 //timer 15 minutes
  LoopTimerSet,2,5 //timer 5 seconds
Endon

On Rules#Timer=2 Do
  // relais
  //1=13,2=12,3=14,4=16,5=4,6=5,7=3,8=1
  Let,11,0 // relais 1 > 0 = arret , 1 = marche force , 2 = marche auto sonnette
  Let,12,0 // relais 2 > 0 = arret , 1 = marche force , 2 = marche auto fontaine
  Let,13,0 // relais 3 > 0 = arret , 1 = marche force , 2 = marche auto bassin
  Let,14,0 // relais 4 > 0 = arret , 1 = marche force , 2 = marche auto
  Let,15,0 // relais 5 > 0 = arret , 1 = marche force , 2 = marche auto chaudiere
  Let,16,0 // relais 6 > 0 = arret , 1 = marche force , 2 = marche auto
  Let,17,0 // relais 7 > 0 = arret , 1 = marche force , 2 = marche auto
  Let,18,0 // relais 8 > 0 = arret , 1 = marche force , 2 = marche auto
Endon
Last edited by chromo23 on 21 Nov 2022, 17:35, edited 1 time in total.

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

Re: error if and ife

#43 Post by chromo23 » 21 Nov 2022, 17:28

TD-er wrote: 21 Nov 2022, 17:23 I did format the code a bit more so it is readable with consistent indents:
i already did... ;)
viewtopic.php?p=61170#p61170

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

Re: error if and ife

#44 Post by bledad » 22 Nov 2022, 10:44

it's my working 8 relay esp8266

be able to modify the action of each relay , ( on , off , on auto with schedule )
20221121_172948.jpg
20221121_172948.jpg (535.2 KiB) Viewed 4014 times

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

Re: error if and ife

#45 Post by TD-er » 22 Nov 2022, 10:56

So just to be clear, you only want to switch each relais on or off given some time interval?

For example:
- relais 1
- GPIO 13, inverted logic: "0" is "on"
- When: %syssec_d% > 28800 and %syssec_d% < 72000

There also seems to be some variable # 11, which does seem to indicate the following:
- [Var#11]=0 //always off
- [Var#11]=1 //always on
- [Var#11]=2 //Timer mode

That's what I am reading in this rules code:

Code: Select all

  // relais 1 sonnette
  if [Var#11]=2 and  %syssec_d% > 28800 and %syssec_d% < 72000   //auto mode
    gpio,13,0
  elseif [Var#11]=1    //always on
    gpio,13,0
  else         //always off if var#11 anything else than 2 or 1
    gpio,13,1
  endif  
Is that what you really intend to do?

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

Re: error if and ife

#46 Post by bledad » 22 Nov 2022, 11:43

For example:
- relais 1
- GPIO 13, inverted logic: "0" is "on"
- When: %syssec_d% > 28800 and %syssec_d% < 72000
- forced on without %syssec_d% > 28800 and %syssec_d% < 72000
- forced off without %syssec_d% > 28800 and %syssec_d% < 72000

and for
- relais 3
- same thing
- add stop and start every 15 min. when %syssec_d% > 36000 and %syssec_d% < 68400

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

Re: error if and ife

#47 Post by chromo23 » 22 Nov 2022, 11:45

and to clarify

Code: Select all

  else         //always off if var#11 anything else than 2 or 1
should for better understanding have this annotation

Code: Select all

  else         //always off if var#11 anything else than 2 or 1 or %syssec_d% is outside the defined area 

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

Re: error if and ife

#48 Post by chromo23 » 22 Nov 2022, 11:46

For example:
- relais 1
- GPIO 13, inverted logic: "0" is "on"
- When: %syssec_d% > 28800 and %syssec_d% < 72000
- forced on without %syssec_d% > 28800 and %syssec_d% < 72000
- forced off without %syssec_d% > 28800 and %syssec_d% < 72000

and for
- relais 3
- same thing
- add stop and start every 15 min. when %syssec_d% > 36000 and %syssec_d% < 68400
then the code i send you should work.
can you test it and report?

Edit: here the whole thing with the latest change:

Code: Select all

On System#Boot Do
  Let,1,0
  Let,2,0
  LoopTimerSet,1,900 //timer 15 minutes
  LoopTimerSet,2,5 //timer 5 seconds
Endon

On Rules#Timer=2 Do
  // relais
  //1=13,2=12,3=14,4=16,5=4,6=5,7=3,8=1
  Let,11,0 // relais 1 > 0 = arret , 1 = marche force , 2 = marche auto sonnette
  Let,12,0 // relais 2 > 0 = arret , 1 = marche force , 2 = marche auto fontaine
  Let,13,0 // relais 3 > 0 = arret , 1 = marche force , 2 = marche auto bassin
  Let,14,0 // relais 4 > 0 = arret , 1 = marche force , 2 = marche auto
  Let,15,0 // relais 5 > 0 = arret , 1 = marche force , 2 = marche auto chaudiere
  Let,16,0 // relais 6 > 0 = arret , 1 = marche force , 2 = marche auto
  Let,17,0 // relais 7 > 0 = arret , 1 = marche force , 2 = marche auto
  Let,18,0 // relais 8 > 0 = arret , 1 = marche force , 2 = marche auto
Endon

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

On Clock#Time=All,**:** Do // boucle suivant horaires
	// relais 1 sonnette
  if [Var#11]=2 and  %syssec_d% > 28800 and %syssec_d% < 72000 	//auto mode
    gpio,13,0
  elseif [Var#11]=1  	//always on
    gpio,13,0
  else 			//always off if var#11 anything else than 2 or 1 or %syssec_d% is outside the defined area 
    gpio,13,1
  endif	
	//relais 2 fontaine
  if [Var#12]=2 and %syssec_d% > 39600 and %syssec_d% < 72000 //de 11h a 20h
    gpio,12,0
  elseif [Var#12]=1 
    gpio,12,0
  else
    gpio,12,1
  endif
	//relais 3 pompe bassin
  If [Var#13]=2 and  %syssec_d% > 36000 and %syssec_d% < 68400 //de 10h a 19h
    Let,1,2
  Elseif [Var#13]=1 //< i guess this should be var#13 instead of var#12 
    gpio,14,0
    Let,1,1
  Else
    Let,1,0       
  Endif	
	//relais 4
  if [Var#14]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//
    gpio,16,0
  elseif [Var#14]=1
    gpio,16,0
  Else
    gpio,16,1 
  endif			
	//relais 5 chaudiere ete hiver
  if [Var#15]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//de 1h a 8h chaudiere
    gpio,4,0
  elseif [Var#15]=1
    gpio,4,0
  Else
   gpio,4,1 
  endif			
	//relais 6
  if [Var#16]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//
    gpio,5,0
  elseif [Var#16]=1
    gpio,5,0
  Else
    gpio,5,1 
  endif			
	//relais 7
  if [Var#17]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//
    gpio,3,0
  elseif [Var#17]=1
    gpio,3,0
  Else
    gpio,3,1 
  endif			
	//relais 8
  if [Var#18]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//
    gpio,1,0
  elseif [Var#18]=1
    gpio,1,0
  Else
    gpio,1,1 
  endif			
Endon

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

Re: error if and ife

#49 Post by chromo23 » 22 Nov 2022, 12:23

You don´t even need

Code: Select all

On Clock#Time=All,**:** Do 
Just put the code from there to

Code: Select all

On Rules#Timer=2 Do
And then it will check everything every 5 seconds...

Code: Select all

On System#Boot Do
  Let,1,0
  Let,2,0
  LoopTimerSet,1,900 //timer 15 minutes
  LoopTimerSet,2,5 //timer 5 seconds
Endon

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

On Rules#Timer=2 Do
  // relais
  //1=13,2=12,3=14,4=16,5=4,6=5,7=3,8=1
  Let,11,0 // relais 1 > 0 = arret , 1 = marche force , 2 = marche auto sonnette
  Let,12,0 // relais 2 > 0 = arret , 1 = marche force , 2 = marche auto fontaine
  Let,13,0 // relais 3 > 0 = arret , 1 = marche force , 2 = marche auto bassin
  Let,14,0 // relais 4 > 0 = arret , 1 = marche force , 2 = marche auto
  Let,15,0 // relais 5 > 0 = arret , 1 = marche force , 2 = marche auto chaudiere
  Let,16,0 // relais 6 > 0 = arret , 1 = marche force , 2 = marche auto
  Let,17,0 // relais 7 > 0 = arret , 1 = marche force , 2 = marche auto
  Let,18,0 // relais 8 > 0 = arret , 1 = marche force , 2 = marche auto
  
  // relais 1 sonnette
  if [Var#11]=2 and  %syssec_d% > 28800 and %syssec_d% < 72000 	//auto mode
    gpio,13,0
  elseif [Var#11]=1  	//always on
    gpio,13,0
  else 				//always off if var#11 anything else than 2 or 1
    gpio,13,1
  endif	
	//relais 2 fontaine
  if [Var#12]=2 and %syssec_d% > 39600 and %syssec_d% < 72000 //de 11h a 20h
    gpio,12,0
  elseif [Var#12]=1 
    gpio,12,0
  else
    gpio,12,1
  endif
	//relais 3 pompe bassin
  If [Var#13]=2 and  %syssec_d% > 36000 and %syssec_d% < 68400 //de 10h a 19h
    Let,1,2
  Elseif [Var#13]=1 //< i guess this should be var#13 instead of var#12 
    gpio,14,0
    Let,1,1
  Else
    Let,1,0       
  Endif	
	//relais 4
  if [Var#14]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//
    gpio,16,0
  elseif [Var#14]=1
    gpio,16,0
  Else
    gpio,16,1 
  endif			
	//relais 5 chaudiere ete hiver
  if [Var#15]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//de 1h a 8h chaudiere
    gpio,4,0
  elseif [Var#15]=1
    gpio,4,0
  Else
   gpio,4,1 
  endif			
	//relais 6
  if [Var#16]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//
    gpio,5,0
  elseif [Var#16]=1
    gpio,5,0
  Else
    gpio,5,1 
  endif			
	//relais 7
  if [Var#17]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//
    gpio,3,0
  elseif [Var#17]=1
    gpio,3,0
  Else
    gpio,3,1 
  endif			
	//relais 8
  if [Var#18]=2 and %syssec_d% > 3600 and %syssec_d% < 28800//
    gpio,1,0
  elseif [Var#18]=1
    gpio,1,0
  Else
    gpio,1,1 
  endif			
Endon


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

Re: error if and ife

#50 Post by TD-er » 22 Nov 2022, 12:56

Why do you need the 5 sec interval timer?
It needs to toggle some relais at 15 min interval.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 29 guests