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
#3
This is actually for a c-bus project. We are using the NAC.

We require lighting in zones to go from 100-50-OFF and return to 100 at any time.

We are programming our c-bus sensors to control the load as normal as a fail safe. but the c-bus sensors do not allow for orientation mode, we need to script this ourselves. The way i have it set is if the NAC falls over, the sensors still operate the lighting ON and OFF. Unfortunately the c-bus sensors are not as feature rich as many KNX products.

I currently have a script functioning correctly but im looking for ways to make it dynamic. the script is an event based script and i can use a keyword to trigger it. But im having trouble making it dynamic so i can use it across multiple rooms.

By TAG do you mean keyword? If so this is the approach i was taking, however the only thing the load groups and the occupancy group will have in common is the room number in the object Name.

Below is an example of some of the event script. The sensor triggers the event.

local net, app, group = event.dst:match("([^,]+)/([^,]+)/([^,]+)") -- read the group address that triggered the event --
net = tonumber(net) -- Convert the string variable to a number
app = tonumber(app) -- Convert the string variable to a number
group = tonumber(group) -- Convert the string variable to a number
level = event.getvalue() -- Source the level of the group address that triggered this script
local grptag = GetCBusGroupTag(net, app, group) -- Return group tag

log("Object ID: "..event.dst)
log("Network: "..net)
log("Application: "..app)
log("Group: "..group)
log("Level: "..level)
log("Message Source: "..event.sender)
log("Group Tag: "..grptag)


if level == 255 then -- if the occupancy group is at 255
 
  if GetCBusLevel(0, 56, 0)==124 then -- check if the load is at 124
    SetCBusLevel(0, 56, 0,255,0) -- if it is at 124, set it to 255. if its at another level ( like a scene or custom level, leave it alone )
SetCBusLevel(0, 56, 1,255,0)
    SetCBusLevel(0, 56, 2,255,0)
    SetCBusLevel(0, 56, 3,255,0)
  end
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 Diggerz - 26.07.2020, 10:36
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: