Irrigation garden with buienradar Topic is solved

Moderator: leecollings

remko2000
Posts: 165
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Irrigation garden with buienradar

Post by remko2000 »

I can give my gardenplants water with a domoticz on/of switch (with off timer). I want on daily basis water my plants but not when it rains that day. I have also a buienradarswitch ' it rains' in domoticz.

What is the easiest way to script this which I involed the rainswitch? Is it possible whit a blocky? I have no knownledge of lua/dzventz.
niki_lauda
Posts: 115
Joined: Saturday 31 August 2013 14:48
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Eindhoven (NL)
Contact:

Re: Irrigation garden with buienradar

Post by niki_lauda »

remko2000
Posts: 165
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Re: Irrigation garden with buienradar

Post by remko2000 »

I saw this tread. The problem I encountered is that most of the example scripts are based on Weatherundergroundinfo. WU doens't provided free API's anymore so I use primarily Buienradar. I tried a couple of times to adjust a script to buienradarsensors but that is by no means an easy task for me.
wouterlet
Posts: 109
Joined: Tuesday 02 October 2018 20:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Irrigation garden with buienradar

Post by wouterlet »

Please post you're blocky here. That's easier to see what's going wrong
remko2000
Posts: 165
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Re: Irrigation garden with buienradar

Post by remko2000 »

I made this blocky:
Schermafbeelding 2020-05-03 om 11.55.51.png
Schermafbeelding 2020-05-03 om 11.55.51.png (54.94 KiB) Viewed 3001 times
I want that only in the evening/night (between 20.00 and 8.00 hour) my irrigation (waterpomp) goes on when my 'lavendel voch' is above 30 (cb).
It's switch off itself.

Is this the correct way or do I have to use variables? And how do I use this?
wouterlet
Posts: 109
Joined: Tuesday 02 October 2018 20:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Irrigation garden with buienradar

Post by wouterlet »

I think it could be able to work, but time can't be after 20:00 and before 8:00. Blocky only thinks in one day. Change the and between the time in or and I think it will work.
remko2000
Posts: 165
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Re: Irrigation garden with buienradar

Post by remko2000 »

Thx. I adjust it but my blocky doesn't work. After trying some things it looks like the problem is the variable 'lavendel vocht'. If I try another randow variable (by example the lux value outside) it does work.What is the problem with this variable and can I fix this or is there another workaround?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Irrigation garden with buienradar

Post by waaren »

remko2000 wrote: Tuesday 05 May 2020 10:16 After trying some things it looks like the problem is the variable 'lavendel vocht'.
What is the devicetype / subtype for the device lavendel vocht as shown on the devices tab ?
And please also show the Blockly as it is now after you made the changes in time logic in you answer.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
iganin
Posts: 47
Joined: Tuesday 28 October 2014 17:55
Target OS: NAS (Synology & others)
Domoticz version: 2020.2
Location: Aalter, Belgium
Contact:

Re: Irrigation garden with buienradar

Post by iganin »

The best time is watering garden is in mornings )
remko2000
Posts: 165
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Re: Irrigation garden with buienradar

Post by remko2000 »

this is my blocky now (I switched to fixed time):
Schermafbeelding 2020-05-05 om 12.56.35.png
Schermafbeelding 2020-05-05 om 12.56.35.png (54.7 KiB) Viewed 2942 times
'Lavendel vocht' is type 'General, Soil Moisture'
Schermafbeelding 2020-05-05 om 13.00.00.png
Schermafbeelding 2020-05-05 om 13.00.00.png (27.65 KiB) Viewed 2942 times
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Irrigation garden with buienradar

Post by waaren »

remko2000 wrote: Tuesday 05 May 2020 12:59 'Lavendel vocht' is type 'General, Soil Moisture'
Because the Soil Moisture device stores its moisture value in another place then most other devices (it uses nValue while most other utility devicetypes use sValue), Blockly is not able to evaluate the value.

