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.

Synology surveillance Station webhook
#3
(13.04.2023, 10:12)KoBra Wrote: I have configured the webhook on surveillance station and made a survstat.lp script to receive the webhook.

If i look in it i see this data after the test:
Code:
equire('apps') -- read POST data body = ngx.req.get_body_data() if body then -- decode data as JSON data = json.pdecode(body) -- check that data is a table if type(data) == 'table' then log(data) -- movement detected, you can check data.camera_id if you have multiple cameras if data.event_type == 'movement' then -- do something when movement happens end end end

How can i now use the movement to turn on a light?

I used this from the netatmo camera topic in my .lp script
Code:
equire('apps')
-- read POST data
body = ngx.req.get_body_data()

if body then
  -- decode data as JSON
  data = json.pdecode(body)

  -- check that data is a table
  if type(data) == 'table' then
    log(data)

    -- movement detected, you can check data.camera_id if you have multiple cameras
    if data.event_type == 'movement' then
      -- do something when movement happens
    end
  end
end
I think i need to modify this part as i have no clue what i am getting in from synology
Reply


Messages In This Thread
RE: Synology surveillance Station webhook - by KoBra - 13.04.2023, 10:24

Forum Jump: