Page 1 of 2
Irrigation garden with buienradar
Posted: Friday 01 May 2020 17:29
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.
Re: Irrigation garden with buienradar
Posted: Friday 01 May 2020 17:39
by niki_lauda
Re: Irrigation garden with buienradar
Posted: Saturday 02 May 2020 7:57
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.
Re: Irrigation garden with buienradar
Posted: Sunday 03 May 2020 7:03
by wouterlet
Please post you're blocky here. That's easier to see what's going wrong
Re: Irrigation garden with buienradar
Posted: Sunday 03 May 2020 12:01
by remko2000
I made this blocky:

- Schermafbeelding 2020-05-03 om 11.55.51.png (54.94 KiB) Viewed 3406 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?
Re: Irrigation garden with buienradar
Posted: Sunday 03 May 2020 18:36
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.
Re: Irrigation garden with buienradar
Posted: Tuesday 05 May 2020 10:16
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?
Re: Irrigation garden with buienradar
Posted: Tuesday 05 May 2020 10:35
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.
Re: Irrigation garden with buienradar
Posted: Tuesday 05 May 2020 10:44
by iganin
The best time is watering garden is in mornings )
Re: Irrigation garden with buienradar
Posted: Tuesday 05 May 2020 12:59
by remko2000
this is my blocky now (I switched to fixed time):

- Schermafbeelding 2020-05-05 om 12.56.35.png (54.7 KiB) Viewed 3347 times
'Lavendel vocht' is type 'General, Soil Moisture'

- Schermafbeelding 2020-05-05 om 13.00.00.png (27.65 KiB) Viewed 3347 times
Re: Irrigation garden with buienradar
Posted: Tuesday 05 May 2020 15:41
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
}
Re: Irrigation garden with buienradar
Posted: Friday 08 May 2020 9:10
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?
Re: Irrigation garden with buienradar
Posted: Friday 08 May 2020 9:26
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 ?
Re: Irrigation garden with buienradar
Posted: Friday 08 May 2020 10:45
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.
Re: Irrigation garden with buienradar
Posted: Friday 08 May 2020 10:58
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.
Re: Irrigation garden with buienradar
Posted: Monday 25 May 2020 17:26
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
Re: Irrigation garden with buienradar
Posted: Monday 24 August 2020 9:29
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
Re: Irrigation garden with buienradar
Posted: Monday 24 August 2020 9:34
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
}
Re: Irrigation garden with buienradar
Posted: Monday 24 August 2020 10:40
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.
Re: Irrigation garden with buienradar
Posted: Monday 24 August 2020 12:02
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
The Gardena one is quite expensive and needs cloud connection which I am not really in favor off
Verzonden vanaf mijn iPhone met Tapatalk