Ring Floodlight Cam - Turn Floodlight on and off

I did just prove that copying each ring.py file from the various component directories, renaming them to <component_name>.py and putting them in custom_components/ring along with the file above (name light.py) does work just fine. To make this easier, here’s a zip file that contains the .89 version of the ring components with the light.py component added. Just unzip this into custom_components and you should be good to go.

I’ve been seriously considering adding Ring light/siren control to my Ring Alarm MQTT component because it would be nice to support automations to flash lights/enable siren during alarm events and it would eliminate my dependency on this custom component. If anyone else thinks that would be useful let me know and maybe I’ll bump up the priority on that effort.

4 Likes

@tsightler Thanks for that - working again! I guess because I had the ring integration going (without the files in the custom_components dir) that’s what gave me the error. Thanks again.

@tsightler - would that allow using non-Ring motion and door sensors to trigger Ring alarms via automations? Or at least the siren? I would be very interested in that.

It would allow for triggering of the siren on Ring cameras that have this capability (I believe stickup, spotlight and floodlight cams all have them). This part should be pretty easy.

It might be possible to trigger the “test siren” capability on the alarm base station, just like you can do from the app, but it would not generate an actual alarm event. I would definitely need to do some digging to figure this out as I’d have to determine the commands the app sends to do this.

I don’t believe I could trigger an actual alarm as it appears to me that alarms can only be trigger by “trusted” Z-wave devices locally. This makes sense as the alarm needs to be able to be triggered even in the absence of connectivity to Ring.

Even here you could get creative as it would be pretty easy to take an existing Ring contact sensor and rig it up so that some automation triggers the open/close event, either via mechanical or electronic means, but that’s beyond simple coding.

@tsightler, thanks for the .zip. You are fantastic.

I have two quick questions that I was curious whether you might have answers/tips for:

  1. I couldn’t seem to find a comparable, existing /custom_components/ folder to unzip your files into via my Hassio on R-Pi installation. Any idea per if that’s a hidden folder and/or a folder I can just create somewhere within the folder path of my Hassio installation?

  2. Once I get my Ring Floodlight’s established as a controllable light in HA, do you have any knowledge of or experience with whether HA’s HomeKit: component will allow HA to expose that light control to HomeKit?

Based on the conversation on this thread so far, I’m inferring that you don’t use Hassio for HA and also guessing you may not use HomeKit / Apple’s Home.app either… but I figured it could hurt to ask you and others on the thread if they had any insights/tips.

Thanks again!!

I don’t use hassio but I have played with it a little in an attempt to understand it better. I believe there should be a /config directory and that you have to create custom_components directory in there.

Regarding HomeKit, I don’t use it, but I know a little bit about it just due to the fact that I played a good bit with HomeBridge just learning about the protocol. I believe that the HA component should allow HA to expose the light as it’s just a light entity, there’s nothing special about it.

Good luck!

@tsightler, thanks so much!

I’m actually playing with this now and have all 5 files from your .zip added to config/custom_components/ring/

But when I go to validate configuration.yaml, I get this error:

(I also tried uploading the 5 files to config/custom_components/light/ just to make sure I’m not going nuts.)

In configuration.yaml I have:

ring:
 username: ***********************
 password: ***********************

# Add Ring Doorbell Pro + Floodlight cameras into HASS (works with ffmpeg: and ring: above)
camera:
  - platform: ring
  
 # Add Ring Floodlight into Hass (uses ring: above + files in config/custom_components/ring)
light:
  - platform: ring

# Returns a boolean value for things like when a device sees motion or a doorbell is rung
binary_sensor:
  - platform: ring 

camera: and binary_sensor: were already previously working before I added the files to config/custom_components/, as they’re both part of Hassio’s “built-in” ring: component.

I’m running HA 0.90.2.

Any tips?

Thanks again for the help!

Did you restart Home Assistant between adding the files to custom_components and adding the lines to your configuration? If not, Home Assistant hasn’t loaded the custom component files which is why the config check can’t find them.

One thing to keep in mind is that by overriding all of the ring files you’re not getting any upstream changes to the ring component. This may be good or bad. If upstream ring changes cause the ring light component to break then it might be better to override everything. However, if upstream ring changes are implemented due to changes in ring API, etc., not getting these updates could cause everything with ring to break. I personally just put the light.py in config/custom_components/ring_light and in my configuration.yaml I have platform: ring_light.

@claytonjn, thanks so much for gifting some of your time and knowledge to my issue here!

I definitely restarted (ended up doing so a few times) after adding the 5 files (including light.py) to config/custom_components/ring/

However, before the initial restart, I had removed (i.e., commented out) light: - platform: ring in configuration.yaml after not being able to validate configuration.yaml for fear that I might not be able to get back into HA after a restart with the unvalidated configuration.yaml.

Do you think that was a mistake? Could/should I have safely restarted HA with the unvalidated light: - platform: ring in configuration.yaml?

Either way, it may be worth mentioning that after the first restart following the add of the 5 files (including light.py) to config/custom_components/ring/, I definitely had light: - platform: ring added back into configuration.yaml and tried to validate again (and it failed to validate again telling me “Platform not found: light.ring”).

That said, I can’t remember if any of my restarts thereafter did or didn’t have light: - platform: ring included in configuration.yaml at the time of reboot—I just know that there was no success after each restart, and at one point, my Configurator stopped loading + I lost my other light integrations (Tuya).

By then it was 1am, so I restored a previous snapshot and called it a night.

I was semi-aware of the implications in Hassio per overriding the built-in Ring: component with all 5 of the files (including light.py) added to config/custom_components/ring/. In on eof my attempts, I had also tried deleting all but light.py from config/custom_components/ring/ with a restart and no luck. But your notes above help add clarity and confirmation for me on that front.

