This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

irrigazione con sensore pioggi
#1
Good morning everyone,
I ask you top experts if there is a preconfigured script (macro) for the management of 4/8 irrigation areas that provides the possibility of:
- schedule the start of the irrigation cycle for each zone and for a defined time for each individual zone, a sort of sequence scenario that starts the zones active in the cycle successively one after the other,
- insert a block for each zone to allow one or more specific zones to be blocked in the cycle,
- activate the irrigation block according to the rain sensor (1bit from a digital input),
- insert a filter for each zone that brings a reduction in the preset irrigation time based on comparison with a soil humidity sensor (example: zone 1 - time 10 'if soil moisture value> 40% 20% reduction .. then will be 8 '),

I await kind support and feedback, thank you
Reply
#2
Here's a similar script that has configurable enable and timer value via objects:
https://forum.logicmachine.net/showthrea...61#pid8161
Reply
#3
Hi Hosutech,

I once made a very simple script for this. Please find a copy below. It's a start of what you need but you need to extend it with some extra functionality but that al are simple conditions i would say..

start_stop = grp.getvalue('15/2/0') -- start stop
minuten = grp.getvalue('15/2/1') -- time per section (minutes, byte value)
sectie_1 = grp.getvalue('15/2/3') -- section 1
sectie_2 = grp.getvalue('15/2/4') -- section 2
sectie_3 = grp.getvalue('15/2/5') -- section 3
sectie_4 = grp.getvalue('15/2/7') -- section 4

minuten = minuten * 60 -- time calculation to minutes

stored_pomp_pid = storage.get('storage_pomp_pid')
if stored_pomp_pid == nil then
pid = os.getpid()
storage.set('storage_pomp_pid', pid)
else
pid = os.getpid()
storage.set('storage_pomp_pid', pid)
os.kill(stored_pomp_pid, signal.SIGKILL)
end

if start_stop == true then
if sectie_1 == true then
grp.write('0/2/3', true) -- section 1
os.sleep(minuten) -- time per section
grp.write('0/2/3', false) -- section 1
end
if sectie_2 == true then
grp.write('0/2/4', true) -- section 2
os.sleep(minuten) -- time per section
grp.write('0/2/4', false) -- section 2
end
if sectie_3 == true then
grp.write('0/2/5', true) -- section 3
os.sleep(minuten) -- time per section
grp.write('0/2/5', false) -- section 3
end
if sectie_4 == true then
grp.write('0/2/7', true) -- section 4
os.sleep(minuten) -- time per section
grp.write('0/2/7', false) -- section 4
end
else
grp.write('0/2/3', false) -- section 1
grp.write('0/2/4', false) -- section 2
grp.write('0/2/5', false) -- section 3
grp.write('0/2/7', false) -- section 4
end
Reply
#4
(23.04.2020, 14:45)Joep Wrote: Hi Hosutech,

I once made a very simple script for this. Please find a copy below. It's a start of what you need but you need to extend it with some extra functionality but that al are simple conditions i would say..

start_stop = grp.getvalue('15/2/0')      -- start stop
minuten    = grp.getvalue('15/2/1') -- time per section (minutes, byte value)
sectie_1  = grp.getvalue('15/2/3') -- section 1
sectie_2  = grp.getvalue('15/2/4') -- section 2
sectie_3  = grp.getvalue('15/2/5') -- section 3
sectie_4  = grp.getvalue('15/2/7') -- section 4

minuten = minuten * 60 -- time calculation to minutes

stored_pomp_pid = storage.get('storage_pomp_pid') 
if stored_pomp_pid == nil then
    pid = os.getpid()
  storage.set('storage_pomp_pid', pid)
else
    pid = os.getpid() 
  storage.set('storage_pomp_pid', pid) 
  os.kill(stored_pomp_pid, signal.SIGKILL)
end

if start_stop == true then
  if sectie_1 == true then
  grp.write('0/2/3', true)  -- section 1
    os.sleep(minuten)       -- time per section
  grp.write('0/2/3', false) -- section 1
  end
  if sectie_2 == true then
  grp.write('0/2/4', true)  -- section 2
    os.sleep(minuten)       -- time per section
  grp.write('0/2/4', false) -- section 2
  end       
  if sectie_3 == true then
  grp.write('0/2/5', true)  -- section 3
    os.sleep(minuten)       -- time per section
  grp.write('0/2/5', false) -- section 3
  end         
  if sectie_4 == true then
  grp.write('0/2/7', true)  -- section 4
    os.sleep(minuten)       -- time per section
  grp.write('0/2/7', false) -- section 4
  end           
else
  grp.write('0/2/3', false) -- section 1
  grp.write('0/2/4', false) -- section 2
  grp.write('0/2/5', false) -- section 3
  grp.write('0/2/7', false) -- section 4
end
Thanks JOEP
I try your script and let you know.
To make good

(23.04.2020, 14:42)admin Wrote: Here's a similar script that has configurable enable and timer value via objects:
https://forum.logicmachine.net/showthrea...61#pid8161
well thanks, I try it and let you know
Reply


Forum Jump: