error if and ife
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 88
- Joined: 23 Nov 2020, 10:57
- Location: France
error if and ife
now , i've no access
is there any way to get the access back?
thank you
-
- Normal user
- Posts: 4341
- Joined: 10 Jun 2018, 12:06
- Location: NL
Re: error if and 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?
-
- Normal user
- Posts: 88
- Joined: 23 Nov 2020, 10:57
- Location: France
Re: error if and ife
-
- Normal user
- Posts: 4341
- Joined: 10 Jun 2018, 12:06
- Location: NL
Re: error if and ife
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 ?
-
- Core team member
- Posts: 9921
- Joined: 01 Sep 2017, 22:13
- Location: the Netherlands
Re: error if and ife
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.
-
- Normal user
- Posts: 88
- Joined: 23 Nov 2020, 10:57
- Location: France
Re: error if and ife
it reboot , reboot .....
-
- Core team member
- Posts: 9921
- Joined: 01 Sep 2017, 22:13
- Location: the Netherlands
Re: error if and ife
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

-
- Normal user
- Posts: 88
- Joined: 23 Nov 2020, 10:57
- Location: France
Re: error if and ife
thank you very much
-
- Normal user
- Posts: 4341
- Joined: 10 Jun 2018, 12:06
- Location: NL
Re: error if and ife
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)
-
- Normal user
- Posts: 88
- Joined: 23 Nov 2020, 10:57
- Location: France
Re: error if and ife
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
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
-
- Core team member
- Posts: 9921
- Joined: 01 Sep 2017, 22:13
- Location: the Netherlands
Re: error if and ife
Code: Select all
On Rules#Timer=1 Do
If [Var#1]=1
GPIOToggle,14
Else
GPIO,14,1
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
Also this block doesn't "do" anything as both set the variable to the same value.
-
- Normal user
- Posts: 88
- Joined: 23 Nov 2020, 10:57
- Location: France
Re: error if and ife
Code: Select all
On Rules#Timer=1 Do
If [Var#1]=1
GPIOToggle,14
Else
GPIO,14,1
endif
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 = 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
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?
-
- Normal user
- Posts: 1018
- Joined: 10 Sep 2020, 16:02
- Location: germany
Re: error if and ife
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
-
- Normal user
- Posts: 88
- Joined: 23 Nov 2020, 10:57
- Location: France
Re: error if and ife
-
- Normal user
- Posts: 4341
- Joined: 10 Jun 2018, 12:06
- Location: NL
Re: error if and ife
Alternative would be to add an extra "if" around the code that is to be excluded.
-
- Normal user
- Posts: 88
- Joined: 23 Nov 2020, 10:57
- Location: France
Re: error if and ife
-
- Normal user
- Posts: 1018
- Joined: 10 Sep 2020, 16:02
- Location: germany
Re: error if and ife
True, but i thought thats what he wanted....
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
-
- Normal user
- Posts: 88
- Joined: 23 Nov 2020, 10:57
- Location: France
Re: error if and ife
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
-
- Normal user
- Posts: 4341
- Joined: 10 Jun 2018, 12:06
- Location: NL
Re: error if and ife
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
Code: Select all
if [Var#11]!=2 // not auto
gpio,13,![Var#11] // Inverted state
endif
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
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
-
- Normal user
- Posts: 1018
- Joined: 10 Sep 2020, 16:02
- Location: germany
Re: error if and ife
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: 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?
-
- Normal user
- Posts: 88
- Joined: 23 Nov 2020, 10:57
- Location: France
Re: error if and ife
why 1min later?
-
- Normal user
- Posts: 1018
- Joined: 10 Sep 2020, 16:02
- Location: germany
Re: error if and ife
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
-
- Normal user
- Posts: 88
- Joined: 23 Nov 2020, 10:57
- Location: France
Re: error if and ife
-
- Normal user
- Posts: 1018
- Joined: 10 Sep 2020, 16:02
- Location: germany
Re: error if and ife
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
-
- Normal user
- Posts: 1018
- Joined: 10 Sep 2020, 16:02
- Location: germany
Re: error if and ife
because this:
Code: Select all
On Clock#Time=All,**:** Do // boucle suivant horaires
-
- Normal user
- Posts: 1018
- Joined: 10 Sep 2020, 16:02
- Location: germany
Re: error if and ife
-
- Normal user
- Posts: 88
- Joined: 23 Nov 2020, 10:57
- Location: France
Re: error if and ife
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]
-
- Normal user
- Posts: 1018
- Joined: 10 Sep 2020, 16:02
- Location: germany
Re: error if and ife
Code: Select all
On Rules#Timer=1 Do
If [Var#1]=1
GPIOToggle,14
Else
GPIO,14,1
ENDIF //important!!!!!!
Endon
-
- Normal user
- Posts: 88
- Joined: 23 Nov 2020, 10:57
- Location: France
Re: error if and ife
-
- Normal user
- Posts: 1018
- Joined: 10 Sep 2020, 16:02
- Location: germany
Re: error if and ife
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
Code: Select all
If [Var#1]=1
GPIOToggle,14
-
- Normal user
- Posts: 88
- Joined: 23 Nov 2020, 10:57
- Location: France
Re: error if and ife
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
-
- Normal user
- Posts: 88
- Joined: 23 Nov 2020, 10:57
- Location: France
Re: error if and ife
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
-
- Core team member
- Posts: 9921
- Joined: 01 Sep 2017, 22:13
- Location: the Netherlands
Re: error if and ife
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
-
- Normal user
- Posts: 1018
- Joined: 10 Sep 2020, 16:02
- Location: germany
Re: error if and ife
This will work....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
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
-
- Normal user
- Posts: 88
- Joined: 23 Nov 2020, 10:57
- Location: France
Re: error if and ife
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
-
- Core team member
- Posts: 9921
- Joined: 01 Sep 2017, 22:13
- Location: the Netherlands
Re: error if and ife
Rules act on events, so have to be in blocks like these:
Code: Select all
on ... do
....
endon
-
- Normal user
- Posts: 1018
- Joined: 10 Sep 2020, 16:02
- Location: germany
Re: error if and ife
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
-
- Normal user
- Posts: 88
- Joined: 23 Nov 2020, 10:57
- Location: France
Re: error if and ife
-
- Normal user
- Posts: 1018
- Joined: 10 Sep 2020, 16:02
- Location: germany
Re: error if and ife
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 .
-
- Core team member
- Posts: 9921
- Joined: 01 Sep 2017, 22:13
- Location: the Netherlands
Re: error if and ife
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
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.
-
- Normal user
- Posts: 4341
- Joined: 10 Jun 2018, 12:06
- Location: NL
Re: error if and ife
You can run the command
Code: Select all
event,system#boot
-
- Normal user
- Posts: 1018
- Joined: 10 Sep 2020, 16:02
- Location: germany
Re: error if and ife
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
-
- Normal user
- Posts: 1018
- Joined: 10 Sep 2020, 16:02
- Location: germany
Re: error if and ife
-
- Normal user
- Posts: 88
- Joined: 23 Nov 2020, 10:57
- Location: France
Re: error if and ife
be able to modify the action of each relay , ( on , off , on auto with schedule )
-
- Core team member
- Posts: 9921
- Joined: 01 Sep 2017, 22:13
- Location: the Netherlands
Re: error if and ife
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
-
- Normal user
- Posts: 88
- Joined: 23 Nov 2020, 10:57
- Location: France
Re: error if and ife
- 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
-
- Normal user
- Posts: 1018
- Joined: 10 Sep 2020, 16:02
- Location: germany
Re: error if and ife
Code: Select all
else //always off if var#11 anything else than 2 or 1
Code: Select all
else //always off if var#11 anything else than 2 or 1 or %syssec_d% is outside the defined area
-
- Normal user
- Posts: 1018
- Joined: 10 Sep 2020, 16:02
- Location: germany
Re: error if and ife
then the code i send you should work.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
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
-
- Normal user
- Posts: 1018
- Joined: 10 Sep 2020, 16:02
- Location: germany
Re: error if and ife
Code: Select all
On Clock#Time=All,**:** Do
Code: Select all
On Rules#Timer=2 Do
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
-
- Core team member
- Posts: 9921
- Joined: 01 Sep 2017, 22:13
- Location: the Netherlands
Re: error if and ife
It needs to toggle some relais at 15 min interval.
Who is online
Users browsing this forum: Anthropic Claude Bot [bot], OpenAI GPTBot [bot] and 16 guests