Twitch integration doesn't add new sensors for new follows
The problem
Twitch integration doesn't add new sensors for new twitch channels i follow
What version of Home Assistant Core has the issue?
2024.5.5
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Twitch
Link to integration documentation on our website
https://www.home-assistant.io/integrations/twitch
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
Hey there @joostlek, mind taking a look at this issue as it has been labeled with an integration (twitch) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of twitch can trigger bot actions by commenting:
@home-assistant closeCloses the issue.@home-assistant rename Awesome new titleRenames the issue.@home-assistant reopenReopen the issue.@home-assistant unassign twitchRemoves the current integration label and assignees on the issue, add the integration domain after the command.@home-assistant add-label needs-more-informationAdd a label (needs-more-information, problem in dependency, problem in custom component) to the issue.@home-assistant remove-label needs-more-informationRemove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.
(message by CodeOwnersMention)
twitch documentation twitch source (message by IssueLinks)
Yeah, I noticed this as well. It kind of defeats the purpose of the integration if you have to completely remove and reinstall it to have it update your followed list. I imagine once or twice daily is more than often enough of a sync cadence (but making it configurable would be even better)
For me it would even be enough on integration reload
I just noticed this issue today as well. I'd be happy enough if a manual reload would update the entities.
yeah this is my issue too today. glad i'm not the only one.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
It still need to be fixed...
Still broken
Still not working
Deleting and readding adds the new sensors for follows
True but that shouldn't be necessary, so this is still a bug.
What @fanaticDavid says
True but that shouldn't be necessary, so this is still a bug.
Agreed. Deleting and re-adding an integration for basic expected functionality is very unintuitive.
@joostlek was looking at this - quick question for you:
It would seem that assignment of data to channels in coordinator.py/_async_setup() could easily be swapped with a async call to get_followed_streams() and close this out.
(https://github.com/home-assistant/core/blob/b40f38116433a8aea60933dfb28d8be59de1e026/homeassistant/components/twitch/coordinator.py#L71-L74)
I'm happy to submit a PR to do this, but it then ignores the persisted data in the config entry for the integration (in options).
Is the purpose of storing the channels a user subscribes to in entry.options to provide a level of "consistency"/"stability"? (for instance, if twitch api returns 404, the integration won't knee-jerk remove a bunch of entities from home-assistant, only to then have to re-add them shortly thereafter?
If that isn't it's purpose, could you help me understand why it's designed that way?
Bonjour, j'ai le même problème
@joostlek It would be really nice if this integration would update on it's own, so when I add new channels or remove channels I didn't have to go in delete it, get the client id, and get a new secret key and input it every time. Also, it would be really cool if this integration had the url for each streamer or had a usable stream name field so I could make the click action bring me to the channel in a mushroom chips card...
@joostlek was looking at this - quick question for you:
It would seem that assignment of data to
channelsincoordinator.py/_async_setup()could easily be swapped with a async call to get_followed_streams() and close this out.(https://github.com/home-assistant/core/blob/b40f38116433a8aea60933dfb28d8be59de1e026/homeassistant/components/twitch/coordinator.py#L71-L74)
I'm happy to submit a PR to do this, but it then ignores the persisted data in the config entry for the integration (in options).
Is the purpose of storing the channels a user subscribes to in entry.options to provide a level of "consistency"/"stability"? (for instance, if twitch api returns 404, the integration won't knee-jerk remove a bunch of entities from home-assistant, only to then have to re-add them shortly thereafter?
If that isn't it's purpose, could you help me understand why it's designed that way?
@w531t4 I think, this might very well be the case. Another reason might be the issue with multiple uuids (unique_ids) for the same channel (same train of thought). I think, the most sensible way to go about solving this issue would be to just disable the entities, but keep them. In case of the user following them again, or twitch getting back online after another us-east-1 accident, the uuid would still be the same
@AlexCherrypi the primary problem is adding new channels. Deleting is an entire own new issue i would say
@LaneaLucy I don't think, adding new ones should break anything. I don't see any issue with that, do you?
@AlexCherrypi i opened this issue because new channels only get added when removing and adding the integration again. And there is no workaround for it, no other option. If you want to remove channels, you can at least disable the entity's. But for adding new channels there is no other way. So this issue is first about adding channels, maybe after about deleting channels
@Sherman1980
@joostlek It would be really nice if this integration would update on it's own, so when I add new channels or remove channels I didn't have to go in delete it, get the client id, and get a new secret key and input it every time. Also, it would be really cool if this integration had the url for each streamer or had a usable stream name field so I could make the click action bring me to the channel in a mushroom chips card...
RE: Also, it would be really cool if this integration had the url for each streamer or had a usable stream name field so I could make the click action bring me to the channel in a mushroom chips card...
Open a separate issue for those - thanks