13.10.2022, 06:48
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)