youtube
youtube copied to clipboard
YouTube sensor rarely loads
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 -
I am having the same issue.
I have the same issue also
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)
async with async_timeout.timeout(30)
thanks Jonny, i will try it
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
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.
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.
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)
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