Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document event types and subscription requests #112

Open
djkrite opened this issue Apr 3, 2019 · 4 comments
Open

Document event types and subscription requests #112

djkrite opened this issue Apr 3, 2019 · 4 comments

Comments

@djkrite
Copy link

djkrite commented Apr 3, 2019

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

@jeffreydwalter
Copy link
Owner

Hi,

There is a method in this library for subscribing to general events:

arlo/arlo.py

Line 319 in da9aba9

def HandleEvents(self, basestation, callback, timeout=120):

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:

arlo/arlo.py

Line 303 in da9aba9

def SubscribeToMotionEvents(self, basestation, callback, timeout=120):

@jeffreydwalter
Copy link
Owner

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. ;)

@andreasschraeder
Copy link

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?

@jeffreydwalter
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants