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
No camera show's up #90
Comments
This is a follow up of home-assistant/core#17316 (comment) |
The cameras are linked, else the app wouldn't work. right ? |
Yeah, if you see them in the app, you should see them with the API. I cannot reproduce this issue, and I know of a few people who have tested the recent version and have not run into this issue, which is why I'm perplexed. A few questions:
EDIT: Also, does the output of |
|
So there's a communication error with the Blink servers then. To see if it's persisting, run |
Hmm, real quick, try the following: If they don't... my only guess is Blink has changed how non-US based cameras access their servers. You could try accessing the US servers to see if it works (though it's a bit of a manual process): import json
headers = {'Host': blinkpy.DEFAULT_URL, 'Content-Type': 'application/json'}
data = json.dumps({"email": blink._username, "password": blink._password, "client_specifier": "iPhone 9.2 | 2.2 | 222"})
blink.region_id = 'prod'
blink._host = 'prod' + blinkpy.BLINK_URL
resp = blinkpy.http_req(blink, url=blinkpy.LOGIN_URL, headers=headers, data=data, reqtype='post')
blink._token = resp['authtoken']['authtoken']
blink._auth_header = {'Host': blink._host, 'TOKEN_AUTH': blink._token}
blink.urls = blinkpy.BlinkURLHandler(blink.region_id)
blink.get_ids()
blink.sync = blinkpy.BlinkSyncModule(blink, blink._auth_header)
blink.sync.get_videos()
blink.sync.get_cameras()
blink.sync.set_links()
blink._events = blink.events_request() |
refresh() and get_cameras() had no effect did get something on resp: {'authtoken': {'authtoken': 'REDACTED', 'message': 'auth'}, 'networks': {'31911': {'name': 'Entrada', 'onboarded': True}, '46389': {'name': 'Home', 'onboarded': False}}, 'region': {'prde': 'Europe'}} also possibly relevant: blink.urls.__dict__
{'base_url': 'https://rest.prod.immedia-semi.com', 'home_url': 'https://rest.prod.immedia-semi.com/homescreen', 'event_url': 'https://rest.prod.immedia-semi.com/events/network', 'network_url': 'https://rest.prod.immedia-semi.com/network', 'networks_url': 'https://rest.prod.immedia-semi.com/networks', 'video_url': 'https://rest.prod.immedia-semi.com/api/v2/videos'} Also relevant ? blinkpy.BlinkSyncModule(blink, blink._auth_header).__dict__
{'blink': <blinkpy.blinkpy.Blink object at 0x10c341198>, '_auth_header': {'Host': 'prde.immedia-semi.com', 'TOKEN_AUTH': 'REDACTED'}, 'sync_id': None, 'region': None, 'region_id': None, '_host': None, '_events': [], 'cameras': {}, '_idlookup': {}, '_video_count': 0, '_all_videos': {}, '_summary': None, 'record_dates': {}, 'first_init': True} |
resp = blinkpy.http_req(blink, url="https://rest.prde.immedia-semi.com/network/31911/syncmodules", headers=headers) does retrieve my sync_module info |
resp = blinkpy.http_req(blink, url="https://rest.prde.immedia-semi.com/network/31911/cameras", headers=headers) does show my camera :) If you tell me were I need to look into your code I probably can come up with a PR :) |
Ok, it seems like the urls are actually being set to the US version ( Those urls should be initialized with the |
the urls look OK: blink.urls.__dict__
{'base_url': 'https://rest.prde.immedia-semi.com', 'home_url': 'https://rest.prde.immedia-semi.com/homescreen', 'event_url': 'https://rest.prde.immedia-semi.com/events/network', 'network_url': 'https://rest.prde.immedia-semi.com/network', 'networks_url': 'https://rest.prde.immedia-semi.com/networks', 'video_url': 'https://rest.prde.immedia-semi.com/api/v2/videos'} |
Hmm. Maybe the way I'm grabbing cameras is in the process of being deprecated. I'm thinking it would be better to use the |
I got that url from https://github.com/MattTW/BlinkMonitorProtocol |
Analysing your code, one problem is you assume 1 network_id. |
Interesting- maybe that's the root cause here, then? If you could come up with a solution to fix that, that would be awesome (since I'm unable to test that locally). |
This is the culprit devices shouldn't be [] |
This code doesn't show up any camera.
Cameras do show up in the app
The text was updated successfully, but these errors were encountered: