Problem with script

Post Reply
User avatar
michaldobrotka
Posts: 77
Joined: Sunday 01 November 2015 18:21
Target OS: Raspberry Pi
Domoticz version: Beta
Contact:

Problem with script

Post by michaldobrotka » Thursday 24 May 2018 10:15

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
Attachments
Unbenannt.PNG
Unbenannt.PNG (14.39 KiB) Viewed 444 times
Domoticz on Raspi 3 and slave on ZeroW (running only with Broadlink plugin), Serial Mysensors GW on Arduino nano, Broadlink RM2, Rehau CO2 USB Stick, RF link 433 MHz, 2x Amazon Echo Dot (Controlicz), ESP2866 witk Espeasy, Sonoff

User avatar
mrf68
Posts: 266
Joined: Monday 23 February 2015 13:45
Target OS: Windows
Domoticz version: 3.4834
Location: Netherlands
Contact:

Re: Problem with script

Post by mrf68 » Thursday 24 May 2018 18:41

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.
----------
3x RPi
1x W2k12 (vm)
3x RFXcom433e
1x Razberry board
KAKU: 9x APA3-1500R, 2x ACDB-7000C, 3x AMST-606, 1x APIR-2150, 1x AWS-3500, 1x ATMT-502
Z-wave: 8x Everspring AN145
Misc: 2x wireless doorbells

User avatar
michaldobrotka
Posts: 77
Joined: Sunday 01 November 2015 18:21
Target OS: Raspberry Pi
Domoticz version: Beta
Contact:

Re: Problem with script

Post by michaldobrotka » Friday 25 May 2018 10:14

Hi @mrf68,
I followed your instructions, and simple script only with rainfall gauge is working. OR function with another condition isn’t working.
Thanks
Domoticz on Raspi 3 and slave on ZeroW (running only with Broadlink plugin), Serial Mysensors GW on Arduino nano, Broadlink RM2, Rehau CO2 USB Stick, RF link 433 MHz, 2x Amazon Echo Dot (Controlicz), ESP2866 witk Espeasy, Sonoff

User avatar
mrf68
Posts: 266
Joined: Monday 23 February 2015 13:45
Target OS: Windows
Domoticz version: 3.4834
Location: Netherlands
Contact:

Re: Problem with script

Post by mrf68 » Friday 25 May 2018 19:17

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. ;)
----------
3x RPi
1x W2k12 (vm)
3x RFXcom433e
1x Razberry board
KAKU: 9x APA3-1500R, 2x ACDB-7000C, 3x AMST-606, 1x APIR-2150, 1x AWS-3500, 1x ATMT-502
Z-wave: 8x Everspring AN145
Misc: 2x wireless doorbells

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests