Ring Doorbell

@broesie Thanks. Currently the last_activity sensor has an attribute called ‘created_at’ which will give you the current time and date. These are the attributes from my last_activity sensor:

{
  "firmware": "<REDACTED>",
  "kind": "lpd_v1",
  "timezone": "America/New_York",
  "attribution": "Data provided by Ring.com",
  "created_at": "2017-03-12T17:30:55-04:00",
  "device_id": "<REDACTED>",
  "recording_status": "ready",
  "answered": false,
  "icon": "mdi:history",
  "type": "doorbots",
  "category": "motion",
  "friendly_name": "Front Door Last Activity"
}

If the create_at attribute is not sufficient for you, I can extend it to have activity_time and activite_date as well. Let me know.

mmello

1 Like

@rdnzl yes, that is a good idea. The underlying library already support to get the video URL for you (see https://github.com/tchellomello/python-ring-doorbell/blob/dev/ring_doorbell/init.py#L553-L559)

I think we can do it by extending an UI card since this functionality would not fit under the sensor category in HA (at least for now).

2 Likes

Dumb question. I jumped in this early and since upgraded to HA 0.40.0 which has ring incorporated. Am I using the Ring version from Github still and if so how do I remove it.

Better version of the same question.

Where is Ring installed in 0.40.0 and where was it installed manually before? Do I just remove the ring_doorbell directory in /deps?

I can’t get the binary sensors installed as noted in previous posts.

Let me add a little more here. I’m all fouled up with ring now. I installed the new sensor and binary sensor in custom components and now getting the following:

17-03-13 10:26:01 ERROR (MainThread) [homeassistant.config] Invalid config for [sensor.ring]: value is not allowed @ data['monitored_conditions'][2]. Got 'motion'. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.ring/

I deleted the previous ring.py which seems to be where the problem started. Ultimate goal is to get ring as a binary sensor. And also pretty sure I have a previous version installed in deps but now scared to delete it too.

Ok sorry to be a pain. No real idea what I did but I have it working now!

Yes, I know, but then we have to split the data. So, it would be great to see some several seperated sensors.
And if it’s not too much asked, I would be great to have control how it’s written, in some countries it is yyyy-mm-dd, in other countries it is dd-mm-yyyy… That would be also a nice option… anyway, keep up the good work! :slight_smile:

@tchellomello I’m seeing a lot of these warnings in my log:

17-03-14 20:41:12 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating ring binary_sensor took longer than the scheduled update interval 0:00:05
17-03-14 20:42:12 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating ring binary_sensor took longer than the scheduled update interval 0:00:05
17-03-14 20:42:18 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating ring binary_sensor took longer than the scheduled update interval 0:00:05
17-03-14 20:50:27 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating ring binary_sensor took longer than the scheduled update interval 0:00:05
17-03-14 20:50:50 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating ring binary_sensor took longer than the scheduled update interval 0:00:05
17-03-14 20:51:52 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating ring binary_sensor took longer than the scheduled update interval 0:00:05
17-03-14 20:53:51 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating ring binary_sensor took longer than the scheduled update interval 0:00:05
17-03-14 20:57:07 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating ring binary_sensor took longer than the scheduled update interval 0:00:05

This is just a small portion, it seems to be ongoing still.

1 Like

@syphernl interesting… how about to change the frequency to 15 seconds to see if the messages goes away. I think this is happening because we are calling the sensor every 5 seconds.

It went away after restarting HA, seems to be working fine afterwards. It happened right after someone rang the doorbell, but the binary sensor didn’t pickup on that since no automations were triggered.

I just bought a ring and second thing I did was add this component, so first off, a big thank you for your hard work on this!

Now for a few questions:

1 - Since 0.40.0 is the first time I’ve loaded this component, I noticed some strange behaviour. I am unable to restart Home Assistant by using the call service. I get this error:
03-16 07:05:25 ERROR (MainThread) [homeassistant.loader] Error loading homeassistant.components.sensor.ring. Make sure all dependencies are installed

However, if I shut down HA from the command line, it does restart normally and Ring does show up with the 3 sensors.

2- Is the binary_sensor available in 0.40 or do I have to install the latest custom component?

3- Any plans to have a camera component for Ring?

Thanks!

Hello @Jer78. Glad that you liked t.

  1. Yes, that is expected. You need to restart to get the deps installed.

  2. The binary_sensor is not available in 0.40. I did not put the PR in time so when approved, it should be on 0.41. You can follow-up the PR at https://github.com/home-assistant/home-assistant/pull/6520

  3. Yes, I want to add that but we still need to see what would be the best way to implement that.

Thanks @tchellomello. I was thinking the camera image could be useful for the Microsoft face detect/identity components. Setting scenes or custom events when recognizing faces. Would love to give those components a try with Ring!

1 Like

Be advised that if you don’t have a hardwired Ring, simply activating LiveView (not even USING it, just activating it) even in battery saver mode is going to take a chunk out of your battery life.

I charged mine to full a week or so ago and I am already down to 77% today.

Wow! That really kills the battery. I have the hardwired Ring Pro, but I guess the same principle would be for the stick-up cams since they are battery powered.

I’m not sure about that; I would think that they have a better method for cameras as they are designed for live view.

Some more issues with the binary sensors:

17-03-19 20:01:53 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while update entity from ring in binary_sensor
Traceback (most recent call last):
  File "/srv/hass/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 428, in _update_entity_states
    yield from update_coro
  File "/srv/hass/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 207, in async_update_ha_state
    yield from self.hass.loop.run_in_executor(None, self.update)
  File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/hass/.homeassistant/custom_components/binary_sensor/ring.py", line 129, in update
    self._data.check_alerts(cache=self._cache)
  File "/home/hass/.homeassistant/deps/ring_doorbell/__init__.py", line 375, in check_alerts
    resp = self._ring.query(url)[0]
TypeError: 'NoneType' object is not subscriptable

Thanks @syphernl

This will be fixed once merged to the HA dev branch. Thanks for reporting it.
mmello

It looks like the Binary sensor may cause some issues with accounts. Over the past week I had to re-login to the Ring app on my phone which never happened before I started using the component.

In order to work around that I have created a sub-account with access to the Ring but unfortunately after configuring this in HA the Ring component disappears from the webinterface even though it is possible to use the Python library with these credentials.

1 Like

The reason the Python library works is because it has recently been updated to fix showing devices from “shared accounts”, the HA component hasn’t been updated yet though. :cat:

I noticed the same thing. Also got a doorbell ring that never registered.