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
#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


Messages In This Thread
irrigazione con sensore pioggi - by Hosutech - 23.04.2020, 14:32
RE: irrigazione con sensore pioggi - by admin - 23.04.2020, 14:42
RE: irrigazione con sensore pioggi - by Joep - 23.04.2020, 14:45

Forum Jump: