13.10.2022, 11:30
(13.10.2022, 06:48)admin Wrote: Create a scheduled script that runs once every hour:Thanks for your reply, It's working well, but I need to study it!
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 again for your support.