12.09.2023, 18:34
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