dylandoamaral / trakt-integration

A Trakt integration for Home Assistant compatible with upcoming media card
MIT License
30 stars 12 forks source link

No sensors has been created #59

Closed Ofir-P closed 1 year ago

Ofir-P commented 1 year ago

I have successfully added dylandoamaral trakt integration to my HA. In his HACS documentation, it says 'the sensors may take a while to be created and populated.' I left my HA PC on for about 4 hours and there are still no sensors showing up, I have also tried to restart the whole HA, and still nothing.

image This is the code right from my configuration.yaml: image

trakt_tv: language: en # Prefered language for movie/show title timezone: Asia/Tel_Aviv # Prefered timezone sensors: upcoming: show: days_to_fetch: 30 max_medias: 10 movie: days_to_fetch: 45 max_medias: 5 recommendation: show: max_medias: 3 movie: max_medias: 3

and yes I have data in my trakt account, using this website since 2017. Thanks for helping!

dylandoamaral commented 1 year ago

Indeed, 4 hours are definitely more than enough normally. Do you have error logs coming from home assistant in your supervisor panel ?

Ofir-P commented 1 year ago

Hi Dylan thanks for the quick reply! Well, nothing unusual in my logs.

dylandoamaral commented 1 year ago

This is weird, did you try to delete the integration ?

Ofir-P commented 1 year ago

This is weird, did you try to delete the integration ?

No, should I try?

Ofir-P commented 1 year ago

Okay I have re-added the integration and still showing no entities. image

The redirect URL I used was https://my.home-assistant.io/redirect/oauth and I haven't clicked on the 'Authorize' button.

dylandoamaral commented 1 year ago

Did you follow this part: https://github.com/dylandoamaral/trakt-integration#workaround ?

Ofir-P commented 1 year ago

Did you follow this part: https://github.com/dylandoamaral/trakt-integration#workaround ?

Yes.

dylandoamaral commented 1 year ago

Honestly, I don't know how I can help you without any piece of information. Explain me exactly what you did in home assistant and in trakt. And how do you know that no sensors are generated ?

Ofir-P commented 1 year ago

I just followed the link you sent.

When I put the card it says this entity doesn't exist, also on the integration page it's showing no entities on your integration (all the other ones do show at least 1).

Ofir-P commented 1 year ago

After 24 hours the trakt thing in the integration page has been changed image

angrycvilleian commented 1 year ago

Yep. I am getting this as well.

dylandoamaral commented 1 year ago

Ok thanks, at least I have something to start with !

itzalgd24 commented 1 year ago

+1 for this error. Popped up when I updated to 2023.1.1 this morning.

echopage commented 1 year ago

+1 Me too

Ofir-P commented 1 year ago

Ok thanks, at least I have something to start with !

Error is now gone, I reinstalled the integration and still no entities showing up. Note - I have created another API in trakt website with Redirect URL https://my.home-assistant.io/redirect/oauth

dylandoamaral commented 1 year ago

It still does not work with https://my.home-assistant.io/redirect/oauth redirection ? I tried in the current home assistant version and it worked well.

Ofir-P commented 1 year ago

It doesn't. I will post now the whole process I'm doing, maybe you'll find one of my steps to be wrong:

  1. Going to the Trakt API page, copy the client and secret image

  2. Going to Home Assistant Integration and searching for trakt a window pops up asking for the client id and secret image

  3. Pasting the client and secret from step 1 and pressing on Submit

  4. A redirect page has been opened asking for permission for home assistant - I am pressing Link Account image

  5. Success screen appears, I click on 'Finish'

  6. Trakt now showing up in the Integrations page, without entities after waiting for at least 20 minuets. image

dylandoamaral commented 1 year ago

You did great.

Sorry if I am annoying with my questions and if I ask simple things that you already did. The fact is that I don't know why this is happening to you. Since I can't reproduce it myself, I can't help you that much.

