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.

Search Group names for string
#5
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.
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
Reply


Messages In This Thread
Search Group names for string - by Diggerz - 26.07.2020, 07:52
RE: Search Group names for string - by admin - 27.07.2020, 05:55
RE: Search Group names for string - by admin - 27.07.2020, 09:18
RE: Search Group names for string - by admin - 03.08.2020, 06:44

Forum Jump: