Control your Ring Spotlight with Alexa with Smart Things

Just a quick post, but I’ve managed to get my Ring Spotlight cam light operated by my Alexa using a Custom Device type in my SmartThings hub.

 

UPDATED: June 2018, fixed authentication API changes in the github code repo, and the postman collection has the new call too.

Here is a copy of my device handler:

https://github.com/philgituser/smartthings/blob/master/devicetypes/philgituser/ring-spotlight.src/ring-spotlight.groovy

If you’ve not created a custom device type, it’s not too hard, but I recommend you start here?

https://community.smartthings.com/t/smartapp-devicetype-from-code-and-from-template/11255

There are three things you need to get it working:

  1. Your Ring.com Username
  2. Your Ring.com Password
  3. The Device ID

The device ID is the hardest part, it needs to be sourced by an API call to:
https://api.ring.com/clients_api/ring_devices?api_version=9&auth_token=auth_token

Here is a POSTMAN collection for calling this.

Updated June 6th 2018, to support the new authentication model.

Attachment

RING API Set.postman_collection.json

 

Set your environment variables to include your username and password:

Call the “Authenticate OAuth”, Then call the “Authenticate (Get Token)” and then Get Devices:
Screen Shot 2018-06-06 at 3.05.42 pm

 

 

And extract the Device ID of the relevant device.
This will then go into the device setup in smartthings:

Once you have the device working in Smartthings, it should just be a matter of adding the device to the Alexa available devices through rediscovery.

And then you can say “Alexa, Turn the Backyard Spotlight On”.

I’ll let you add the siren as a bit of fun. It’s not hard to extrapolate based on the Postman collection example.

 

28 thoughts on “Control your Ring Spotlight with Alexa with Smart Things

  1. Thanks for the instructions and building it to make it happen! One thing though that I was wondering it could do is interface with the motion detection? So then when motion is detected, in smartthings it would then be configured to turn lights on at 100% for 5 minutes, then return back to the normal percentage of 20%???? Thanks!

    Like

    1. The motion detection portion is a bit harder to do. I’m not sure if we can/should set up the smartthings to poll the ring api looking for motion… I also have played with the brightness settings for the light – I didn’t have a spotlight cam – but rather a floodlight cam that did brightness at the time I was developing.

      Like

  2. I am interested in the steps you took to get the device id. Pasting the device handler from code was simple enough but running (or whatever is suppose to be done with it) the postman.json has left me scratching my head. Any instructions on how to go about getting this would be greatly appreciated. Thank you

    Like

  3. How do you get Smartthings to recognise your spotlight cam? It is not discovered by the app and the ring connected app won’t show it as it’s not supported. Thanks!

    Like

  4. Thanks for this info! I had a little trouble figuring out how to add the Ring Spotlight and Stickup cams as a new device, but found the “Virtual Device Creator” SmartApp, then changed the device type to use the new Device Handler in the developer portal. Seems to work great now, would love to get dimming working. Thanks again!

    Like

  5. The postman collection is giving an authentication error whereas it worked previously. Does it need to be adjusted after the authentication changes at Ring. I cannot get a new device id.

    Like

  6. Hi Philip,
    I completed all your steps and created the device w/ the device ID sourced from the API call, but when I try to turn on the light from the smartthings app nothing happens. Can you give me any troubleshooting advice? (Also, sending the PUT (Turn Light On/Turn Light Off) does not do anything. Thanks much for putting this together!

    Like

  7. When I try to run the “Get Token” in POSTMAN, I get
    “error”: “You need to sign in or sign up before continuing.”

    The first part returns an access token just fine

    Like

  8. Hi Phillip,

    thanks for all your hard work on this. I was wondering if you could help me with getting it working. I have added retrieved the device ID using your JSON script and added your device handler code into a customer device handles.

    When I try adding a device on the smartthings website, it will add it using your handler with no problem. I set the device preferences for the ring username, ring password, and device id in the device settings on the smartthings site and saved it.

    when I try to utilize the device on the smartthings app, it gives me an error saying “can’t connect to device . check device and try again” I assure you the device is on.

    For some reason, I can’t get it to show me any debugging, for this device, on the live logging section of the smartthing site.

    any advice?

    thank you,
    Peter

    Like

  9. nevermind sir….i followed vswitch’s comment and used a virtual device creator smartapp. that worked!

    Like

  10. Hi Philip
    I have managed to add the device and the on/off light works perfectly.
    can you please help me to add the on/off siren as I want to use this to work with my arm and disarm feature of the smartthing.
    Your help will be greatly appreciated

    Like

    1. I haven’t had time to get to this, but if you were feeling adventurous, you could make another device, and just change the API requests in the device handler to call the siren endpoint. I have an example of it in the postman collection.

      Like

  11. Thanks for making this! This doesn’t allow you to bring the motion detector online right? I would like to use webcore so that if it detects motion during certain days/times it turns on other lights as well as the floodlight. thanks!

    Like

  12. Thanks, Philip for the hint. I managed to get a device handler done for the siren. Please advise how I can load it here so others can benefit from it.

    Like

  13. Hello Philip

    On Postman
    When i call the “Authenticate OAuth”, Then call the “Authenticate (Get Token)” and then Get Devices:, i have a 401 error (unauthorized) but aut_token seems ok
    any idea?

    Like

  14. I’ve got 3 ring wired devices. 2 Ring Spotlight Camera wired, and 1 Ring Floodlight camera. I can find the Device Network ID in the SmartThings IDE. Is this the device ID your DTH is looking for? And if so, do I need to confiugre a unique DTH for each device and how?

    I also have a Ring Video doorbell 2 I would like to pull video into smartthings with…

    For my application, I want to insure none of the ring app function is minimized, and be able to access both light, and siren functions of the ring spot / flood light devices, as well as pull in video from all of the ring devices… I can live without the video feed, but it would be nice to have…

    Any clarification would be greatly appreciated!

    Like

  15. Hello Philip,

    Any way of adding the 2 factor authentication requirements. After changing to 2 factor authentication I can no longer enable the siren.

    Like

  16. Has anyone tried using this lately? Using your postman collection i was able to successfully send the auth requests for a token, but each subsequent PUT or GET requests fail with a 401 “unauthorized” response. I previously had 2 factor auth enabled, but disabled it and I still have the same issue.

    Like

  17. Thanks so much for this. After getting all setup in Postman. I can successfully authenticate with Oauth – the first call. The second call always fails and says: “There was an error in evaluating the test script: TypeError: Cannot read property ‘authentication_token’ of undefined”.

    I have disabled two factor on my Ring account to try to rule that out. I would very much appreciate some guidance from one of you gurus! Thanks

    Like

Comments are closed.

Website Built with WordPress.com.

Up ↑