Here are things that may help you (If you haven't tried yet):

If nothing is working, then I hope someone else will allow us to make progress.

During this time you can look at https://github.com/custom-components/sensor.trakt maybe it will work for you.

Ofir-P commented 1 year ago

You did great.

Sorry if I am annoying with my questions and if I ask simple things that you already did. The fact is that I don't know why this is happening to you. Since I can't reproduce it myself, I can't help you that much.

Here are things that may help you (If you haven't tried yet):

  • Check your version of home assistant and upgrade it to the latest
  • Check in developer tools (in state) if there are no sensors starting with sensor.trakt
  • Remove the timezone temporarly to see if it causes issues

If nothing is working, then I hope someone else will allow us to make progress.

During this time you can look at https://github.com/custom-components/sensor.trakt maybe it will work for you.

You are not annoying at all, and I appreciate your help!

This is the version I'm using currently image

Developer tools - image image Time zone - I couldn't remove it completely so I have tried Europe/Paris When removed the line I got this error on the configuration.yaml file Invalid config for [trakt_tv]: value must be one of ['Africa/Abidjan', 'Africa/Accra', 'Africa/Addis_Ababa', 'Africa/Algiers', 'Africa/Asmara', 'Africa/Asmera', image Configuration.yaml: (http://pastie.org/p/0E3P4KfY9eQIPX5O2Zjuvb)

Been looking at the link you've sent to me and tried to do it with HA Cloud https://github.com/custom-components/sensor.trakt This is the error I'm getting image This is the API App Screen on trakt with the HA Cloud: image

dylandoamaral commented 1 year ago

Honestly you did everything perfectly, I don't know how I can help you now...

@itzalgd24 or @echopage do you still have an error ?

rzechu commented 1 year ago

Same problem here OAuth problem solved by changing redirect uri to https://my.home-assistant.io/....

Success! Successfully authenticated with Trakt. Created configuration for Trakt.

Got only 1 default entity (reinstalled trakt integration) image

image

Got working only 1 entity and 1 card

resources:
  - url: /local/custom-lovelace/upcoming-media-card/upcoming-media-card.js?v=0.1.1
    type: js
type: custom:upcoming-media-card
entity: sensor.trakt_upcoming_calendar
title: Upcoming Episodes
image_style: fanart
hide_empty: true
title_text: $title
line1_text: $episode
line2_text: $number
line3_text: $day, $date $time
line4_text: $empty
max: 10

image

My configuration.yaml

trakt_tv:
  language: en
  sensors:
    upcoming:
      show:
        days_to_fetch: 30
        max_medias: 10
      movie:
        days_to_fetch: 45
        max_medias: 5
    recommendation:
      show:
        max_medias: 3
      movie:
        max_medias: 3

Cant add upcoming for movies and I dont see any other sensors even after restart ( show / movie / recommendation etc)

There are five sensors available under the sensors > upcoming array: show for TV Shows (actually, episodes). Creates sensor.trakt_upcoming_shows new_show for New Shows (series premiers). Creates sensor.trakt_upcoming_new_shows

Ofir-P commented 1 year ago

How did you manage to save the configuration.YAML without a timezone? I copied your code to my configuration.YAML and i get the error: `Configuration invalid!

Invalid config for [trakt_tv]: value must be one of ['Africa/Abidjan',`

Ofir-P commented 1 year ago

Same problem here OAuth problem solved by changing redirect uri to https://my.home-assistant.io/....

Success! Successfully authenticated with Trakt. Created configuration for Trakt. About this:

Same problem here OAuth problem solved by changing redirect uri to https://my.home-assistant.io/....

Success! Successfully authenticated with Trakt. Created configuration for Trakt.

can you send me the full link you've entered in the trakt page of 'Redirect URI' ? also after it redirects you after adding the integration what is the link that shown below? Is your local or a cloud link? mind sending me that too? (you can censor the link a bit so I can understand what to put in there)

dylandoamaral commented 1 year ago

For the redirect URI, here is what worked for me in my dev environment: https://my.home-assistant.io/redirect/oauth

You can't create a configuration without timezone.

rzechu commented 1 year ago

I sucessfully connected trakt no problem just saying workaroud solved problem used link: https://my.home-assistant.io/redirect/oauth Redirected to: https://my.home-assistant.io/redirect/oauth/?code=d9f48XXXXXX&state=eyJhbGciOiXXXX.n_XXXXXX This is ok and worked without problems (previous problem with using duckdns.org domain)

And have no problem with saving configuration.yaml without timezone But configured as you wanted and after restart nothing changed

trakt_tv:
  language: en
  timezone: Europe/Paris # Prefered timezone
  sensors:
    upcoming:
      show:
        days_to_fetch: 30
        max_medias: 10
      movie:
        days_to_fetch: 45
        max_medias: 5
    recommendation:
      show:
        max_medias: 3
      movie:
        max_medias: 3
dylandoamaral commented 1 year ago

Everything is working now ?

Ofir-P commented 1 year ago

I sucessfully connected trakt no problem just saying workaroud solved problem used link: https://my.home-assistant.io/redirect/oauth Redirected to: https://my.home-assistant.io/redirect/oauth/?code=d9f48XXXXXX&state=eyJhbGciOiXXXX.n_XXXXXX This is ok and worked without problems (previous problem with using duckdns.org domain)

And have no problem with saving configuration.yaml without timezone But configured as you wanted and after restart nothing changed

trakt_tv:
  language: en
  timezone: Europe/Paris # Prefered timezone
  sensors:
    upcoming:
      show:
        days_to_fetch: 30
        max_medias: 10
      movie:
        days_to_fetch: 45
        max_medias: 5
    recommendation:
      show:
        max_medias: 3
      movie:
        max_medias: 3

image I mean this one, what link you've placed in there? (After typing the secret and ID)

dylandoamaral commented 1 year ago

I never used something related to nabu.casa but it should be the same thing from (the redirect URI red square):

image

Ofir-P commented 1 year ago

I never used something related to nabu.casa but it should be the same thing from (the redirect URI red square):

image

There is a diff between the Redirect URL in trakt (which I set to https://my.home-assistant.io/redirect/oauth) then the 'Your instance URL' that shows in the next screen after putting in the ID and secret code I wanna know what instance rzechu used and then clicked on Link Account because I think that might be my solution to this case.

rzechu commented 1 year ago

Any ideas about missing (not added) sensors or upcoming-media-card configuration? No info about movies only upcoming show

Got only 1 default entity (reinstalled trakt integration) image

image

Got working only 1 entity and 1 card

resources:
  - url: /local/custom-lovelace/upcoming-media-card/upcoming-media-card.js?v=0.1.1
    type: js
type: custom:upcoming-media-card
entity: sensor.trakt_upcoming_calendar
title: Upcoming Episodes
image_style: fanart
hide_empty: true
title_text: $title
line1_text: $episode
line2_text: $number
line3_text: $day, $date $time
line4_text: $empty
max: 10

image

My configuration.yaml

trakt_tv:
  language: en
  timezone: Europe/Paris # Prefered timezone #added this but no difference
  sensors:
    upcoming:
      show:
        days_to_fetch: 30
        max_medias: 10
      movie:
        days_to_fetch: 45
        max_medias: 5
    recommendation:
      show:
        max_medias: 3
      movie:
        max_medias: 3

Cant add upcoming for movies and I dont see any other sensors even after restart ( show / movie / recommendation etc)

There are five sensors available under the sensors > upcoming array: show for TV Shows (actually, episodes). Creates sensor.trakt_upcoming_shows new_show for New Shows (series premiers). Creates sensor.trakt_upcoming_new_shows

dylandoamaral commented 1 year ago

There are two issues at the same time here, it is difficult to handle them both at the same time...

Can you create a new issue please.

dylandoamaral commented 1 year ago

I tried a new release I am not very confident but maybe it will help.

Ofir-P commented 1 year ago

I tried a new release I am not very confident but maybe it will help.

Where can I see that?

dylandoamaral commented 1 year ago

On home assistant, in HACS you should see the update.

Ofir-P commented 1 year ago

On home assistant, in HACS you should see the update.

Uninstalled, updated via HACS, and reinstalled. image same issue.

echopage commented 1 year ago

Sorry for the delay... Same problem as Ofir-P, I redid the same procedure as Ofir-P with the difference that I'm not under Nabu-Casa, now it no longer gives me an oauth error but the result is the same, no sensor!

Ofir-P commented 1 year ago

@dylandoamaral image Somehow I got the sensors! Thanks man!!!