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.

how to use data types (3 bytes time / day)?
#2
(10.01.2016, 09:10)phongvucba Wrote: I have a problem hope everybody help  Sad .

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.
Heart
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.
Reply


Messages In This Thread
RE: how to use data types (3 bytes time / day)? - by buuuudzik - 10.01.2016, 10:59

Forum Jump: