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.

HTTP event from camera
#7
(06.02.2023, 12:17)admin Wrote: You can do it like this, alarm_1 will write to 1/1/1, alarm_2 to 1/1/2 and so on.
Code:
<?

require('apps')
vars = getvars()

for i = 1, 16 do
  if vars['alarm_' .. i] then
    grp.write('1/1/' .. i, true)
  end
end
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.

ok, i thank for your help, only one adress i need to write, but log each of event, something like this:
Code:
<?
require('apps')
vars = getvars()
for i = 1, 16 do
  if vars['alarm_' .. i] then
    grp.write('33/2/1', true)
  end
end
log(vars)

it looks to work from each cam
Reply


Messages In This Thread
HTTP event from camera - by 2MAX - 06.02.2023, 11:33
RE: HTTP event from camera - by admin - 06.02.2023, 11:54
RE: HTTP event from camera - by 2MAX - 06.02.2023, 12:02
RE: HTTP event from camera - by admin - 06.02.2023, 12:04
RE: HTTP event from camera - by 2MAX - 06.02.2023, 12:10
RE: HTTP event from camera - by admin - 06.02.2023, 12:17
RE: HTTP event from camera - by 2MAX - 06.02.2023, 12:24

Forum Jump: