09.11.2020, 07:42
NetAtmo has webhook option that allows sending events via HTTP: https://dev.netatmo.com/apidocumentation...y#webhooks
On LM side you need to create a server-side .lp script that will handle events. Script should be uploaded via FTP using apps login to the user directory. If the file name is netatmo.lp then the HTTP path will be http://user:password@LM_IP/user/netatmo.lp
If username/password access does not work then you can disable password protection for user directory in User access settings.
Use this as a starting point:
On LM side you need to create a server-side .lp script that will handle events. Script should be uploaded via FTP using apps login to the user directory. If the file name is netatmo.lp then the HTTP path will be http://user:password@LM_IP/user/netatmo.lp
If username/password access does not work then you can disable password protection for user directory in User access settings.
Use this as a starting point:
Code:
<?
require('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