06.02.2023, 12:17
You can do it like this, alarm_1 will write to 1/1/1, alarm_2 to 1/1/2 and so on.
But you cannot use else clause here because it will reset all other alarms. Either the alarm variable should have some value (like 1/0) or you should check the IP address of the camera that sent this event.
Code:
12345678910
<?
require('apps')
vars = getvars()
for i = 1, 16 do
if vars['alarm_' .. i] then
grp.write('1/1/' .. i, true)
end
end