đŸ“ș Trakt.tv Plugin

im so sorry to ask again, but I have setup the trakt.tv website app with callback url “urn:ietf:wg:oauth:2.0:oob” but all the time I try to connect from integration page within home assistant I get “oauth error The requested redirect uri is malformed or doesn’t match client redirect URI”

do i have setup anything wrong? also tried rebooting a few times, set my ip as callback, deleted the custom component through hacs - but nothing works
 pls help

edit: setting the right base_url under http in configuration.yaml und using the https://mydomain.com/ way solves the problem.

Thanks for your work on this great plugin, @iantrich.

I am having a problem configuring it. It was installed via HACS, and then I install the integration as normal. I enter the client ID and secret, and it then tries to exchange the OATH information. However the URL it is feeding is the Internal URL as defined in Configuration -> General rather than the external URL which is my Nabu Casa account.

I guess I Could change the URL definitions, but I am not sure what else it’d break.

How do I proceed?

Replying to the thread in case anyone else has problems getting the integration working. It’s very easy, but it took quite some time to get the right process.

Using HACS, install the upcoming media card from the ‘front end’ section, then install the Trakt integration.

Go to the Trakt website and install a new application: https://trakt.tv/oauth/applications
Set the callback URL with two lines:

urn:ietf:wg:oauth:2.0:oob
<The URL you are accessing HA with, including port>/auth/external/callback
(eg, mine is http://homeassistant.local:8123/auth/external/callback)

Update your configuration.yaml with:

trakt:
   client_id: <Client ID from Trakt website>
   client_secret: <Secret from Trakt website>

Restart HA.

Go Configuration -> Integrations -> click the plus -> Trakt
Follow the install flow.

The tile can start with something as simple as:

type: custom:upcoming-media-card
entity: sensor.trakt_upcoming_calendar
title: Upcoming Shows

(Note: sensor differs from the README).

I hope this helps someone else.

3 Likes

So I have this sync with my Trakt for upcoming shows which is great but is there a card I can have that displays the shows I haven’t watched yet/up next shows? Because we stream a lot of shows so it would be nice having a list of all the shows that have aired but I haven’t marked as watched yet?

That info is not available from this integration. Feel free to file a feature request on the repo.

Can’t get it to work through either configuration.yaml or through the integration. After entering the information through the integration I get “aborted” error.

Hi I installed this plug in by using HACS. Having issues when I get to the point of the installation when I get to the integration part and it ask for the client ID and client secret ID. I put in the code from trakt.tv site and submit i get aborted. I have tried all the suggestions on this forum but still no lucky. please help

Hi guys, thank you for this plugin. Could you please help me. I am trying to do the same thing as HAaccount7 on May '19. I would like to get attributes like “title”, “episode” to sensor. This kind of attributes is new for me. There is a solution:
value_template: '{{ state_attr('sensor.trakt_upcoming', 'data')[0].'title'}}'
It is not working for me. Should it work? Or something was changed. Thank you very much

Hello all! Sorry to revive and old topic here, but has anyone been able to run this with 2 accounts. Looking to incorporate both mine and my wife’s accounts into HA. I was able to integrate both as an integration, however it appears that even with different sensor names, I am getting the same upcoming schedule on both Lovelace cards.

I have been trying to get this component to work for quite some time now. I have followed the instructions and numerous suggestions that I have found on this thread. But I always have the same results.
I have created the API entry on the Trakt site:


But, when I enter the client id and client secret I get the following error:
trakt_b
I have also used the following for the Redirect URI on the Trakt site:

https://aw-----------------------------------------c2.ui.nabu.casa/auth/external/callback

as well as specifying both:

urn:ietf:wg:oauth:2.0:oob
https://aw-----------------------------------------c2.ui.nabu.casa/auth/external/callback

Does anyone have any idea what I am doing wrong?

I just did this tonight and had the same problem but a reboot of HA worked for me. Once I rebooted ha I was able to complete the process. In my case I am using the reverse proxy in my synology. I’m not sure how you are doing your SSL but one thing I did need to do was explicitly allow access in HA config to the proxy internal IP.

In my config in HA I added:

trakt_tv:
  language: en # Prefered language for movie/show title
  sensors:
    upcoming:
      show:
        days_to_fetch: 90 # How many days in the future you want to fetch
        max_medias: 3 # How many medias you want to fetch
      new_show:
        days_to_fetch: 90
        max_medias: 3
      premiere:
        days_to_fetch: 90
        max_medias: 3
      movie:
        days_to_fetch: 90
        max_medias: 3

#Explicit Reverse Proxy Enablement
http:
  use_x_forwarded_for: true
  trusted_proxies: 10.0.0.x # this is IP of my NAS, running reverse proxy

On my Synology’s built in reverse proxy I also allowed custom headers:

Hope something here allows your config to work!

I may have not replied to your post but I just posted my experience below yours and got it working. Hope it helps.

Thanks @hnkm.
I don’t know much about proxies, but I will try to figure it out if I can. From the little I know, it would make sense that I would see the results I do if I there is a proxy server that is not redirecting the request from the Trakt site (at least, that’s what I think is happening).

so im reading through and im havent found my answer

Im trying to setup the Trakt App. Is this right?

same issue mate! cant figure this out

Try this https:/ /my.home-assistant.io/redirect/oauth instead of http
/auth/external/callback

is this dead now as mine now shows no devices or entities

Also not working for me, and cannot re-authorise.

@iantrich is this repository/project still maintained?

It is not working as it needs to adopt to the „new“ Trakt.tv API. The old one has been shutdown recently.

Please follow up here:

Hello,

I followed all the steps to configure this plugin, included the steps to oauth authentication for trakt.
I have the Trakt integration correctly in the list.
Then I write into sensors.yaml the trakt_tv code I found on github and I correctly indented in the file (inside configuration.yaml file I included the sensors.yaml file).

But when I validate the configuration.yaml I get the following warning:

Invalid config for ‘sensor’ at sensors.yaml, line 6: required key ‘platform’ not provided

at line 6 there is “- trakt_tv:” line of the script configuration sensors and the key is correct otherwise I didn’t get the Trakt between the list of integrations.