-
Notifications
You must be signed in to change notification settings - Fork 120
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
Add support for Blink Minis #290
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #290 +/- ##
==========================================
+ Coverage 81.55% 82.09% +0.53%
==========================================
Files 8 8
Lines 808 899 +91
==========================================
+ Hits 659 738 +79
- Misses 149 161 +12
Continue to review full report at Codecov.
|
Hi - I tried out this, on my system with 4 other cameras, on two sync modules, and the Blink Mini:
So - from there on things dont seem to work. The blink mini does not have a "name" and "network" like the others, but there does appear to be information about it in the OWL tags above. `>>> print("Sync Modules:")
So I get two cameras in the DB sync module. The other one is offline at the moment, and no cameras from the "Living Room" Blink Mini (virtual) sync module. CHeers Hugh |
Hi Kevin, looking at the value returned by blink.homescreen, there is an entry for the Blink Mini in the networks section: And, NO entry in the cameras section, but the new 'Owls" section has the details:
Cheers Hugh |
This is how it looks for my mini:
|
>>> pprint(blink.homescreen)
{'account': {'email_verification_required': True,
'email_verified': True,
'id': <account id>},
'app_updates': {'code': 105,
'message': 'An app update is required',
'update_available': True,
'update_required': True},
'cameras': [],
'chimes': [],
'device_limits': {'camera': 10,
'chime': 5,
'doorbell_button': 2,
'owl': 10,
'siren': 5,
'total_devices': 20},
'doorbell_buttons': [],
'networks': [{'armed': False,
'created_at': '2020-05-13T11:11:21+00:00',
'dst': True,
'id': <network id>,
'lv_save': False,
'name': '<network name>',
'time_zone': 'Europe/Berlin',
'updated_at': '2020-05-29T10:30:58+00:00'}],
'owls': [{'created_at': '2020-05-13T11:11:47+00:00',
'enabled': True,
'fw_version': '9.63',
'id': <owl id>,
'name': 'blimi',
'network_id': <network id>,
'onboarded': True,
'serial': 'G8T19400013513TS',
'status': 'online',
'thumbnail': '/media/e002/account/<account id>/network/<network id>/owl/<owl id>/thumbnail/fw_9.63__SseVTsm1_2020_06_08__15_02PM',
'type': 'owl',
'updated_at': '2020-06-08T23:28:19+00:00'}],
'sirens': [],
'sync_modules': [],
'video_stats': {'auto_delete_days': 30, 'storage': 0},
'whats_new': {'updated_at': 20200416,
'url': 'https://blinkforhome.com/blogs/updates'}}
>>> print("Sync Modules:")
Sync Modules:
>>> for name in blink.sync:
... print(name)
...
blimi
>>> print("Cameras:")
Cameras:
>>> for name in blink.cameras:
... print(name)
...
>>> |
Thank you all, very helpful! So it looks like I missed some initialization and merging of camera lists. I just added those now so hopefully we have better luck with the cameras. To get the update, you can just do the following: git pull upstream add-minis And then re-run the python code if you could! |
seems like before... {'account': {'email_verification_required': True,
'email_verified': True,
'id': <account id>},
'app_updates': {'code': 105,
'message': 'An app update is required',
'update_available': True,
'update_required': True},
'cameras': [],
'chimes': [],
'device_limits': {'camera': 10,
'chime': 5,
'doorbell_button': 2,
'owl': 10,
'siren': 5,
'total_devices': 20},
'doorbell_buttons': [],
'networks': [{'armed': False,
'created_at': '2020-05-13T11:11:21+00:00',
'dst': True,
'id': <network id>,
'lv_save': False,
'name': '<network name>',
'time_zone': 'Europe/Berlin',
'updated_at': '2020-05-29T10:30:58+00:00'}],
'owls': [{'created_at': '2020-05-13T11:11:47+00:00',
'enabled': True,
'fw_version': '9.63',
'id': <owl id>,
'name': 'blimi',
'network_id': <network id>,
'onboarded': True,
'serial': 'G8T19400013513TS',
'status': 'online',
'thumbnail': '/media/e002/account/<account id>/network/<network id>/owl/<owl id>/thumbnail/fw_9.63__SseVTsm1_2020_06_08__15_02PM',
'type': 'owl',
'updated_at': '2020-06-08T23:28:19+00:00'}],
'sirens': [],
'sync_modules': [],
'video_stats': {'auto_delete_days': 30, 'storage': 0},
'whats_new': {'updated_at': 20200416,
'url': 'https://blinkforhome.com/blogs/updates'}}
Sync Modules:
blimi
Cameras:
Traceback (most recent call last):
File "dbg.py", line 25, in <module>
print(blink.cameras[owl_name].thumbnail)
KeyError: 'blimi' |
python3 owlinfo.py <owl name> import sys
from pprint import pprint
from blinkpy.blinkpy import Blink
owl_name = sys.argv[1] if len(sys.argv) >= 2 else "blimi"
blink = Blink()
blink.start()
pprint(blink.homescreen)
print()
print("Sync Modules:")
for name in blink.sync:
print(f" {name}")
print()
print("Cameras:")
for name in blink.cameras:
print(f" {name}")
print()
try:
print(f"{blink.cameras[owl_name].thumbnail = }")
except Exception as error:
print(error)
print()
try:
blink.refresh()
print(f"{blink.sync[owl_name].arm = }")
except Exception as error:
print(error)
print()
try:
blink.sync[owl_name].arm = True
except Exception as error:
print(error)
print()
try:
blink.refresh()
print(f"{blink.sync[owl_name].arm = }")
except Exception as error:
print(error)
print() |
@benleb Thanks, I appreciate it! Looks like I still was missing some initialization. Added that in and added a test to make sure a camera was actually being created so I'm, like, 60% sure you'll get something now 🤞 🤞 |
:D we are on the right way... (it is really disarmed in the blink app) {'account': {'email_verification_required': True,
'email_verified': True,
'id': <account id>},
'app_updates': {'code': 105,
'message': 'An app update is required',
'update_available': True,
'update_required': True},
'cameras': [],
'chimes': [],
'device_limits': {'camera': 10,
'chime': 5,
'doorbell_button': 2,
'owl': 10,
'siren': 5,
'total_devices': 20},
'doorbell_buttons': [],
'networks': [{'armed': False,
'created_at': '2020-05-13T11:11:21+00:00',
'dst': True,
'id': <network id>,
'lv_save': False,
'name': '<network name>',
'time_zone': 'Europe/Berlin',
'updated_at': '2020-05-29T10:30:58+00:00'}],
'owls': [{'created_at': '2020-05-13T11:11:47+00:00',
'enabled': True,
'fw_version': '9.63',
'id': <owl id>,
'name': 'blimi',
'network_id': <network id>,
'onboarded': True,
'serial': 'G8T19400013513TS',
'status': 'online',
'thumbnail': '/media/e002/account/<account id>/network/<network id>/owl/<owl id>/thumbnail/fw_9.63__SseVTsm1_2020_06_08__15_02PM',
'type': 'owl',
'updated_at': '2020-06-08T23:28:19+00:00'}],
'sirens': [],
'sync_modules': [],
'video_stats': {'auto_delete_days': 30, 'storage': 0},
'whats_new': {'updated_at': 20200416,
'url': 'https://blinkforhome.com/blogs/updates'}}
Sync Modules:
blimi
Cameras:
blimi
blink.cameras[owl_name].thumbnail = 'https://rest-e002.immedia-semi.com/media/e002/account/<account id>/network/<network id>/owl/<owl id>/thumbnail/fw_9.63__SseVTsm1_2020_06_08__15_02PM.jpg'
blink.sync[owl_name].arm = True
Connection error. Endpoint https://rest-e002.immedia-semi.com/network/<network id>/camera/<owl id>/enable possibly down or throttled. 404: Not Found
sleeping for 60s now
blink.sync[owl_name].arm = True |
Awesome! So there's a different arm/disarm endpoint for the minis (of course 😞). Figured there was a slim chance I could re-use that endpoint. Could you just do one more check? I want to make sure the thumbnail can be downloaded and a new one generated (I assume it won't work and that there's a different endpoint, but worth trying): # Check if we can take a picture with existing endpoints
thumbnail = blink.cameras["CAMERA NAME"].snap_picture()
print(thumbnail)
# Check that we can successfully download an image
print(blink.cameras["CAMERA NAME"].thumbnail
blink.cameras["CAMERA NAME"].image_to_file("/path/to/file") |
POST (empty payload) to Connection error. Endpoint https://rest-e002.immedia-semi.com/network/<network id>/camera/<owl id>/thumbnail possibly down or throttled. 404: Not Found
thumbnail = None
blink.cameras[owl_name].thumbnail = 'https://rest-e002.immedia-semi.com/media/e002/account/<account id>/network/<network id>/owl/<owl id>/thumbnail/fw_9.63__SseVTsm1_2020_06_08__15_02PM.jpg' downloaded picture is valid :) (but not “fresh”) |
OK, cool. Just realized your post in the issue included a new thumbnail endpoint, so I added that. Could you give the |
works :) ...
thumbnail = {'id': 11328080, 'network_id': <network id>, 'command': 'thumbnail', 'state': 'new'}
... nice job 👍 |
I get this message when trying to arm/disarm my mini:
|
@chbndrhnns - two issues here. First is known: endpoint for arming blink minis is unknown right now (#293 ).That issue was known prior to merging. However, my intent was to have a warning message pop up telling you that...instead I absent-mindedly put the warning in the wrong spot so now regular sync modules are broken so I just raised that issue here #298 Some time today I'm going to do a quick cut to fix those two for another rc release. Arming the mini will still be unsupported until i (or someone) discovers the endpoint but at least it will tell you rather than attempting a futile http request |
Description:
Adds rough support for blink minis. Untested (as I don't own any) so will not merge until someone is able to test and verify. To help out:
Clone this repo and checkout the PR
Fork this repo in github and then do the following:
Run the following code to start up your blink instance
Will prompt for username, password, and possibly 2FA key
Check that homescreen property contains camerasNo longer needed, thank you!
Check that cameras are in sync and camera dictionaries
Verify thumbnail is correct (returns a url)
Verify arming/disarming cameras works
First, make sure the camera is disarmed in the blink app. Then run the following code and wait (up to 60s) to see the state change in the app (usually closer to 5s/10s, but Blink can be slow...)
Now wait 60s or so and double check that you can read the status back after a refresh (print statement should print 'True')
Report back results
Please comment on this PR with your results if you run through theses tests. If you run into any problems, please let me know with as much detail as you can provide so I can fix it!
Related issue (if applicable): fixes #224
Checklist:
tox
run successfully PR cannot be meged unless tests pass