27.04.2024, 12:05
(This post was last modified: 27.04.2024, 12:08 by fleeceable.)
I use something like this to check alarms...
Resident script:
Resident script:
Code:
function check_count(tag, GA)
count = 0
data = grp.tag(tag)
for i=1, #data, 1 do
if string.sub(data[i].datatype, 1, 1) == '1' then --boolean
if data[i].value == true then
count = count +1
end
else
if data[i].value >0 then
count = count +1
end
end
end
grp.checkupdate(GA, count)
end
check_count('OCCUPIED','X/X/X')) --ADD TAG WHAT TO CHECK AND GROUP ADDRESS WHERE COUNT VALUE IS WRITTEN
check_count('HEATING','X/X/X'))
check_count('COOLING', 'X/X/X'))