Home Assistant release (hass --version):
0.70.0
Python release (python3 --version):
3.6
Component/platform:
Ring / Binary Sensor
Description of problem:
Motion Binary Sensor not always triggering working Automations
Expected:
No Errors
Traceback (if applicable):
2018-05-30 13:11:37 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating ring binary_sensor took longer than the scheduled update interval 0:00:05
Additional info:
Log is filled with the above error
@Bergasha could you share your configuration for the ring
components and if possible to set the logger
component to debug
so then we can investigate?
platform: ring
monitored_conditions:
- ding
- motion
ring:
username: ########
password: ########
Will do..
FWIW I have seen this as well. If I restart my modem I will most definitely see this issue. This happens for a few minutes at a time when it does for me. No longer than 10 minutes. At that time even the Ring app is giving me a hard time to open or view videos. Maybe we are being rate limited? This is true for any of my friends who come over as well, it must be an IP thing?
Guys, @dshokouhi @Bergasha if you follow the instructions to open an interactive Python shell as described at https://github.com/tchellomello/python-ring-doorbell, are you able to see your doorbell and interact with the library?
@tchellomello yes i am able to see and interact with it right now.
Also can see and interact.. logger set to debug.. I've just set it to all components so will pm it to you when done
@tchellomello Let me know if you need the whole log...
2018-05-31 11:18:51 ERROR (MainThread) [homeassistant.helpers.entity] Update for binary_sensor.ring_front_door_motion fails
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 204, in async_update_ha_state
yield from self.async_device_update()
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 327, in async_device_update
yield from self.hass.async_add_job(self.update)
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/lib/python3.6/site-packages/homeassistant/components/binary_sensor/ring.py", line 109, in update
self._data.check_alerts()
File "/usr/lib/python3.6/site-packages/ring_doorbell/doorbot.py", line 41, in check_alerts
self.update()
File "/usr/lib/python3.6/site-packages/ring_doorbell/generic.py", line 45, in update
self._get_health_attrs()
File "/usr/lib/python3.6/site-packages/ring_doorbell/generic.py", line 92, in _get_health_attrs
self._health_attrs = self._ring.query(url).get('device_health')
AttributeError: 'NoneType' object has no attribute 'get'
2018-05-31 11:18:53 ERROR (MainThread) [homeassistant.helpers.entity] Update for binary_sensor.ring_front_door_ding fails
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 204, in async_update_ha_state
yield from self.async_device_update()
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 327, in async_device_update
yield from self.hass.async_add_job(self.update)
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/lib/python3.6/site-packages/homeassistant/components/binary_sensor/ring.py", line 109, in update
self._data.check_alerts()
File "/usr/lib/python3.6/site-packages/ring_doorbell/doorbot.py", line 41, in check_alerts
self.update()
File "/usr/lib/python3.6/site-packages/ring_doorbell/generic.py", line 45, in update
self._get_health_attrs()
File "/usr/lib/python3.6/site-packages/ring_doorbell/generic.py", line 92, in _get_health_attrs
self._health_attrs = self._ring.query(url).get('device_health')
AttributeError: 'NoneType' object has no attribute 'get'
@Bergasha that is a good information and explains why you don't get anything reported.
Did you try to follow the steps using the library directly as suggested on the comment above https://github.com/home-assistant/home-assistant/issues/14693#issuecomment-393221031 ?
@tchellomello yes I tried and could control it fine..
Are guys you still hitting this issue after the upgrade to oauth authentication?
Still seeing this with 0.72.0
Updating ring binary_sensor took longer than the scheduled update interval 0:00:05
ring doorbell quit working in HA Went to my ring.com account and saw this:
Perhaps the ring component should report this.
Do you have multiple phones with the Ring Door Bell installed? You can set the scan_interval for a lower rate in your case.
Yes 2 phones. I just changed the ring scan_interval to 120 - we'll see what happens. Thanks.
I am also still seeing the messages periodically as well. I don't think the oauth changes made an impact. If anything it may have gotten worse or that's the placebo effect. Difficult to tell whether it got better or worse honestly but it is still there for me.
@dshokouhi try to change the scan_interval as well to see if that will help. It's hard to tell if the module is hitting the maximum API calls because there is no public API documentation, so we don't know. This module was reversed engineering as Ring Door Bell does not expose any public API (at least so far).
@tchellomello should we only modify the binary sensor scan interval set here? https://github.com/home-assistant/home-assistant/blob/master/homeassistant/components/binary_sensor/ring.py#L26
@dshokouhi yes, start on that one and let's how that will affect the system.
Changing the ring scan_interval to 120 for the sensors, waiting 2 hours and restarting HA fixed the problem.
so far so good on the change, I changed the scan interval to 10 seconds for the binary sensor and left the others alone. I do get an occasional message about it taking longer than 10 seconds to update but not as frequent as before.
In your opinion, should we change the default times or just add a note on the documentation? I never hit this problem so I think it might depend how many times you check vs the number of devices in the home network. What are your thoughts?
@tchellomello I say change the default.. I'm running Hass.io so I don't think I can change it myself..
Or can I?
@tchellomello I think it should be ok to change to 10 seconds and see how that helps everyone. For the record I have the doorbell and 1 floodlight camera. Might be good for us to consider these things while trying to find the sweet spot.
@Bergasha you should be able to change it by using the code as a custom component and making the modification there.
@dshokouhi Thank you.. Working without errors now :)
@tchellomello ok after leaving scan_interval
set to 10 for the binary_sensor
I hardly ever see any ring errors. My automations are also on par with the Ring app so I don't see much of any delay. When I updated to 0.73 this week my change was accidentally reverted and I immediately saw the errors again that we are discussing. I brought back the change and the errors are gone. I think it is safe to say that changing this will have a positive impact on most users with more than 1 ring device.
The only error that I see now is camera taking more than 10 seconds
but I only see a handful of those in a 24 hour period. I think maybe 10 seconds for the camera could be a bit aggressive as the devices default recording time is 30 seconds.
@dshokouhi that sounds good. Thanks for the heads up. I'm going to submit a new PR with the new times to avoid being aggressive. The camera defaults to 90 seconds.
@dshokouhi PR submitted
Most helpful comment
@dshokouhi PR submitted