Snapshot capture
Now that ring has rolled out the snapshot capture feature, could that be added to the library to grab those images?
if you look at https://github.com/tchellomello/python-ring-doorbell/issues/124 someone has implemented the feature you are after using pure REST requests...
The api does have a get_snapshot() method but I cant get that working.
please change
def get_snapshot(self, retries=3, delay=1):
"""Take a snapshot and download it"""
url = API_URI + SNAPSHOT_TIMESTAMP_ENDPOINT
payload = {"doorbot_ids": [self._attrs.get('id')]}
self._ring.query(url, json=payload)
request_time = time.time()
for _ in range(retries):
time.sleep(delay)
response = self._ring.query(
url, method="POST", json=payload, raw=1).json()
#if response["timestamps"][0]["timestamp"] / 1000 > request_time:
return self._ring.query(API_URI + SNAPSHOT_ENDPOINT.format(
self._attrs.get('id')), raw=True).content
return False
example how to use
doorbell = myring.doorbells[0]
while True:
snapshot = doorbell.get_snapshot()
if snapshot:
# logger.info("Updating snapshot...")
open(snapshot_filename, "wb").write(snapshot)
[...]
if kind== "motion":
sendTelegram(snapshot_filename, MOTION_CHAT)
if kind == "ding":
sendTelegram(snapshot_filename, DING_CHAT)
callXBMC()
time.sleep(10)
Having tried this with a Ring Doorbell 2, it seems to me that the POST query method doesn't update the snapshot. It does get the timestamp of the latest snapshot and downloads it, but from what I can see it's just the most recent scheduled snapshot taken automatically by the doorbell.
btw, now I have rcvd snapshot on my old AppleWatch. wow!
I need to add this to my "archiver" script that downloads all video clips! Note to self, because still frames are awesome for later time lapse! Hope to try it out some time soon... Thanks for the added feature, hope it's working soon.
I am curious about the differences between:
- Take a photo now and download?
- Poll for list of $device $timespan images available?
- Download $snapshot_by_id_from_poll? ** I am assuming the still frames use similar mechanics as video clips?
There hasn't been any activity on this issue recently. This issue has been automatically marked as stale because of that. It will be closed if no further activity occurs. Please make sure to update to the latest ring_doorbell version and check if that solves the issue. Thank you for your contributions.