12.05.2021, 20:29
(This post was last modified: 12.05.2021, 20:33 by Erwin van der Zwart.)
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
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
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
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