Blockly irrigation control problem

Moderator: leecollings

Post Reply
JohnyDeMarco
Posts: 3
Joined: Wednesday 03 April 2019 12:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Blockly irrigation control problem

Post by JohnyDeMarco »

Dear All,

I have an irrigation system with 4 circles (spray, rota1, rota2, rota3), controlled by 24VAC valves. I managed to control them with a relay board and an RPi (GPIOs). I added virtual switches to domoticz to open / close the valves (by running simple GPIO commands).
switches.jpg
switches.jpg (61.84 KiB) Viewed 946 times
I can open one circle for X minutes without any problems but cannot put them together.
spray.jpg
spray.jpg (19.25 KiB) Viewed 946 times
My problem is that I am trying to create an "irrigation cycle" program with Blockly, without any success. The idea was to have virtual switch (irrigation cycle), which starts the process by opening / closing the circles and stepping the counter.
full.jpg
full.jpg (125.59 KiB) Viewed 946 times
What's wrong with this? Unfortunately I cannot figure it out, please help. Thanks in advance,

Johny
User avatar
kuifje
Posts: 36
Joined: Wednesday 25 October 2017 16:38
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Heemskerk
Contact:

Re: Blockly irrigation control problem

Post by kuifje »

Johny,
you use a "if" "else" the wrong way.
When you click your mouse on the blue dot an else appears, that one you have to put under the if. You have to do this 4 times.
Now the first one doesn't know what the second one is doing or supposed to do.
Kuifje
JohnyDeMarco
Posts: 3
Joined: Wednesday 03 April 2019 12:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly irrigation control problem

Post by JohnyDeMarco »

Hi kuifje,

thanks for your quick support! It is better now, however, just the first cycle executed (Spray started and worked for 1 minute and stopped), the counter did not change after 60 seconds, therefore the second cycle (Rota1) not started. The "Irrigation cycle" stuck as "ON", "Counter" remains "0".
elseif.jpg
elseif.jpg (123.43 KiB) Viewed 938 times
I am wondering that maybe the value of the counter is wrong, as the "0/1/2/3/4" are the names, the levels are "0/10/20/30/40".

counter.jpg
counter.jpg (129.67 KiB) Viewed 938 times
Thanks in advance,

Johny
Gerwin
Posts: 84
Joined: Friday 12 August 2016 13:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly irrigation control problem

Post by Gerwin »

behind counter you are using the wrong block.
if you are using the level% block than is it working.
level%10 and level%20 level%30 Level%40

Gerwin
Attachments
IMG_0217.PNG
IMG_0217.PNG (235.34 KiB) Viewed 924 times
IMG_0216.PNG
IMG_0216.PNG (308.61 KiB) Viewed 930 times
JohnyDeMarco
Posts: 3
Joined: Wednesday 03 April 2019 12:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly irrigation control problem

Post by JohnyDeMarco »

Thank you All for your valuable support, I've tried all of them, my garden looks like a lake now :) Anyways, I fixed it. Or I can say: "there I fixed it" :)
fixed.jpg
fixed.jpg (66.18 KiB) Viewed 905 times
Not the best solution, but it works. I'll try to use the more sophisticated versions as soon as I have time to play with them.

Thx, Johny
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest