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

YouTube sensor rarely loads #56

Open
BeardedTinker opened this issue May 28, 2022 · 9 comments
Open

YouTube sensor rarely loads #56

BeardedTinker opened this issue May 28, 2022 · 9 comments

Comments

@BeardedTinker
Copy link

Version of the custom_component
version 0.9.0

Describe the bug
On one of my setups, when properly configuring sensors, they just don't load or get created.
Exactly the same configuration on test system load nicely and works.

Out of 30 system restarts, it works once which is also strange that it would work at all.

Debugging is enabled for component, but not helping much and not additional errors or log entries are available.

Can further logging be added in component to try better pinpoint the issue?

Also, got same feedback from few other viewers that tried to add it to their system, with same problem that no sensor is ever created, even with proper sensor configuration.

log

2022-05-27 22:40:47 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform youtube is taking over 10 seconds.
2022-05-27 22:40:47 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform youtube is taking over 10 seconds.
2022-05-27 22:40:47 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform youtube is taking over 10 seconds.
2022-05-27 22:40:47 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform youtube is taking over 10 seconds.
2022-05-27 22:40:47 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform youtube is taking over 10 seconds.
2022-05-27 22:40:47 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform youtube is taking over 10 seconds.

And later, just this.
All channel ID's are correct, tested by hand and also on second setup where it loads.

2022-05-27 22:40:52 DEBUG (MainThread) [custom_components.youtube.sensor] Unable to set up - 
2022-05-27 22:40:52 DEBUG (MainThread) [custom_components.youtube.sensor] Unable to set up - 
2022-05-27 22:40:52 DEBUG (MainThread) [custom_components.youtube.sensor] Unable to set up - 
2022-05-27 22:40:52 DEBUG (MainThread) [custom_components.youtube.sensor] Unable to set up - 
2022-05-27 22:40:52 DEBUG (MainThread) [custom_components.youtube.sensor] Unable to set up - 
2022-05-27 22:40:52 DEBUG (MainThread) [custom_components.youtube.sensor] Unable to set up - 
@allenrobberson
Copy link

I am having the same issue.

@sevagjb
Copy link

sevagjb commented Jun 14, 2022

I have the same issue also

@bergdahl
Copy link
Contributor

bergdahl commented Jul 4, 2022

You could try changing the timeout value on line 39 of the sensor.py file from 10 to 30.

async with async_timeout.timeout(30)

@sevagjb
Copy link

sevagjb commented Jul 4, 2022

async with async_timeout.timeout(30)

thanks Jonny, i will try it

@pinkywafer
Copy link
Collaborator

Can you please let me know if this is reliable. Also, do you know when the issue started? - I'm guessing that this is due to async_timeout no longer having the loop passed in (no longer permitted), if so, would have begun at 0.9.0
If this resolves the issue, I'll add it to the next release

@BeardedTinker
Copy link
Author

Not sure when it started - but I'm using @bergdahl fork for the moment to test and see if it works (with added debug info in it). So far so good. After each restart sensors did show up for YT channels.

@sp7dpt
Copy link

sp7dpt commented Sep 25, 2022

I also have this problem when launching Home Assistant. The sensor is not loading data. Typing async with async_timeout.timeout (30) for me solves this problem.

@PatrickHennecke
Copy link

The async_timeout.timeout(30) method did not work for me. I'm still not getting all attributes of channels and some channels never show (no matter how many times I restart)

@zeputt
Copy link

zeputt commented Mar 5, 2024

The async_timeout.timeout(30) method did not work for me. I'm still not getting all attributes of channels and some channels never show (no matter how many times I restart)

Same for me but on version 0.9.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

8 participants