01.08.2020, 09:46
Thanks for the help with the Tag/Keyword. is it possible to get the level of one of the groups in the tag?
I need to validate against the current level of at least one of the load group's in the room before i change it. I've opted to use a zone number for the tags now as the room numbers for the project are subject to change.
zone = string.match(grptag, 'Z(%d)') -- get zone number from c-bus tag name ("Sensor Z1" -> "1")
objs = grp.tag('Z'..zone) -- find all objects with keyword Z"x" where x is zone variable number
if [one of the load groups in tag Z1]==124 then -- check if a load in tag Z1 is at 124, if a load is at 124, set all objects with tag Z1 to 255. if its at another level ( like a scene or custom level, end)
objs:write(255)
end
^ this is where i need to validate against the current level. i can either loop through each load group and validate each one individually or just pick one main load in the room to validate against. If its not to much trouble would you mind providing an example on looping through each group in the tag, and also picking just 1 load group out of the tag to validate against? I'm a little stuck on this, and id like to explore both options.
I need to validate against the current level of at least one of the load group's in the room before i change it. I've opted to use a zone number for the tags now as the room numbers for the project are subject to change.
zone = string.match(grptag, 'Z(%d)') -- get zone number from c-bus tag name ("Sensor Z1" -> "1")
objs = grp.tag('Z'..zone) -- find all objects with keyword Z"x" where x is zone variable number
if [one of the load groups in tag Z1]==124 then -- check if a load in tag Z1 is at 124, if a load is at 124, set all objects with tag Z1 to 255. if its at another level ( like a scene or custom level, end)
objs:write(255)
end
^ this is where i need to validate against the current level. i can either loop through each load group and validate each one individually or just pick one main load in the room to validate against. If its not to much trouble would you mind providing an example on looping through each group in the tag, and also picking just 1 load group out of the tag to validate against? I'm a little stuck on this, and id like to explore both options.