📺 Trakt.tv Plugin

Custom Trakt.tv component that integrates with upcoming-media-card

image

12 Likes

Would love to see it as an official component :slight_smile:

I’ll likely not do that. There will be a push to move plugins out of core in the future and you’ll have the majority of plugins as 3rd party integrations like this.

Hi,

Just tried to use your component but it just created only one entity: configurator.trakt which requires me to visit an url and enter trakt PIN code. Unfortunately the address returns: The requested redirect uri is malformed or doesn’t match client redirect URI."
What could have I done wrong?

Sounds like you need to double check your redirect uri you put on the really site when setting up the API key. Go back and make sure it is the default value. It should be stated in the description for the field on the site.

Right, I had a typo there - now everything works.
Thanks for help and and great component :slight_smile:

Help please, I don’t seem to be able to get this to work. I put the 2 .py files into a folder called trakt in custom_components, added the info to the config.yaml.

After my first reboot, I was prompted to input the authorisation code (it was an old api I was going to use), and I got the code wrong.

So I made a new API and put the new info into the config.yaml, now it won’t work at all.

here is the error.

Log Details (ERROR)
Sun May 05 2019 18:10:45 GMT+0100 (British Summer Time)
Error while setting up platform trakt
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/trakt/sensor.py", line 81, in setup_platform
    continue_setup_platform(hass, config, token, add_devices, discovery_info)
  File "/config/custom_components/trakt/sensor.py", line 89, in continue_setup_platform
    add_devices([TraktUpcomingCalendarSensor(hass, config, token)], True)
  File "/config/custom_components/trakt/sensor.py", line 115, in __init__
    import trakt
ModuleNotFoundError: No module named 'trakt'

Thanks.

Try removing the .trakt.conf file from your config folder and rebooting

Thanks, found it about 30 seconds ago :slight_smile:

I’ll update soon.

Hmm, I’m getting the code request, but it always fails :frowning: Should I be using the main username, or the one I’ve made for the API?

Bother

I’m deleting the .trakt.conf and rebooting, inputting my trakt code, I get the message Failed to call service configurator/configure. No module named ‘trakt’, that’s about it really.

Feel free to ask any questions.

I’ve been at it for long enough now, here’s an error report.

Log Details (ERROR)
Sun May 05 2019 20:35:25 GMT+0100 (British Summer Time)
No module named 'trakt'
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/websocket_api/commands.py", line 121, in handle_call_service
    connection.context(msg))
  File "/usr/local/lib/python3.7/site-packages/homeassistant/core.py", line 1138, in async_call
    self._execute_service(handler, service_call))
  File "/usr/local/lib/python3.7/site-packages/homeassistant/core.py", line 1160, in _execute_service
    await handler.func(service_call)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/configurator/__init__.py", line 221, in async_handle_service_call
    call.data.get(ATTR_FIELDS, {}))
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/trakt/sensor.py", line 57, in trakt_configuration_callback
    continue_setup_platform(hass, config, token, add_devices, discovery_info)
  File "/config/custom_components/trakt/sensor.py", line 89, in continue_setup_platform
    add_devices([TraktUpcomingCalendarSensor(hass, config, token)], True)
  File "/config/custom_components/trakt/sensor.py", line 115, in __init__
    import trakt
ModuleNotFoundError: No module named 'trakt'

Did you grab the manifest.json file as well? I need to update all my readme files for my components since they’ve overhauled how components work in HA.

Cheers, I had downloaded it but didn’t put it in the trakt folder. Now that I have, it seems to work.

Thanks.

1 Like

I couldn’t make this plugin work the link always brings a “OAUTH ERROR”. :frowning:

Do you have the default redirect configured?

at the trakt api?

Edit:
i think thats the problem should i make it public or local?
Sorry i am new to this.

On the trakt site, yes. In the description there should be the default uri to use

alright what should i write there?

What you should out there is literally stated in the description

sorry cant see any thingi missed at the installation list.
i think i should enter my public ip to Redirect uri: