Ring Doorbell

Looking nice! I look forward to integrating this. Would be nice if I could have my media paused automatically whenever someone rings the bell :slight_smile:

I think once the doorbell pushed binary sensor gets added, this should be easy to do with an automation.

@tchellomello Looking good so far, man! Kind of looking forward to taking my Ring out of Wink and being able to use it in HA natively!!

Just found this thread and pretty excited to see this feature. Will it be integrated with HA at one point or will we have to do the manual install? Pausing media players is a great idea, I am also thinking of turning on the porch light on after hours and possibly turning on a few lights in the house if it’s in the middle of the night. Any other ideas?

1 Like

The idea is to do a PR and integrate into HA directly as a new component once testing is done. If you look at the thread from the beginning, you can get an idea of how to install and test the library and that info will help @tchellomello get a better sample of installations.

Hello guys, I think we have the first beta version for the Ring sensor.

Please note that I’m having some difficulties to get a more responsive notification for live motion. What happens is that on Ring, when the motion is detected the notification is published. Since we are pulling the data asynchronously the notification will be only received the if the request happens at the same time or if the message is still available.

On my tests, I got 3 out 10 attempts where sensor notified me. To address it, we will need to keep a socket open all the times and I’ll have to check with the others developers what is the best way to do it in HA.

Note also that for now, the motion_sensor is not a binary sensor, but a regular sensor which returns True/False too. If we decide, we can port it to binary_sensor as well.

Having said this you can download the beta sensor at https://raw.githubusercontent.com/tchellomello/home-assistant/ring/homeassistant/components/sensor/ring.py

Then all you have to do is on your HA root configuration directory, in my case: /home/homeassistant/.homeassistant

$ cd /home/homeassistant/.homeassistant
$ mkdir -p custom_components/sensor
$ wget https://raw.githubusercontent.com/tchellomello/home-assistant/ring/homeassistant/components/sensor/ring.py \
 -O custom_components/sensor/ring.py

Then entry the configuration under your sensors category:

  - platform: ring
    username: [email protected]
    password: secret
      - battery
      - last_activity
      - motion
      - volume

Test the configuration by running:

$ hass --script check_config

The ring_doorbell [1] python module should be downloaded and installed by HA at deps directory as the other regular services.

Restart your HA service and please share your opinion about it. Any suggestions or bug reports are welcome.

I’m looking forward to hearing from you about it.

Thank you!

[1] - https://pypi.python.org/pypi/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.


@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
    - 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