core icon indicating copy to clipboard operation
core copied to clipboard

Twitch integration doesn't add new sensors for new follows

Open LaneaLucy opened this issue 1 year ago • 5 comments

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

LaneaLucy avatar Jun 03 '24 18:06 LaneaLucy

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 close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign twitch Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove 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)

home-assistant[bot] avatar Jun 03 '24 18:06 home-assistant[bot]

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)

bj61251 avatar Jun 06 '24 11:06 bj61251

For me it would even be enough on integration reload

LaneaLucy avatar Jun 06 '24 11:06 LaneaLucy

I just noticed this issue today as well. I'd be happy enough if a manual reload would update the entities.

fanaticDavid avatar Aug 21 '24 13:08 fanaticDavid

yeah this is my issue too today. glad i'm not the only one.

jamesking210 avatar Sep 22 '24 06:09 jamesking210

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...

LaneaLucy avatar Dec 22 '24 13:12 LaneaLucy

Still broken

mvanamburg avatar Mar 20 '25 14:03 mvanamburg

Still not working

andyedwards231 avatar Mar 28 '25 18:03 andyedwards231

Deleting and readding adds the new sensors for follows

jwsoat avatar Jun 04 '25 21:06 jwsoat

True but that shouldn't be necessary, so this is still a bug.

fanaticDavid avatar Jun 05 '25 06:06 fanaticDavid

What @fanaticDavid says

LaneaLucy avatar Jun 05 '25 10:06 LaneaLucy

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.

mihalski avatar Jul 28 '25 06:07 mihalski

@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?

w531t4 avatar Aug 13 '25 13:08 w531t4

Bonjour, j'ai le même problème

diabolik26 avatar Oct 24 '25 06:10 diabolik26

@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...

Sherman1980 avatar Nov 16 '25 06:11 Sherman1980

@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?

@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 avatar Nov 18 '25 20:11 AlexCherrypi

@AlexCherrypi the primary problem is adding new channels. Deleting is an entire own new issue i would say

LaneaLucy avatar Nov 18 '25 20:11 LaneaLucy

@LaneaLucy I don't think, adding new ones should break anything. I don't see any issue with that, do you?

AlexCherrypi avatar Nov 18 '25 20:11 AlexCherrypi

@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

LaneaLucy avatar Nov 18 '25 20:11 LaneaLucy

@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

w531t4 avatar Nov 22 '25 19:11 w531t4