Twitch Integration

I tried to integrate the twitch platform to my home assistant.

I added this to my configuration.yaml:

# Twitch
sensor:
  platform: twitch
  client_id: XXXXXXXXXXXXXXXXXXXXXXXX
  channels:
    - Drzzs

But it says that there are no “sensor.drzzs” in my home assistant.

Did i forget something?

I have the same issue with the Twitch integration. I followed this video step-by-step:

… but when I restart HA it says the following in the log and no sensors show up:

Bildschirmfoto 2022-01-17 um 11.43.53

My Config:

Ok … going deeper into the rabbit hole it seems like the current Twitch integration is outdated:

"It looks like the original Twitch sensor integration uses the Twitch V5 API which is deprecated. New Twitch apps doesn’t seem to work with this deprecated API.

This component does mostly the same as the original integration found here (Twitch - Home Assistant), but with some extra features and the underlying implementation is using the Twitch Helix API."

… so this custom_component seems to be the solution now:

… I will update my findings as I go …

Ok … works flawlessly now!

Installed the custom HACS component and my config looks like this:

  # Twitch Online Status
  - platform: twitch_helix
    client_id: tjk1jgp***
    client_secret: lx24***
    own_channel: "pwave86"
    thumbnail_dimensions: 320x180
    channels:
      - "Mrxstr3am"
    api_opt_outs:
      # - subscription_user
      # - follow_user
      # - follow_total
      # - stream

… any idea how I can change the sensor output from:

sensor.mrxstr3am

to:

sensor.twitchtv.mrxstr3am

???

what you want to change it to is an invalid & impossible entity_id.

… oh sorry I ment change to:

sensor.twitchtv_mrxstr3am

… so I can use the “twitchtv_” suffix for my autofill script.

That’s a question for the guy who created the custom integration. That’s what’s controlling your entity_id.

EDIT: It does look like it has a unique_id, so all you need to do is change the entity_id in the UI.

Ah ok … that worked! So I renamed all of them in the UI … but if I would like to have a different default naming that needs to be solved by the developer of the custom integration?

yes, the integration comes up with the default names.

1 Like

I’ve been using the built-in integration for at least a year now and I just updated HA today to 2022.2.6 and it stopped working. Seems the built-in integration still hasn’t been updated and Twitch is currently in the process of shutting down their old API.

Installing the custom integration now and hope it works.

It seems as if the Twitch Integration broke because of the new API
I got an email last week:

We are reaching out as we have identified that your application(s) below have made requests to the deprecated “helix/users/follows” Twitch API endpoint in the past month and may be affected by the scheduled shutdown if further action is not taken.
{MY API KEYS}
This “Get Users Follows” Twitch API endpoint was deprecated in February 2023 and replaced by “Get Channel Followers” and “Get Followed Channels.” To continue receiving follow count, receiving follower information, or checking for a follow, please make sure your application is updated to use the new API URLs and that your authentication flow includes the new scopes if required.

Yep broken on this end too. Would like to know what to do to fix this. I’ve been surprised how handy this integration has been.

Has anyone been able to add the twitch integration in 2023.10.0?

When I try to add it it tells me it needs to open an external site, which takes me to https://twitchapps.com/ to get an oauth token.

After creating an application on twitch I am getting an oauth token, and this is where I am stuck.

The integration in the HA tab is still showing the need to go to an external website, which just opens twitchapps again, but I also already got the oauth token.

How do I give that token to the integration?

You have to add your HA oauth link to the twitch integration oauth redirect ( Link to OAuth2 Authorize Callback – My Home Assistant should work )

That is missing from the documentation I think

Also, I would like to edit polling time (or use a service to update the information) is there a way to do this?

turn off polling on the integration, and then make an automation that uses homeassistant.update_entity. Use a time pattern trigger and adjust it to whatever frequency you want.

How do you do that?

click on the integration, click on the 3 dots in the integration page, click on system options, turn off enable polling

Just moved over to the new Twitch integration, I cant see how to add a sensor for my own channel. Am I missing something obvious?

Thanks

Hi all,
I have managed to get past the twitchapps.com issue by adding the redirect URL, but am having an issue once it redirects me back into home assistant.
image

Has anyone else had this issue? How did you overcome?

Okay, nevermind I managed to fix it.
For anyone else who has my issue, you have to go to the integration page, hit the 3 dot button in the top right hand corner, open Application Credentials and remove Twitch. (This was imported from my old configuration.yaml and doesnt have the Client Secret)

Once I removed this and added the Twitch Integration again it worked perfectly as it actually prompted me for the ID and Secret.

1 Like