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.

Modifying (writing) LM system date/time
#1
Hi all,

is there any way in Lua to update the LM system date/time in order to adjust it with a script ?

Many thank's in advance for your help.

All the best from France.
Reply
#2
(13.04.2020, 09:46)SigmaTec Wrote: Γεια σας όλα,

υπάρχει κάποιος τρόπος στο Lua να ενημερώσετε την ημερομηνία / ώρα του συστήματος LM για να το προσαρμόσετε με ένα σενάριο;

Πολλοί ευχαριστώ εκ των προτέρων για τη βοήθειά σας.

Όλα τα καλύτερα από τη Γαλλία.
Hi 
I use resident script rate 60
-- get current data as table
now = os.date('*t')
-- system week day starts from sunday, convert it to knx format
wday = now.wday == 1 and 7 or now.wday - 1
-- time table
time = {
day = wday,
hour = now.hour,
minute = now.min,
second = now.sec,
}
-- date table
date = {
day = now.day,
month = now.month,
year = now.year,
}
-- write to bus
grp.write('9/1/3', time, dt.time)
grp.write('9/1/2', date, dt.date)
Reply
#3
Hi Balatis,

thank's for your answer.

But I don't want to read and copy date/time in a LM object as in your script (I know how to do that), that I want is to modify (write) directly the system date/time internal to the LM, because after a long inactivity this system date/time is erased in the LM and I want to offer a possibility to my end users to update it with a script, not with the admin login and the classic LM menu.

Hoping it's more easy to understand my question now !

All the best.
Reply
#4
See this: https://openrb.com/example-change-timeda...pt-on-lm2/
Reply
#5
Perfect Admin, as usual !
Reply
#6
(13.04.2020, 16:43)SigmaTec Wrote: Perfect Admin, as usual !
Yo see too this topic https://forum.logicmachine.net/showthread.php?tid=2207
Reply


Forum Jump: