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.

Swimming pool Scheduled script
#7
(13.10.2022, 06:48)admin Wrote: Create a scheduled script that runs once every hour:
Code:
addr1 = '1/1/1'
addr2 = '1/1/2'

week = tonumber(os.date('%W'))
hour = tonumber(os.date('%H'))
month = tonumber(os.date('%m'))

-- swap outputs on even weeks
if week % 2 == 0 then
  addr2, addr1 = addr1, addr2
end

-- summer mode (June 1st to August 31st)
if 6 <= month and month <= 8 then
  on = hour % 2 == 0
else
  on = hour % 3 == 0
end

grp.write(addr1, on)
grp.write(addr2, false)
Thanks for your reply, It's working well, but I need to study it!
Thanks again for your support.
Reply


Messages In This Thread
Swimming pool Scheduled script - by Shimaa - 11.10.2022, 12:46
RE: Swimming pool Scheduled script - by admin - 11.10.2022, 13:01
RE: Swimming pool Scheduled script - by admin - 11.10.2022, 13:19
RE: Swimming pool Scheduled script - by admin - 13.10.2022, 06:48
RE: Swimming pool Scheduled script - by Shimaa - 13.10.2022, 11:30

Forum Jump: