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.

Time dependent script
#7
tried to get the above script working but it keeps jumping around on value's

Code:
-- Changes light depending on time of day
date = os.date('*t')
hour = date.hour
--Light ON
addr1 = '1/1/30'
--Lights val
addr2 = '1/4/30'
obj = grp.find(addr1)
if obj and obj.data and 19 <= hour and hour <= 7 then
grp.write(addr2, 10)
   else
 grp.write(addr2, 70)
end
 if not obj.data then
 grp.write(addr2, 0)
end
Reply


Messages In This Thread
Time dependent script - by FatMax - 18.11.2015, 13:21
RE: Time dependent script - by admin - 19.11.2015, 07:23
RE: Time dependent script - by FatMax - 19.11.2015, 08:33
RE: Time dependent script - by FatMax - 14.01.2016, 13:18
RE: Time dependent script - by admin - 14.01.2016, 13:36
RE: Time dependent script - by FatMax - 14.01.2016, 13:39
RE: Time dependent script - by KoBra - 12.09.2023, 18:34
RE: Time dependent script - by admin - 13.09.2023, 07:44
RE: Time dependent script - by KoBra - 13.09.2023, 13:16
RE: Time dependent script - by admin - 13.09.2023, 14:16
RE: Time dependent script - by KoBra - 14.09.2023, 09:25

Forum Jump: