27.07.2020, 05:55
You can attach event to a tag but you should use different tags for sensors and control objects.
In LM you can use this script to find all objects with a certain tag.
In LM you can use this script to find all objects with a certain tag.
Code:
obj = grp.find(event.dst) -- get object data from group address
nr = string.match(obj.name, 'Room (%d+%.%d+)') -- get room number from object name ("Sensor Room 1.01" -> "1.01")
if nr then
tag = 'Room ' .. nr
objs = grp.tag(tag) -- find all objects with "Room X.Y" tag
objs:write(false) -- turn off all tagged objects
end