Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skybell Task Exception #11975

Closed
CCOSTAN opened this issue Jan 27, 2018 · 19 comments
Closed

Skybell Task Exception #11975

CCOSTAN opened this issue Jan 27, 2018 · 19 comments

Comments

@CCOSTAN
Copy link
Contributor

CCOSTAN commented Jan 27, 2018

Home Assistant release (hass --version):
0.62

Python release (python3 --version):
3.6

Component/platform:
skybell / docker

Description of problem:
Getting this traceback every few seconds or so .. But the component seems to work.

Expected:
no tracebacks.

Traceback (if applicable):

2018-01-27 21:50:55 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 180, in _step
    result = coro.send(None)
  File "/usr/src/app/homeassistant/helpers/entity.py", line 220, in async_update_ha_state
    device_attr = self.device_state_attributes
  File "/usr/src/app/homeassistant/components/binary_sensor/skybell.py", line 85, in device_state_attributes
    attrs['event_date'] = self._event.get('createdAt')
AttributeError: 'NoneType' object has no attribute 'get'

Additional info:

@e2m32
Copy link

e2m32 commented Feb 2, 2018

I'm having the same issue, the camera component is working fine, but the binary_sensor.skybell_front_door_button is not loading.

Looks like others are having a similar problem:
https://community.home-assistant.io/t/binary-sensor-skybell-py/40029

Maybe skybell broke something?

I'm currently running 0.62.1

@jolaca01
Copy link

jolaca01 commented Feb 7, 2018

Same problem here!

@ghost
Copy link

ghost commented Feb 9, 2018

same issue here

2018-02-09 15:59:13 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.6/asyncio/tasks.py", line 180, in _step
    result = coro.send(None)
  File "/usr/local/lib/python3.6/dist-packages/homeassistant/helpers/entity.py", line 220, in async_update_ha_state
    device_attr = self.device_state_attributes
  File "/usr/local/lib/python3.6/dist-packages/homeassistant/components/binary_sensor/skybell.py", line 85, in device_state_attributes
    attrs['event_date'] = self._event.get('createdAt')
AttributeError: 'NoneType' object has no attribute 'get'

and it seems the actual push button sensor does not work

@CCOSTAN
Copy link
Contributor Author

CCOSTAN commented Feb 11, 2018

This error still persists even with the last upgrade. :( It is just spamming the logs continuously.

2018-02-11 15:58:12 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 180, in _step
    result = coro.send(None)
  File "/usr/src/app/homeassistant/helpers/entity.py", line 220, in async_update_ha_state
    device_attr = self.device_state_attributes
  File "/usr/src/app/homeassistant/components/binary_sensor/skybell.py", line 85, in device_state_attributes
    attrs['event_date'] = self._event.get('createdAt')
AttributeError: 'NoneType' object has no attribute 'get'
2018-02-11 15:58:18 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 180, in _step
    result = coro.send(None)
  File "/usr/src/app/homeassistant/helpers/entity.py", line 220, in async_update_ha_state
    device_attr = self.device_state_attributes
  File "/usr/src/app/homeassistant/components/binary_sensor/skybell.py", line 85, in device_state_attributes
    attrs['event_date'] = self._event.get('createdAt')
AttributeError: 'NoneType' object has no attribute 'get'
2018-02-11 15:58:24 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 180, in _step
    result = coro.send(None)
  File "/usr/src/app/homeassistant/helpers/entity.py", line 220, in async_update_ha_state
    device_attr = self.device_state_attributes
  File "/usr/src/app/homeassistant/components/binary_sensor/skybell.py", line 85, in device_state_attributes
    attrs['event_date'] = self._event.get('createdAt')
AttributeError: 'NoneType' object has no attribute 'get'
2018-02-11 15:58:30 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 180, in _step
    result = coro.send(None)
  File "/usr/src/app/homeassistant/helpers/entity.py", line 220, in async_update_ha_state
    device_attr = self.device_state_attributes
  File "/usr/src/app/homeassistant/components/binary_sensor/skybell.py", line 85, in device_state_attributes
    attrs['event_date'] = self._event.get('createdAt')
AttributeError: 'NoneType' object has no attribute 'get'

@CCOSTAN
Copy link
Contributor Author

CCOSTAN commented Feb 11, 2018

As a temp measure, I just commented out the offending line. You can add this to your custom_component directory to at least get rid of all the spammy errors.

https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/custom_components/binary_sensor/skybell.py#L85

@e2m32
Copy link

e2m32 commented Feb 13, 2018

This may be related.

I have 2 Skybell HD Doorbells.

Issue Found:
Second Skybell - Button Sensor does not load

Camera, Both motion sensors, and first Skybell button sensor confirmed working.

@jshank
Copy link
Contributor

jshank commented Mar 5, 2018

Confirmed @CCOSTAN solution works. I found the actual file was here.

@jolaca01
Copy link

jolaca01 commented Mar 6, 2018

Hi @jshank, I'm using docker and I cannot find the correct folder. Could you tell me which was the folder you installed the file in? Thanks

@jshank
Copy link
Contributor

jshank commented Mar 6, 2018

@jolaca01 I am using Docker as well. I was very pleased to find that creating a custom_components/binary_sensor directory under my configuration folder worked to override the offending component. I have my configuration folder mapped below. the full path is ./config/custom_components/binary_sensor/skybell.py (the modified version). I reloaded home assistant and it picked up the new file.

volumes:
       - "./config:/config"

@CCOSTAN
Copy link
Contributor Author

CCOSTAN commented Mar 6, 2018

Yes. Same here. My docker yaml file can be found here as well.
https://github.com/CCOSTAN/Docker_Support

The custom component works perfectly for me.

@jolaca01
Copy link

jolaca01 commented Mar 7, 2018

Thank you so much, @jshank and @CCOSTAN . I have created the folder ./config/custom_components/binary_sensor/ and placed the modified skybell.py inside. However, after restarting the home assistant container I still get this message once or twice per minute:

Updating skybell binary_sensor took longer than the scheduled update interval 0:00:05
8:40 AM helpers/entity_platform.py (WARNING)

Sorry but what I think I didn't get was the part @jshank told about mapping the folder. Should I include this?:

volumes:
- "./config:/config"

...inside my configuration.yaml?? or where? The problem is that I really don't know what I need to do in docker in order to get the new folder and file recognised. Thank you for bearing with me, sorry guys.

This is my container configuration:

image

Thanks again!!

@jshank
Copy link
Contributor

jshank commented Mar 7, 2018

@jolaca01 that is a different error message than this patch addresses. The file that @CCOSTAN modified only fixes the Error doing job: Task exception that sets the createdAt attribute. Based on you configuration screenshot, you'll want to copy that file to docker/homeassistant/custom_components/binary_sensor/skybell.py since you are mapping /config to docker/homeassistant.

@CCOSTAN
Copy link
Contributor Author

CCOSTAN commented Mar 7, 2018

@jolaca01 - What @jshank said. :) You don't need to worry about the took too long messages. If you really want to get rid of those, you can add in a logger.yaml file. Here's mine :
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/config/logger.yaml#L33