I LOVE the suggestion of putting light.py in config/custom_components/ring_light and then trying for:
light:
- platform: ring_light

Before I try that, though, I am hoping you can confirm that it should be safe for me to add both light.py to config/custom_components/ring_light and light: - platform: ring in configuration.yaml at the same time and restart HA (even with the expected configuration.yaml throwing validation errors)?

Or would it be better practice for me to:

  1. Add light.pytoconfig/custom_components/ring_light` then restart

  2. light: - platform: ring_light in configuration.yaml then validate then restart (even if configuration.yaml won’t validate)

Thanks SO MUCH for your help!!

I wouldn’t ever advise ignoring the validation errors, it would always be best to use the two-step method you outlined. Keep in mind, however, that the platform folder and and the configuration need to match. So if you put light.py in config/custom_components/ring_light as you said in step on, then in step 2 you need

light:
  - platform: ring_light

Yep. Totally per the need to match platform: *NAME* to config/custom_components/*NAME*/ folder.

I had typo’d platform: ring (instead of typing platform: ring_light) above accidentally. (Edited that typo above in case future folks reference this thread for the same issue—don’t want to confuse them.)

Immah gonna give 'er a try when I get home from work tonight… FINGERS CROSSED

Thank you so much for your help, @claytonjn. You are AWESOME.

I worked this time around!

Thanks so much for the assist, @claytonjn & @tsightler.

I’m gonna go out on a limb and ask one more question: does anyone know of a way to add controls directly in HA for being able to trigger the Ring Floodlight alarm?

I don’t have a formal alarm system, like Ring Alarm, but am setting up Aqara door sensors and would love to add an automation for when they’re armed and breached that triggers my Ring Floodlight alarm to sound off.

Thanks again for ll the help!

Glad you got it working.

Regarding your query to trigger the floodlight alarm via HA, this is exactly why I’ve been considering adding support for cameras to my ring-alarm-mqtt project (or a separate ring-mqtt project) as I want to be able to automate sounding the camera alarm sound via home assistant. I just haven’t had the time to work on it.

1 Like

2 Day old Home Assistant user here. I got Hassio 0.92.1 installed and up and running.
Can anyone do a step by step for getting the Light control for the Ring Floodlight working?
I downloaded the zip file from “https://drive.google.com/open?id=1XT1uMk3zgRePIPXis-NntjDx_OKNapXb” and placed them in custom_components\ring

Here is my config setup

Ring Component

ring:
username: !secret ring_username
password: !secret ring_password

camera:

  • platform: ring

binary_sensor:

  • platform: ring

When I put in the
light:

  • platform:ring
    in the config I get the config invalid error.

is this feature not working on the latest version of hassio 0.92.1?

There’s a couple issues at play here that might be causing your problem. It would help if you post the exact config invalid error.

Custom components can no longer “extend” official components - they either need to completely replace the official component, or they need to use a different domain. Some users here have chosen to completely replace the official ring component (which is what the zip you linked to would do). I prefer to merely change the domain for reasons outlined here. So for me, I just have the one light.py file, and I have it placed in custom_components\ring_light. This also means that I have - platform: ring_light in my configuration.

In addition to that, there used to be “platforms” and “components”, but now everything has been reclassified as an “integration”. The only real impact of this change is that, in addition to the light.py file I also created an empty __init__.py file in custom_components\ring_light. Some people have been reporting that they need to also have a manifest.json for every custom component, but in my setup with 0.92.0 and 0.92.1 that hasn’t been the case - not sure why it seems to be required in some setups and not others…

If you prefer to override the official component then hopefully someone else here can chime in to help you, either way, posting the configuration error would be the best first step.

@claytonjn

Thank you for the feedback. I simply want the ability to turn on and off the lights. I loved the Stringify app but, with its shutdown coming, here I am trying to get Home assistant to work now.

I have removed all the references to the rest of the platforms and have added only the light options in the config file. I have also removed all the other files and have placed only light.py and and empty init.py file in the “custom_components\ring_light” folder.

Here is the config file now

Ring Component

ring:
username: !secret ring_username
password: !secret ring_password

light:

  • platform: ring_light

This is the error I get.

Configuration invalid

Integration ring_light not found when trying to verify its light platform.

Did you reboot after putting the light.py and __init__.py file into custom_components\ring_light? You probably just need to comment out/remove the platform: ring_light section of your configuration, reboot with the files in custom_components\ring_light, then uncomment/add the platform: ring_light back to your configuration, check the configuration then, and it should not error at which point you can reboot again.

Basically, when you add python files to the custom_components section they don’t just get immediately loaded, so if you try to add the component to configuration before rebooting HA will think the files aren’t there. It’s safest to add a custom component as a two-reboot process.

@claytonjn

wow. that looks like it worked. I have a “pycache” in the ring_light folder.

now here is the silly question. if the integration is loaded now. Where would I see it to start creating an automation now?

is this why I am not seeing the floodlight appear as a switch or light in HA?
Does any one have the light custom component working with latest version of HA?


2019-04-29 03:26:58 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for ring_light which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-04-29 03:26:59 ERROR (MainThread) [homeassistant.components.light] Error while setting up platform ring_light
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py”, line 126, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.7/asyncio/tasks.py”, line 416, in wait_for
return fut.result()
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/ring_light/light.py”, line 30, in setup_platform
ring = hass.data[DATA_RING]
KeyError: ‘ring’

I’m on 0.92.1 and it’s working properly for me. Are you seeing a camera entity for your floodlight cam(s) in the dev-state page (<>)? This custom component relies on the official ring integration so if that’s not working this won’t either.