Rule for watering cycles
Moderators: grovkillen, Stuntteam, TD-er
Rule for watering cycles
Hello,
I start with the rules and I need your help to understand.
I would like with the instruction "On Clock # Time = All, 22:00 o'clock" to launch 5 launch loops of 3 watering zones (2 min each).
I can do Zone 1 ON and zone 1 OFF
on Clock # Time = All, 22:00 pm
Launch cycle 1/5:
* Launch Zone 1 on for 2 minutes (zone 3 off)
* Launch Zone 2 on for 2 minutes (zone 1 off)
* Launch Zone 3 on for 2 minutes (zone 2 off)
Then same thing cycle 2/5
Then same thing cycle 3/5
Then same thing cycle 4/5
Then same thing cycle 5/5
Can you help me ? or orient myself.
Thank you
I start with the rules and I need your help to understand.
I would like with the instruction "On Clock # Time = All, 22:00 o'clock" to launch 5 launch loops of 3 watering zones (2 min each).
I can do Zone 1 ON and zone 1 OFF
on Clock # Time = All, 22:00 pm
Launch cycle 1/5:
* Launch Zone 1 on for 2 minutes (zone 3 off)
* Launch Zone 2 on for 2 minutes (zone 1 off)
* Launch Zone 3 on for 2 minutes (zone 2 off)
Then same thing cycle 2/5
Then same thing cycle 3/5
Then same thing cycle 4/5
Then same thing cycle 5/5
Can you help me ? or orient myself.
Thank you
Sigalou
Utilisateur/Développeur Plugin Jeedom
Créateur des plugins Alexa-API & WatchDog
Utilisateur/Développeur Plugin Jeedom
Créateur des plugins Alexa-API & WatchDog
- Site perso dédié domotique : Sigalou-domotique
- Support : Alexa-API WatchDog
- Documentation, Changelog et Todo-List : Alexa-API WatchDog
Re: Rule for watering cycles
Please have a look at using timers: https://espeasy.readthedocs.io/en/lates ... g-examples
Re: Rule for watering cycles
Thank you for your advice, I went to see and sought to understand.
Hello friends, here's what I did, it works. Do you think we can do more simple?
Thank you for your valuable advice.
Hello friends, here's what I did, it works. Do you think we can do more simple?
Thank you for your valuable advice.
Code: Select all
on Clock#Time=All,22:00 do
let,1,1 // compteur de boucles (de 3 zones) de 1 à %v2%
let,2,5 // nombre de boucles (de 3 zones)
let,3,120 // temps d'arrosage de chaque zone en secondes
timerSet,5,1 //Initialise le Timer 1 à 1s
gpio,15,1 // Relais4=ON
endon
On Rules#Timer=5 do // Zone1=ON // Zone3=OFF
gpio,12,1 // Relais1
gpio,4,0 // Relais3
timerSet,6,%v3% // Lance timer 2 dans %v3% secondes
endon
On Rules#Timer=6 do // Zone1=OFF // Zone2=ON
gpio,12,0 // Relais1
gpio,5,1 // Relais2
timerSet,7,%v3% // Lance timer 3 dans %v3% secondes
endon
On Rules#Timer=7 do // Zone2=OFF // Zone3=ON
gpio,5,0 // Relais2
gpio,4,1 // Relais3
timerSet,8,%v3% // Lance timer 4 dans %v3% secondes
endon
On Rules#Timer=8 do
if %v1%<%v2% do
let,1,%v1%+1
timerSet,5,1 //Lance timer 5
else
gpio,15,0 // Relais4=OFF
gpio,4,0 // Relais3
endif
endon
Sigalou
Utilisateur/Développeur Plugin Jeedom
Créateur des plugins Alexa-API & WatchDog
Utilisateur/Développeur Plugin Jeedom
Créateur des plugins Alexa-API & WatchDog
- Site perso dédié domotique : Sigalou-domotique
- Support : Alexa-API WatchDog
- Documentation, Changelog et Todo-List : Alexa-API WatchDog
Re: Rule for watering cycles
Looks quite clean to me, but I'm not the expert on rules here
Glad to see you came up with this by just reading the docs. So apparently those are really helpful so it seems.
Glad to see you came up with this by just reading the docs. So apparently those are really helpful so it seems.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Rule for watering cycles
Thumbs up from me. That's clean
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
- dynamicdave
- Normal user
- Posts: 257
- Joined: 30 Jan 2017, 20:25
- Location: Hampshire, UK
Re: Rule for watering cycles
The only comment I would make (from my experience of using 'rules') would be to place the timerSet,5,1 as the last statement.
i.e. interchange the position of timerSet,5,1 and gpio,15,1
i.e. interchange the position of timerSet,5,1 and gpio,15,1
Code: Select all
On Clock#Time=All,22:00 do
let,1,1 // compteur de boucles (de 3 zones) de 1 à %v2%
let,2,5 // nombre de boucles (de 3 zones)
let,3,120 // temps d'arrosage de chaque zone en secondes
timerSet,5,1 //Initialise le Timer 1 à 1s
gpio,15,1 // Relais4=ON
endon
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Rule for watering cycles
Yep,, thanks Dave, it's good practice to do so.dynamicdave wrote: ↑03 Sep 2019, 10:30 The only comment I would make (from my experience of using 'rules') would be to place the timerSet,5,1 as the last statement.
i.e. interchange the position of timerSet,5,1 and gpio,15,1
Code: Select all
On Clock#Time=All,22:00 do let,1,1 // compteur de boucles (de 3 zones) de 1 à %v2% let,2,5 // nombre de boucles (de 3 zones) let,3,120 // temps d'arrosage de chaque zone en secondes timerSet,5,1 //Initialise le Timer 1 à 1s gpio,15,1 // Relais4=ON endon
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Rule for watering cycles
Merci à tous, thank you all
Sigalou
Utilisateur/Développeur Plugin Jeedom
Créateur des plugins Alexa-API & WatchDog
Utilisateur/Développeur Plugin Jeedom
Créateur des plugins Alexa-API & WatchDog
- Site perso dédié domotique : Sigalou-domotique
- Support : Alexa-API WatchDog
- Documentation, Changelog et Todo-List : Alexa-API WatchDog
Who is online
Users browsing this forum: Ahrefs [Bot] and 3 guests