Ring 2 Doorbell
Moderator: leecollings
-
- Posts: 3
- Joined: Tuesday 01 September 2020 14:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Ring 2 Doorbell
Anyone still working with this library?
I've connected it with my ring 1, so far so good. I can get a snapshot (don't know yet if this really is the latest snapshot).
In an infinite while loop (2sec each) I call update_dings() function and check active_alerts(). But active_alerts() always returns an empty array.
When the official app fires the notifications, shouldn't the active_alerts() do also?
@alain any progress since last month?
I've connected it with my ring 1, so far so good. I can get a snapshot (don't know yet if this really is the latest snapshot).
In an infinite while loop (2sec each) I call update_dings() function and check active_alerts(). But active_alerts() always returns an empty array.
When the official app fires the notifications, shouldn't the active_alerts() do also?
@alain any progress since last month?
-
- Posts: 165
- Joined: Sunday 26 April 2020 5:27
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Netherlands
- Contact:
Re: Ring 2 Doorbell
No. I didn't get any response on how to proceed and left it at that. If someone can explain what I need to do (instead of just saying "follow the instructions") I'd be willing to try it again.
Hue | Zigbee2Mqtt | MQTT | P1 | Xiaomi | RFXCom | Modbus | Qlima | Solaredge
TP-Link | Plugwise | Thermosmart | Node-Red | Grafana | Master and 5 remote servers
TP-Link | Plugwise | Thermosmart | Node-Red | Grafana | Master and 5 remote servers
-
- Posts: 3
- Joined: Tuesday 01 September 2020 14:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Ring 2 Doorbell
This is what I have now, could use some cleanup when it's working...
All seems to be working, except myring.active_alerts() is always empty.
All seems to be working, except myring.active_alerts() is always empty.
Code: Select all
from ring_doorbell import Ring, Auth
from time import sleep
from oauthlib.oauth2 import MissingTokenError
from pathlib import Path
import urllib2
import json
import logging
import base64
from datetime import datetime
username='RING username'
password='RING password'
cache_file = Path('/home/pi/doorbell/token.cache')
logger = logging.getLogger('ring')
hdlr = logging.FileHandler('/home/pi/doorbell/ring.log')
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
logger.setLevel(logging.INFO)
def token_updated(token):
f=open('/home/pi/doorbell/token.cache', "w")
f.write(json.dumps(token))
f.close()
logger.info('Token updated')
def otp_callback():
auth_code = 'CODE RECEIVED BY MAIL'
return auth_code
if cache_file.is_file():
f=open('/home/pi/doorbell/token.cache', "r")
auth = Auth("DomoticzDoorbell/1.0", json.loads(f.read()), token_updated)
f.close()
else:
auth = Auth("DomoticzDoorbell/1.0", None, token_updated)
try:
auth.fetch_token(username, password)
except MissingTokenError:
auth.fetch_token(username, password, otp_callback())
myring = Ring(auth)
logger.info('Logged in')
myring.update_data()
devices = myring.devices()
doorbells = devices['doorbots']
doorbell = doorbells[0]
f2=open('/home/pi/doorbell/snapshot.jpg', "w")
base64string = base64.encodestring('%s:%s' % ('DOMOTICZ USERNAME', 'DOMOTICZ PASSWORD')).replace('\n', '')
def domoticzrequest (url):
request = urllib2.Request(url)
request.add_header("Authorization", "Basic %s" % base64string)
response = urllib2.urlopen(request)
return response.read()
# Now loop infinitely
while(1):
myring.update_dings()
if myring.active_alerts() != []:
logger.info('We have an alert!')
post_domo = domoticzrequest('http://DOMOTICZ_URL:8080/json.htm?type=command¶m=switchlight&idx=SWITCH_IDX&switchcmd=On
logger.info(post_domo)
image = doorbell.get_snapshot()
f2.write(image)
# Loop around
sleep(2)
-
- Posts: 165
- Joined: Sunday 26 April 2020 5:27
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Netherlands
- Contact:
Re: Ring 2 Doorbell
Did you put this in a plugin.py file in the python-ring-doorbell directory? In the code I see "from ring_doorbell import Ring" but I don't see a file called Ring in my directory.frietsje wrote: ↑Wednesday 09 September 2020 9:32 This is what I have now, could use some cleanup when it's working...
All seems to be working, except myring.active_alerts() is always empty.
Code: Select all
from ring_doorbell import Ring, Auth from time import sleep from oauthlib.oauth2 import MissingTokenError from pathlib import Path import urllib2 import json import logging import base64 from datetime import datetime username='RING username' password='RING password' cache_file = Path('/home/pi/doorbell/token.cache') logger = logging.getLogger('ring') hdlr = logging.FileHandler('/home/pi/doorbell/ring.log') formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') hdlr.setFormatter(formatter) logger.addHandler(hdlr) logger.setLevel(logging.INFO) def token_updated(token): f=open('/home/pi/doorbell/token.cache', "w") f.write(json.dumps(token)) f.close() logger.info('Token updated') def otp_callback(): auth_code = 'CODE RECEIVED BY MAIL' return auth_code if cache_file.is_file(): f=open('/home/pi/doorbell/token.cache', "r") auth = Auth("DomoticzDoorbell/1.0", json.loads(f.read()), token_updated) f.close() else: auth = Auth("DomoticzDoorbell/1.0", None, token_updated) try: auth.fetch_token(username, password) except MissingTokenError: auth.fetch_token(username, password, otp_callback()) myring = Ring(auth) logger.info('Logged in') myring.update_data() devices = myring.devices() doorbells = devices['doorbots'] doorbell = doorbells[0] f2=open('/home/pi/doorbell/snapshot.jpg', "w") base64string = base64.encodestring('%s:%s' % ('DOMOTICZ USERNAME', 'DOMOTICZ PASSWORD')).replace('\n', '') def domoticzrequest (url): request = urllib2.Request(url) request.add_header("Authorization", "Basic %s" % base64string) response = urllib2.urlopen(request) return response.read() # Now loop infinitely while(1): myring.update_dings() if myring.active_alerts() != []: logger.info('We have an alert!') post_domo = domoticzrequest('http://DOMOTICZ_URL:8080/json.htm?type=command¶m=switchlight&idx=SWITCH_IDX&switchcmd=On logger.info(post_domo) image = doorbell.get_snapshot() f2.write(image) # Loop around sleep(2)
Hue | Zigbee2Mqtt | MQTT | P1 | Xiaomi | RFXCom | Modbus | Qlima | Solaredge
TP-Link | Plugwise | Thermosmart | Node-Red | Grafana | Master and 5 remote servers
TP-Link | Plugwise | Thermosmart | Node-Red | Grafana | Master and 5 remote servers
-
- Posts: 3
- Joined: Tuesday 01 September 2020 14:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Ring 2 Doorbell
No, this is just an ordinary file somewhere. It's executed in a service.
You installed the Python package from the github repo?
You installed the Python package from the github repo?
-
- Posts: 165
- Joined: Sunday 26 April 2020 5:27
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Netherlands
- Contact:
Re: Ring 2 Doorbell
Yes I did.
Hue | Zigbee2Mqtt | MQTT | P1 | Xiaomi | RFXCom | Modbus | Qlima | Solaredge
TP-Link | Plugwise | Thermosmart | Node-Red | Grafana | Master and 5 remote servers
TP-Link | Plugwise | Thermosmart | Node-Red | Grafana | Master and 5 remote servers
-
- Posts: 32
- Joined: Sunday 08 March 2015 13:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2.4739
- Contact:
Re: Ring 2 Doorbell
I've got it working for 90%. The only thing that does not work is downloading the snapshot. I get this error:
File "ring2.py", line 69, in <module>
image = doorbell.get_snapshot()
File "/home/pi/.local/lib/python2.7/site-packages/ring_doorbell/doorbot.py", line 427, in get_snapshot
self._ring.query(url)
File "/home/pi/.local/lib/python2.7/site-packages/ring_doorbell/__init__.py", line 101, in query
timeout=timeout,
File "/home/pi/.local/lib/python2.7/site-packages/ring_doorbell/auth.py", line 89, in query
req.raise_for_status()
File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 405 Client Error: Method Not Allowed for url: https://api.ring.com/clients_api/snapsh ... _version=9
Do i need a subscription to Ring to make this work or do i need to do something else?
Thanks,
Peter
File "ring2.py", line 69, in <module>
image = doorbell.get_snapshot()
File "/home/pi/.local/lib/python2.7/site-packages/ring_doorbell/doorbot.py", line 427, in get_snapshot
self._ring.query(url)
File "/home/pi/.local/lib/python2.7/site-packages/ring_doorbell/__init__.py", line 101, in query
timeout=timeout,
File "/home/pi/.local/lib/python2.7/site-packages/ring_doorbell/auth.py", line 89, in query
req.raise_for_status()
File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 405 Client Error: Method Not Allowed for url: https://api.ring.com/clients_api/snapsh ... _version=9
Do i need a subscription to Ring to make this work or do i need to do something else?
Thanks,
Peter
RaspberryPI
ZWave
RFXtrx433E
ZWave
RFXtrx433E
-
- Posts: 34
- Joined: Friday 02 February 2018 16:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Ring 2 Doorbell
I rewrote it a bit so it works for me:
Code: Select all
#!/usr/bin/env python
from ring_doorbell import Ring, Auth
from time import sleep
from oauthlib.oauth2 import MissingTokenError
from pathlib import Path
import urllib.request as urllib2
import json
import logging
import base64
#import base64.encodestring as base64
from datetime import datetime
username='ringuser'
password='ringpassword!'
cache_file = Path('/home/pi/domoticz/scripts/ring/python-ring-doorbell/token.cache')
logger = logging.getLogger('ring')
hdlr = logging.FileHandler('/home/pi/domoticz/scripts/ring/python-ring-doorbell/ring.log')
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
logger.setLevel(logging.INFO)
def token_updated(token):
f=open('/home/pi/domoticz/scripts/ring/python-ring-doorbell/token.cache', "w")
f.write(json.dumps(token))
f.close()
logger.info('Token updated')
def otp_callback():
auth_code = 'CODE RECEIVED BY MAIL'
return auth_code
if cache_file.is_file():
f=open('/home/pi/domoticz/scripts/ring/python-ring-doorbell/token.cache', "r")
auth = Auth("DomoticzDoorbell/1.0", json.loads(f.read()), token_updated)
f.close()
else:
auth = Auth("DomoticzDoorbell/1.0", None, token_updated)
try:
auth.fetch_token(username, password)
except MissingTokenError:
auth.fetch_token(username, password, otp_callback())
myring = Ring(auth)
logger.info('Logged in')
myring.update_data()
devices = myring.devices()
doorbells = devices['doorbots']
doorbell = doorbells[0]
f2=open('/home/pi/domoticz/scripts/ring/python-ring-doorbell/snapshot.jpg', "w")
base64str = ('%s:%s' % ('DOMOTICZ USERNAME', 'DOMOTICZ PASSWORD')).replace('\n', '')
base64string = base64.b64encode(base64str.encode('utf-8'))
def domoticzrequest (url):
request = urllib2.Request(url)
request.add_header("Authorization", "Basic %s" % base64string)
response = urllib2.urlopen(request)
return response.read()
# Now loop infinitely
while(1):
myring.update_dings()
if myring.active_alerts() != []:
logger.info('We have an alert!')
post_domo = domoticzrequest('http://192.168.1.140:8080/json.htm?type=command¶m=switchlight&idx=413&switchcmd=On')
logger.info(post_domo)
image = doorbell.get_snapshot()
f2.write(image)
# Loop around
sleep(2)
frietsje wrote: ↑Wednesday 09 September 2020 9:32 This is what I have now, could use some cleanup when it's working...
All seems to be working, except myring.active_alerts() is always empty.
Code: Select all
from ring_doorbell import Ring, Auth from time import sleep from oauthlib.oauth2 import MissingTokenError from pathlib import Path import urllib2 import json import logging import base64 from datetime import datetime username='RING username' password='RING password' cache_file = Path('/home/pi/doorbell/token.cache') logger = logging.getLogger('ring') hdlr = logging.FileHandler('/home/pi/doorbell/ring.log') formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') hdlr.setFormatter(formatter) logger.addHandler(hdlr) logger.setLevel(logging.INFO) def token_updated(token): f=open('/home/pi/doorbell/token.cache', "w") f.write(json.dumps(token)) f.close() logger.info('Token updated') def otp_callback(): auth_code = 'CODE RECEIVED BY MAIL' return auth_code if cache_file.is_file(): f=open('/home/pi/doorbell/token.cache', "r") auth = Auth("DomoticzDoorbell/1.0", json.loads(f.read()), token_updated) f.close() else: auth = Auth("DomoticzDoorbell/1.0", None, token_updated) try: auth.fetch_token(username, password) except MissingTokenError: auth.fetch_token(username, password, otp_callback()) myring = Ring(auth) logger.info('Logged in') myring.update_data() devices = myring.devices() doorbells = devices['doorbots'] doorbell = doorbells[0] f2=open('/home/pi/doorbell/snapshot.jpg', "w") base64string = base64.encodestring('%s:%s' % ('DOMOTICZ USERNAME', 'DOMOTICZ PASSWORD')).replace('\n', '') def domoticzrequest (url): request = urllib2.Request(url) request.add_header("Authorization", "Basic %s" % base64string) response = urllib2.urlopen(request) return response.read() # Now loop infinitely while(1): myring.update_dings() if myring.active_alerts() != []: logger.info('We have an alert!') post_domo = domoticzrequest('http://DOMOTICZ_URL:8080/json.htm?type=command¶m=switchlight&idx=SWITCH_IDX&switchcmd=On logger.info(post_domo) image = doorbell.get_snapshot() f2.write(image) # Loop around sleep(2)
-
- Posts: 187
- Joined: Tuesday 07 March 2017 21:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Germany
- Contact:
Re: Ring 2 Doorbell
Hello, I have now bought the Ring 3!
Could someone write step by step instructions on how to set up the bell in domoticz?
Thank you so much!
Could someone write step by step instructions on how to set up the bell in domoticz?
Thank you so much!
-
- Posts: 32
- Joined: Sunday 08 March 2015 13:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2.4739
- Contact:
Re: Ring 2 Doorbell
Hi,
I'm still getting: requests.exceptions.HTTPError: 405 Client Error: Method Not Allowed for url: https://api.ring.com/clients_api/snapsh ... _version=9
Do i need to update something or enable something at ring?
Peter
I'm still getting: requests.exceptions.HTTPError: 405 Client Error: Method Not Allowed for url: https://api.ring.com/clients_api/snapsh ... _version=9
Do i need to update something or enable something at ring?
Peter
RaspberryPI
ZWave
RFXtrx433E
ZWave
RFXtrx433E
-
- Posts: 34
- Joined: Friday 02 February 2018 16:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Ring 2 Doorbell
You have shared very little information.PeterFleur wrote: ↑Saturday 07 November 2020 14:49 Hi,
I'm still getting: requests.exceptions.HTTPError: 405 Client Error: Method Not Allowed for url: https://api.ring.com/clients_api/snapsh ... _version=9
Do i need to update something or enable something at ring?
Peter
Did you do the suggested plugin.py section within the directory?
Are you trying to run it and write an error there? One important thing was left out of the forum here. When you use the app, one hits the other. Invite yourself to another emal address, set up the info in the (cloned?) App, log in and use the python plugin
-
- Posts: 34
- Joined: Friday 02 February 2018 16:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Ring 2 Doorbell
I also use the python plugin written above with Ring 3 doorbells. Unfortunately, I don’t have time for how to make a description yet. If you get stuck I'll try to help.
-
- Posts: 32
- Joined: Sunday 08 March 2015 13:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2.4739
- Contact:
Re: Ring 2 Doorbell
I'm sorry, i will add more information.molnaratti wrote: ↑Sunday 08 November 2020 13:22You have shared very little information.PeterFleur wrote: ↑Saturday 07 November 2020 14:49 Hi,
I'm still getting: requests.exceptions.HTTPError: 405 Client Error: Method Not Allowed for url: https://api.ring.com/clients_api/snapsh ... _version=9
Do i need to update something or enable something at ring?
Peter
Did you do the suggested plugin.py section within the directory?
Are you trying to run it and write an error there? One important thing was left out of the forum here. When you use the app, one hits the other. Invite yourself to another emal address, set up the info in the (cloned?) App, log in and use the python plugin
I've used the script which is on the post and created that as ring.py. I've changed the username and password and created the token.
That all went well. I can connect to the api and when the doorbell is pressed the Domoticz gets updated but the picture is not downloaded and the script ends with the error if Method not allowed.
I've now created an extra account for domoticz on my ring and the extra account is invited to my doorbell. I can see the doorbell when i login to the webpage. But when i run the script now i get this error:
pi@raspberrypi3:~/ring $ python3 ring4.py
Traceback (most recent call last):
File "ring4.py", line 52, in <module>
doorbell = doorbells[0]
IndexError: list index out of range
RaspberryPI
ZWave
RFXtrx433E
ZWave
RFXtrx433E
-
- Posts: 34
- Joined: Friday 02 February 2018 16:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Ring 2 Doorbell
I had some time to deal with it, but I didn’t have much success either.
If I am logged in on the phone, it doesn't matter if I try plugin.py with the shared or original user, if I start the phone application, the python will die.
Unfortunately, this is not really usable this way, My knowledge here is limited. We hope you buy some professional such bell and write the domoticz plugin. The api is available at: https://python-ring-doorbell.readthedocs.io/
PeterFleur: did you have?
If I am logged in on the phone, it doesn't matter if I try plugin.py with the shared or original user, if I start the phone application, the python will die.
Code: Select all
pi@raspberrypi:~ $ sudo service ring status
● ring.service - My Script Service
Loaded: loaded (/lib/systemd/system/ring.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2020-11-11 08:35:23 CET; 3min 16s ago
Process: 8263 ExecStart=/usr/bin/python /home/pi/domoticz/scripts/ring/python-ring-doorbell/plugin.py (code=exited, status=1/FAILURE)
Main PID: 8263 (code=exited, status=1/FAILURE)
Nov 11 08:35:22 raspberrypi python[8263]: self._ring.query(url)
Nov 11 08:35:22 raspberrypi python[8263]: File "/home/pi/domoticz/scripts/ring/python-ring-doorbell/ring_doorbell/__init__.py", line 101, in query
Nov 11 08:35:22 raspberrypi python[8263]: timeout=timeout,
Nov 11 08:35:22 raspberrypi python[8263]: File "/home/pi/domoticz/scripts/ring/python-ring-doorbell/ring_doorbell/auth.py", line 89, in query
Nov 11 08:35:22 raspberrypi python[8263]: req.raise_for_status()
Nov 11 08:35:22 raspberrypi python[8263]: File "/usr/local/lib/python3.7/dist-packages/requests/models.py", line 940, in raise_for_status
Nov 11 08:35:22 raspberrypi python[8263]: raise HTTPError(http_error_msg, response=self)
Nov 11 08:35:22 raspberrypi python[8263]: requests.exceptions.HTTPError: 405 Client Error: Method Not Allowed for url: https://api.ring.com/clients_api/snapshots/timestamps?
Nov 11 08:35:23 raspberrypi systemd[1]: ring.service: Main process exited, code=exited, status=1/FAILURE
Nov 11 08:35:23 raspberrypi systemd[1]: ring.service: Failed with result 'exit-code'.
PeterFleur: did you have?
Code: Select all
pip install \
git+https://github.com/tchellomello/python-ring-doorbell@dev
-
- Posts: 32
- Joined: Sunday 08 March 2015 13:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2.4739
- Contact:
Re: Ring 2 Doorbell
Yes I tried that one. And it works for switching. The only thing that doesn't work is downloading the picture.
Peter
Peter
RaspberryPI
ZWave
RFXtrx433E
ZWave
RFXtrx433E
- Egregius
- Posts: 2589
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Ring 2 Doorbell
Anyone any luck with the snapshot?
The python script works for alerts of motions and dings but would also like to send a snapshot.
Have the feeling that the Ring notifications don't always work, or they arrive a lot later.
The python script works for alerts of motions and dings but would also like to send a snapshot.
Have the feeling that the Ring notifications don't always work, or they arrive a lot later.
-
- Posts: 32
- Joined: Sunday 08 March 2015 13:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2.4739
- Contact:
- Egregius
- Posts: 2589
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Ring 2 Doorbell
This code give me snapshots. But they are all the same. They aren't updated, every time I receive the last snapshot created by the snapshot capture setting of the app (5 min, 14 min, 1 hour).
When the snapshot is updated the script stops with a 404 not found error.
So, I don't know if it's even possible to trigger a new snapshot and download it. Without that the get_snapshot function is quite useless.
Could be that you need to adjust doorbot.py according to this: https://github.com/tchellomello/python- ... issues/214
When the snapshot is updated the script stops with a 404 not found error.
So, I don't know if it's even possible to trigger a new snapshot and download it. Without that the get_snapshot function is quite useless.
Code: Select all
#!/usr/bin/env python3
from ring_doorbell import Ring, Auth
import time
import subprocess
from time import sleep
from oauthlib.oauth2 import MissingTokenError
from pathlib import Path
import urllib.request as urllib2
import json
import logging
import urllib.parse
username='[email protected]'
password='nBp2GdGz7j2x4P3j6iN4QJVvBAk3PdmRTAeMgYTx7MDkV7VcpD9W8pBvWNS3rB6pKo9vvYRYrAbK5fnsq6zWxZ79wB9rPUcXmKTU$'
cache_file = Path('/sql/ring.token.cache')
logger = logging.getLogger('ring')
hdlr = logging.FileHandler('/var/log/ring.log')
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
logger.setLevel(logging.INFO)
logger.info('started')
def token_updated(token):
f=open('/sql/ring.token.cache', "w")
f.write(json.dumps(token))
f.close()
logger.info('Token updated')
def otp_callback():
auth_code = ''
return auth_code
def send_image(botToken, imageFile, chat_id):
command = 'curl -s -X POST https://api.telegram.org/bot' + botToken + '/sendPhoto -F chat_id=' + chat_id + " -F photo=@" + imageFile
subprocess.call(command.split(' '))
return
if cache_file.is_file():
f=open('/sql/ring.token.cache', "r")
auth = Auth("Pass2PHPDoorbell/1.0", json.loads(f.read()), token_updated)
f.close()
else:
auth = Auth("Pass2PHPDoorbell/1.0", None, token_updated)
try:
auth.fetch_token(username, password)
except MissingTokenError:
auth.fetch_token(username, password, otp_callback())
ring = Ring(auth)
ring.update_data()
devices = ring.devices()
doorbells = devices['doorbots']
doorbell = doorbells[0]
doorbell.update_health_data()
deviceid = doorbell.device_id
logger.info('Battery = ' + str(doorbell.battery_life))
def httprequest (url):
request = urllib2.Request(url)
response = urllib2.urlopen(request)
return response.read()
while True:
snapshot = doorbell.get_snapshot()
if snapshot:
print("Updating snapshot...")
timestr = time.strftime("%Y%m%d-%H%M%S")
photoname = '/ringsnaps/snap' + timestr + '.jpg'
open(photoname, "wb").write(snapshot)
send_image('123592115:AAEZ-xCRh4-RhfUqICiJs8z9A_3YIr9irxI', photoname, '45975743')
sleep(10)
-
- Posts: 32
- Joined: Sunday 08 March 2015 13:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2.4739
- Contact:
Re: Ring 2 Doorbell
Hnn and i keep getting this error: requests.exceptions.HTTPError: 405 Client Error: Method Not Allowed for url: https://api.ring.com/clients_api/snapsh ... i_version=
Even with your script
Peter
Even with your script
Peter
RaspberryPI
ZWave
RFXtrx433E
ZWave
RFXtrx433E
- Egregius
- Posts: 2589
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Ring 2 Doorbell
Did you try latest development release of ring-doorbell and check doorbot.py for the changes provided in the link?
I tried so many things that I can't exactly say what made it work.
I tried so many things that I can't exactly say what made it work.
Who is online
Users browsing this forum: No registered users and 0 guests