10.01.2016, 10:59
(10.01.2016, 09:10)phongvucba Wrote: I have a problem hope everybody help .
please write one script into objects 4/4/11, to turn one lamp if the value of 4/4/11 is equal to the value you want.
example is:
15:42:00 monday, its will turn on 1/1/1 lamp !
thank all !
Try this:
Code:
-- object mapped to this event must have its data type set
time = event.getvalue()
time1 = {["minute"]=42, ["second"]=0, ["hour"]=15, ["day"]=1}
value1 = true -- preconfigured value of a lamp
if time.day == time1.day and time.hour == time1.hour and time.minute == time1.minute then
grp.write('1/1/1', value1) -- change the lamp to the preconfigured value
else
-- do nothing
end
But the best way to the time controlling in LM is shedulers or sheduled script.