You could try below dzVents alternative.

Code: Select all

return {
    on = {
        timer = 
        {
            'at 09:00',
            'at 21:00',
        },
    },
    
    logging =
    {
        level = domoticz.LOG_DEBUG, -- set to domoticz.LOG_ERROR when OK
        marker = 'Beregening',
    },

    execute = function(dz)
        local soilDevice = dz.devices('Lavendel vocht')
        local moisture = soilDevice.moisture
        local pump = dz.devices('Waterpomp')
        
        dz.log(soilDevice.name .. ' measures a moisture of ' .. moisture .. ' cb ',dz.LOG_DEBUG)
        
        if moisture < 30 then -- Should this be more ( > ) or less ( < )then 30 ?  
            pump.switchOn()
            pump.switchOff().afterSec(3600)
            dz.notify('Beregening', 'De planten worden automatisch beregend',dz.PRIORITY_NORMAL)
        end    
    end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
remko2000
Posts: 165
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Re: Irrigation garden with buienradar

Post by remko2000 »

I try this dzvents script and it works! Great!

Only strange thing is that only the time ' 21:00' works and ' 09.00' not. Maybe it is: 9:00 and not 09:00?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Irrigation garden with buienradar

Post by waaren »

remko2000 wrote: Friday 08 May 2020 9:10 Only strange thing is that only the time ' 21:00' works and ' 09.00' not. Maybe it is: 9:00 and not 09:00?
09:00 and 9:00 should both work. But I see in your post that you use 09.00 ?
the hour minute divider must be a :

What version do you use ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
remko2000
Posts: 165
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Re: Irrigation garden with buienradar

Post by remko2000 »

I use 2020.2 (latest stable). In use for both times ':' .

If I change to 10:30 It looks likes the script is now running

I checked my log:

Code: Select all

2020-05-08 10:30:00.529 Status: dzVents: Info: Beregening: ------ Start internal script: Irrigatiescript2:, trigger: "at 10:30"
2020-05-08 10:30:00.530 Status: dzVents: Debug: Beregening: Processing device-adapter for Lavendel vocht: Soil Moisture device
2020-05-08 10:30:00.531 Status: dzVents: Debug: Beregening: Processing device-adapter for Waterpomp: Switch device adapter
2020-05-08 10:30:00.532 Status: dzVents: Debug: Beregening: Lavendel vocht measures a moisture of 25 cb
2020-05-08 10:30:00.532 Status: dzVents: Info: Beregening: ------ Finished Irrigatiescript2
It measures 25CB so it's less than 30 so irrigation is not needed.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Irrigation garden with buienradar

Post by waaren »

remko2000 wrote: Friday 08 May 2020 10:45 If I change to 10:30 It looks likes the script is now running
Then please try again tomorrow with the original 'at 09:00'. I just retested with this and it does work as designed.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
zavjah
Posts: 36
Joined: Tuesday 13 August 2019 10:20
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: Irrigation garden with buienradar

Post by zavjah »

[quote=remko2000 post_id=246340 time=1588676346 user_id=17935]
this is my blocky now (I switched to fixed time):
Schermafbeelding 2020-05-05 om 12.56.35.png

'Lavendel vocht' is type 'General, Soil Moisture'
Schermafbeelding 2020-05-05 om 13.00.00.png
[/quote]

Hello remko2000,

I want to set up an Automat irrigation, too, supported by a soil moisture sensor. Can you tell me which device do you use to get the soil moisture into Domoticz?

Thx,
Zavjah
dheuts
Posts: 65
Joined: Monday 25 March 2019 15:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Brunssum, Netherlands
Contact:

Re: Irrigation garden with buienradar

Post by dheuts »

zavjah wrote: Monday 25 May 2020 17:26
remko2000 wrote: Tuesday 05 May 2020 12:59 this is my blocky now (I switched to fixed time):
Schermafbeelding 2020-05-05 om 12.56.35.png

'Lavendel vocht' is type 'General, Soil Moisture'
Schermafbeelding 2020-05-05 om 13.00.00.png
Hello remko2000,

I want to set up an Automat irrigation, too, supported by a soil moisture sensor. Can you tell me which device do you use to get the soil moisture into Domoticz?

Thx,
Zavjah
I use the Mi Flora sensors of Xiaomi
Raspberry Pi 4 With Domoticz - RFXCom - Tuya Wifi LED lights - Chuango Alarm - Zwave+ - Zigbee2MQTT - Anna Thermostat - Broadlink IR, P1 - Eufy Robo Vacuum - Worx Robo Mower
dheuts
Posts: 65
Joined: Monday 25 March 2019 15:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Brunssum, Netherlands
Contact:

Re: Irrigation garden with buienradar

Post by dheuts »

waaren wrote: Friday 08 May 2020 10:58
remko2000 wrote: Friday 08 May 2020 10:45 If I change to 10:30 It looks likes the script is now running
Then please try again tomorrow with the original 'at 09:00'. I just retested with this and it does work as designed.
Hi Waaren,

Good morning.
I was having the same problem with my Xiaomi Mi Flora Sensors.
Getting this errors:
2020-08-21 10:03:00.354 Error: EventSystem: Lua script error (Blockly), Name: Tijd Planten meldingen_5 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: attempt to compare nil with number
2020-08-21 10:03:00.354 Error: EventSystem: Lua script error (Blockly), Name: Tijd Planten meldingen_6 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: attempt to compare nil with number

I have got 4 sensors, and want to get notifications like you can see in my Blockly.
Can you please help me how to make a script in dzVents so this works?
I already edited your script so it works for one of the sensors for the water. How to make this script working for all 4 plants and also the plant food sensors?

Code: Select all

return {
    on = {
        timer = 
        {
            'at 09:39',
        },
    },
    
    logging =
    {
        level = domoticz.LOG_DEBUG, -- set to domoticz.LOG_ERROR when OK
        marker = 'Plant Meldingen',
    },

    execute = function(dz)
        local soilDevice = dz.devices('Zolder Bananenboom Vochtigheid')
        local moisture = soilDevice.moisture
        
        dz.log(soilDevice.name .. ' measures a moisture of ' .. moisture .. ' cb ',dz.LOG_DEBUG)
        
        if moisture < 20 then -- Should this be more ( > ) or less ( < )then 30 ? 
            dz.notify('Bananenboom water', 'De Bananenboom moet water hebben',dz.PRIORITY_NORMAL)
        end    
    end
}
Attachments
bananenboom.png
bananenboom.png (31.43 KiB) Viewed 2587 times
Raspberry Pi 4 With Domoticz - RFXCom - Tuya Wifi LED lights - Chuango Alarm - Zwave+ - Zigbee2MQTT - Anna Thermostat - Broadlink IR, P1 - Eufy Robo Vacuum - Worx Robo Mower
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Irrigation garden with buienradar

Post by waaren »

dheuts wrote: Monday 24 August 2020 9:34 Can you please help me how to make a script in dzVents so this works?
I already edited your script so it works for one of the sensors for the water. How to make this script working for all 4 plants and also the plant food sensors?
Happy to help but need some additional information.

Names, types and subtypes of all involved sensors
Per plant the water- and foodlimits to decide when notification is required.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
kiddigital
Posts: 435
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Irrigation garden with buienradar

Post by kiddigital »

remko2000 wrote:...

I want that only in the evening/night (between 20.00 and 8.00 hour) my irrigation (waterpomp) goes on when my 'lavendel voch' is above 30 (cb).
It's switch off itself.
What/which device do you use and how is it connected? Looking for something myself Image

The Gardena one is quite expensive and needs cloud connection which I am not really in favor off Image


Verzonden vanaf mijn iPhone met Tapatalk
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests