When using datatype 3.byte time/day in visualization.
I want to set a time when pressing the time in visualization, but there u can also set day and seconds.
---------------------- sent to virtual object for visualisation-------------------------------------------addresstimewithoutseconds = '32/1/0'--'Time, and day [Wiser] Visualisation'now = os.date('*t')
-- system week day starts from sunday, convert it to knx formatwday = now.wday == 1and7ornow.wday - 1-- time tabletime = {
day = wday,
hour = now.hour,
minute = now.min,
second = now.sec,
}
-- date tabledate = {
day = now.day,
month = now.month,
year = now.year,
}
onlyhourandseconds = string.format("%02d", now.hour) .. ":" .. string.format("%02d", now.min)
old_value_onlyhourandseconds = grp.getvalue(addresstimewithoutseconds)
ifold_value_onlyhourandseconds ~= onlyhourandsecondsthengrp.write(addresstimewithoutseconds, onlyhourandseconds)
---------------------- sent to KNX bus--------------------------------------------- run only on the full hourmin = os.date('*t').minifmin == 24then-- only sent when it is 24 minutes, not every minute-- write to busgrp.write('15/0/2', time, dt.time) -- 'Time, and day [Wiser]'grp.update('15/0/1', date, dt.date) -- 'Datum' Only when date changedendend
i thought creaded by 'Erwin van der Zwart'
15/0/1 11.3 byte date
15/0/2 10.3 byte time / day
32/1/0 250 byte string
I hoped to use this 'conditionally', so only on certain timepickers with an additional class,
but embedding this code in a construct like .hourMinPick {...} does not work. HOw should that be written?
Don't ask what we can do in KNX but wonder what we can't - www.KNXlogic.eu
This CSS only hides the second input field when changing the value. The displayed value is still in H:MM:SS format. Options to hide seconds and day from both control and display will be added in the next firmware release.