@jolaca01
Copy link

jolaca01 commented Mar 7, 2018

Thank you again!! @jshank, that's the exact path I've used: the path I was talking about was from inside the container, but indeed, it is actually located in docker/homeassistant/custom_components/binary_sensor/skybell.py
So I understand I was doing it correctly. However, I thought we were having all the same issue, but I don't think I had this error, only the warning. Is this possible?
Anyway, thank you again, and as @CCOSTAN suggested I will limit them setting properly my logger file.
BTW, have you read the final part of this thread:
https://community.home-assistant.io/t/skybell-hd-component/21200/23
Skybell support staff seemed willing to help in improving their integration and the problem with the huge delay when the skybell button is pressed till it reflects in the binary sensor. As I see all your knowledge on the subject maybe you could take a look at it or contact Mosses from Skybell support to try improving the current skybell component. Just saying, just in case. ;-)

@GaryOkie
Copy link
Contributor

@CCOSTAN - would you please confirm where I can grab your modified skybell.py please? The original link you posted is not working. Thanks!

@CCOSTAN
Copy link
Contributor Author

CCOSTAN commented Apr 15, 2018

@GaryOkie - It was in my repo (https://github.com/CCOSTAN/Home-AssistantConfig#logo) but I got rid of it at one point after an update. I no longer have this issue with the latest versions of HA.

@CCOSTAN CCOSTAN closed this as completed Apr 15, 2018
@GaryOkie
Copy link
Contributor

GaryOkie commented Apr 15, 2018

@CCOSTAN - That's interesting you no longer have this issue. I just installed a new Skybell HD a few days ago with Hass.io version 66.1, and don't recall seeing any errors either, but I may not have even looked at the log since the add-on was working fine.

I've updated to Hass.io 67.0 and am getting the following errors. Aren't they the errors your patched skybell.py addressed, or is it something different now?

2018-04-15 09:44:54 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 215, in async_update_ha_state
    state = self.state
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 379, in state
    return STATE_ON if self.is_on else STATE_OFF
  File "/usr/lib/python3.6/site-packages/homeassistant/components/switch/skybell.py", line 75, in is_on
    return getattr(self._device, self._switch_type)
  File "/usr/lib/python3.6/site-packages/skybellpy/device.py", line 206, in do_not_disturb
    return bool(distutils.util.strtobool(str(self._settings_json.get(
AttributeError: module 'distutils' has no attribute 'util'

(This error repeats approximately every 30 seconds)

@CCOSTAN
Copy link
Contributor Author

CCOSTAN commented Apr 15, 2018

I think this is something new. I haven't jumped to 0.67 yet though.

@GaryOkie
Copy link
Contributor

GaryOkie commented Apr 15, 2018

Just an FYI that I have submitted a new bug report on this: #13922

Looks like this particular error has cropped up in other components and fixed.

MisterWil just confirmed he has duplicated the problem after updating to hassio 67 and will ensure it is fixed.

@home-assistant home-assistant locked and limited conversation to collaborators Jul 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants