arlo icon indicating copy to clipboard operation
arlo copied to clipboard

Document event types and subscription requests

Open djkrite opened this issue 5 years ago • 4 comments

Thank you for putting this library together. I have a more general question related to the Arlo events API.

I'd like to know how to get motion events from Arlo. Currently I'm able to receive "mediaUploadNotification" messages and nothing more. Below is the payload i use to subscribe to events via the notify endpoint (https://arlo.netgear.com/hmsweb/users/devices/notify/...), but I only receive "mediaUploadNotification" events and would like to receive motion related events and others...

{ "resource": "subscription/F5N4B7B-336..._web", "action": "set", "properties": { "devices": [ "2R048A..." ] }, "publishResponse": false }

I've also tried the below notify POST which terminates the socket anytime there is motion...

{ "to": "2R048A...", "from": "F5N4B7B-336..._web", "resource": "cameras/5E0387A...", "action": "set", "transId": "web!5b3b66f2.77ab9!...", "properties": { "motionDetected": true }, "publishResponse": true }

How do I get motion events?

Thank you

djkrite avatar Apr 03 '19 16:04 djkrite

Hi,

There is a method in this library for subscribing to general events: https://github.com/jeffreydwalter/arlo/blob/da9aba9e56566d3ae169ef514d8320a68d667e55/arlo.py#L319

Take a look at this method for an example of how to use the previous function (this function actually does what you want. i.e., subscribes to motion events: https://github.com/jeffreydwalter/arlo/blob/da9aba9e56566d3ae169ef514d8320a68d667e55/arlo.py#L303

jeffreydwalter avatar Apr 13 '19 21:04 jeffreydwalter

The more general answer to your question is that you need to connect to the EventStream and "subscribe" your basestation. Once you do that, you will start to receive events. You will also have to periodically send ping messages to /notify to ensure the subscription isn't ended by the server. Better to just use my library. ;)

jeffreydwalter avatar Apr 13 '19 21:04 jeffreydwalter

I'm facing the same issue. The subscription seems successful - but only media upload notifications come through - despite having sent devices/notify requests with the resources "basestation", "cameras", "storage" and "siren". It appears as only the "storage" notify request is working. @djkrite : the resource should be "subscriptions/F5N4B7B-336..._web" rather than "subscription/F5N4B7B-336..._web" - so there is an "s" missing. Probably just a typo in your post, because otherwise you would probably not get media upload notifications. @jeffreydwalter : I cannot use your library because I need to integrate the subscription in PHP rather than Python. This issue however should be independent of the language. Did you ever experience any similar issue or have an idea, what could cause the problem? @djkrite : Did you already resolve the problem?

andreasschraeder avatar Apr 26 '19 11:04 andreasschraeder

@andreasschraeder no, sorry. I am too busy these days to give much assistance. Good luck!

jeffreydwalter avatar Apr 26 '19 13:04 jeffreydwalter