I think this could be a solution:
You can also use db query:
Code:
tag = "exclude"
objects = grp.all()
filteredObjects = {}
for _,o in ipairs(objects) do
if o.tagcache.find(tag) then table.insert(filteredObjects, o) end
end
You can also use db query:
Code:
tag = "exclude"
sqlQuery = 'SELECT * FROM objects WHERE tagcache NOT LIKE "%" .. tag .. "%"'
filteredObjects = db:getall(sqlQuery)
-- if you need a value then you must also decode a value based on datatype
for _, o in ipairs(objects) do
o.value = knxdatatype.decode(o.datahex, o.datatype)
end
Done is better than perfect