Logic Machine Forum
1 byte to 3byte time/date - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: 1 byte to 3byte time/date (/showthread.php?tid=5958)



1 byte to 3byte time/date - cheist - 08.04.2025

Hello

Can anyone make a lua script for a wiser for knx.

I have a 1 byte object 1 or 0 (1/1/1)

and want to write 1 hour to 32/1/1 (3 byte time/date) when 1/1/1 is 1 and with 0 reset time to 0

thank you.


RE: 1 byte to 3byte time/date - Daniel - 08.04.2025

Event script on your bit object, change the 1/1/1 to your Time group
Code:
-- time table
time = {
day = 0,
hour = 1,
minute = 0,
second = 0,
}

value = event.getvalue()
if value then
grp.write('1/1/1', time)
else
grp.write('1/1/1', 0)
end