Ring Doorbell

It appears as if the ‘Last Activity’ shows for each doorbell on my account.

Example - One Doorbell had motion at 8:12, the other at 3:44 but both show last activity as 20:12

Looks nice. Haven’t been able to test it out more thoroughly but I did see that the last activity timestamp seems to be a bit odd: “16:3 motion”. According to my Ring app the last motion was at 16:03 so it’s missing the leading zero.

Hello guys,

Thanks for the feedback.

@syphernl I’ll get it fixed. It is just the way the datetime field is being formatted. Thank you!

@kylerw ooh… good catch!! yes, this activity function is not taking in consideration the doorbell but all the events. I’ll get it fixed. Nice that you have 2 cameras on your account will help us to test difference scenarios.

Regarding the battery status, did it match with your all if compared with the APP?

I’ll keep you in the loop as soon as I update it to address these issues.

Thanks!

@syphernl @kylerw guys, I’ve updated the code to address the issues mentioned. Please just override the ring.py under components/sensor/ directory and restart HA.

Home assistant should upgrade automatically to ring_doorbell==0.0.4 automatically.

The new HA sensor code is available at https://raw.githubusercontent.com/tchellomello/home-assistant/ring/homeassistant/components/sensor/ring.py

Please let me know!! Thank you!!

Does this support !secret?

Yes, it does! This is what I have:

# sensors
- platform: ring
  username: !secret ring_username
  password: !secret ring_password
  monitored_conditions:
    - battery
    - last_activity
    - motion
    - volume

@tchellomello TImestamps look fine now, thanks to the parcel delivery guy to test it out while I was at work :stuck_out_tongue:

Frontdoor Last Activity
37 minutes ago
10:00 ding
1 Like

What about using a local IFTTT to keep it more secure and avoid latency :
Trigger Happy - local IFTTT

Have a nice day :wink:

Awesome. I had an error when I first set it up and I thought it was secrets but I think it was formatting.

Everything working well here and I like the choice of icons. Display looks nice and states are responding correctly.

So will this include a binary_sensor for the button press? I still have Ring in Wink and when @w1ll1am23 refactored, I got two binary sensors; one for the button press and one for motion. I’m just wondering if I should activate entity_namespace for your Ring support so I can tell the difference between the two when testing.

I kind of liked the idea of a binary for the button press so I could use it in automations.

@rpitera we can create the binary sensor without any problems. Like displayed by @syphernl, the last activity showed 10:00 ding which means the doorbell button was pressed, otherwise it would show motion. If you feel what is better to have a dedicated sensor for motion and ding (when a button is pressed) we can do it.

Regarding the name, we could create something like sensor_name_prefix or suffix that will allow the user to determine the name or you can override it but setting the friendly_name. Since we are self discovering and loading all the devices linked on your ring account, having the parameter name: will not work.

I definitely like the binary_sensor idea because it could be easily used as a trigger for just the doorbell press.

Just to clarify, since you used name: and I was talking about entity_name: are you saying that entity_name: wouldn’t work?

I ask because I am currently also testing the plexdevices component, which also dynamically discovers devices and it’s working fine there. I just think if we could use an existing construct like entity_name: which is already part of HA, it might be a better solution.

A binary sensor; yes please. Unless the current implemention already supports to distinguish between motion and ding and can be used to trigger automations.

1 Like

Hello @rpitera, I’m sorry I did not understand your point before.

Yes it would work with entity_name. I’ll modify it tonight and let you know.

I’m glad I clarified my response - I just think that supporting entity_name is a cleaner solution to a problem that few may have and in my case will be temporary. I just want to be able to differentiate between the Ring and the Wink instances while testing.

See, my intent is that once this is all working, I want to remove this from my Wink setup. Right now, I have two binary sensors with Wink; one for doorbell press and one for motion trigger. I’ll lose both of those if I remove it from Wink. Motion isn’t as important to me but it might be something to consider for those that use it. It would just be easier to trigger automations from a binary sensor dedicated to task, in my opinion.

1 Like

@syphernl technically we could look at the attribute[‘kind’] to determine if it was a motion or ding, but let’s create the binary sensors too.

Through a binary_sensor it will be easier for automation for sure.

I’ll work on this tonight.

1 Like

@tchellomello our discussion the other day led me to look into the Ring doorbells and came across this thread. Nice work, once again! How is everyone liking their Ring Doorbells? I’m now considering a Pro, and any feedback is appreciated.

I like mine, but I think I’ll like it more with this component. I had it running through Wink and their implementation wasn’t the best.

Not sure if this has been reported, but:

17-02-16 09:52:36 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "uvloop/future.pyx", line 372, in uvloop.loop.BaseTask._fast_step (uvloop/loop.c:112669)
  File "/usr/src/app/homeassistant/helpers/entity_component.py", line 387, in _update_entity_states
    yield from update_coro
  File "/usr/src/app/homeassistant/helpers/entity.py", line 222, in async_update_ha_state
    device_attr = self.device_state_attributes
  File "/config/custom_components/sensor/ring.py", line 137, in device_state_attributes
    attrs['firmware'] = self._data['firmware_version']
TypeError: list indices must be integers or slices, not str
17-02-16 10:25:38 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "uvloop/future.pyx", line 372, in uvloop.loop.BaseTask._fast_step (uvloop/loop.c:112669)
  File "/usr/src/app/homeassistant/helpers/entity_component.py", line 387, in _update_entity_states
    yield from update_coro
  File "/usr/src/app/homeassistant/helpers/entity.py", line 222, in async_update_ha_state
    device_attr = self.device_state_attributes
  File "/config/custom_components/sensor/ring.py", line 137, in device_state_attributes
    attrs['firmware'] = self._data['firmware_version']
TypeError: list indices must be integers or slices, not str

@rpitera you can check out the new version where we are making use of entity_namespace now.

Just replace the file and restart HASS.

https://raw.githubusercontent.com/tchellomello/home-assistant/ring/homeassistant/components/sensor/ring.py

Hello @kylerw interesting…

Could you please the line below on your ring.py and try to restart it again to see what is happening?

@@ -137,6 +137,7 @@ class RingSensor(Entity):
                 attrs['recording_status'] = self._data['recording']['status']
                 attrs['kind'] = self._data['kind']
             else:
+                _LOGGER.info("sensor_type: %s  data: %s", self._sensor_type, self._data)
                 attrs['firmware'] = self._data['firmware_version']
                 attrs['device_id'] = self._data['device_id']
                 attrs['timezone'] = self._data['time_zone']

If you prefer, you can download the file directly from https://gist.github.com/tchellomello/e803c13c7fafd5cd8a4b83cbd5c7869b.

Thank you!