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.

Using time controls from scripts
#2
Yes this is possible..

What you need to do is create a range of KNX objects for your loads 1/1/1 to 1/1/50 for example, create a range of virtual objects 32/1/1 to 32/1/50 and tag the virtual objects with a TAG 'Input' 

Add toggle buttons (for selecting the load) on your visu and attach those to the virtual object (not the KNX objects!)

Then add this script as event on your scheduler
Code:
for index, object in ipairs(grp.tag('Input')) do
  grptable = string.split(object.address, '/')
  if object.value == true then
     grp.checkwrite('1/' .. grptable[2] .. '/' .. grptable[3], event.getvalue())
  end
end
 If you need the load to be synced with the scheduler state when selected/deselected you need to add another script to the "Input" TAG
Code:
scheduler = '4/7/0'
grptable = string.split(event.dst, '/')
if event.getvalue() == true then
   grp.checkwrite('1/' .. grptable[2] .. '/' .. grptable[3], grp.getvalue(scheduler))
else
   grp.checkwrite('1/' .. grptable[2] .. '/' .. grptable[3], false)
end
Reply


Messages In This Thread
Using time controls from scripts - by JRP - 12.05.2021, 16:24
RE: Using time controls from scripts - by Erwin van der Zwart - 12.05.2021, 20:29
RE: Using time controls from scripts - by JRP - 13.05.2021, 08:17
RE: Using time controls from scripts - by JRP - 13.05.2021, 19:20
RE: Using time controls from scripts - by JRP - 14.05.2021, 09:10

Forum Jump: