Page 1 of 1

Problem with script

Posted: Thursday 24 May 2018 10:15
by michaldobrotka
Hi Guys,
(Raspi 3, Beta 3.9476)
I’m trying to create script for Irrigation bypass after rainy day or upcoming rain, by comparing rainfall gauge bigger than 2mm or rain expectation (on / off)
I have created Variable irri_bypass as integer.
I can’t get it to work - VAriable value is still just zero.

Thanks

Re: Problem with script

Posted: Thursday 24 May 2018 18:41
by mrf68
Hi,

I just did a test in version 3.9478 with an integer variable and a testswitch and blockly changed the variable when I turned the switch on or off. So it looks to me that this idea could work.

In your case: give it a try without the rainfall gauge, just the switch. Switch it manually and check if it works. If it does, try it without the switch, just the rainfall gauge and see if it works.

Re: Problem with script

Posted: Friday 25 May 2018 10:14
by michaldobrotka
Hi @mrf68,
I followed your instructions, and simple script only with rainfall gauge is working. OR function with another condition isn’t working.
Thanks

Re: Problem with script

Posted: Friday 25 May 2018 19:17
by mrf68
Problem with the OR statements in your script, is that if rainfall > 2 and rain expected is off, then the first rule wants to set the variable to 1 because of the rainfall, but then it gets to the second rule that wants to set the variable back to 0 because rain expected is off.

Just fyi. ;)