error if and ife
now , i've no access
is there any way to get the access back?
thank you
Have fun with controlling everything!
https://letscontrolit.com/forum/
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
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
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
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
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
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
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
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
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
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
because this:
Code: Select all
On Clock#Time=All,**:** Do // boucle suivant horaires
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]
Code: Select all
On Rules#Timer=1 Do
If [Var#1]=1
GPIOToggle,14
Else
GPIO,14,1
ENDIF //important!!!!!!
Endon
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
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
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
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
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
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
Code: Select all
on ... do
....
endon
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
Thats why it is so helpful, to give the whole picture of what you want to do...
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
You can run the command
Code: Select all
event,system#boot
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
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
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
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
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
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