Did 0.28 break Kodi?

Any of you have problem with Kodi after upgrading to 0.28?

First (after upgrading) I noticed in the log that it could not login (which is strange as I did not change anything) then I added a username/password in kodi. Tested it (if have other software aso using direct communication with Kodi) and I’m sure Kodi is accessible.

Still no go.“homeassistant.components.media_player.kodi: Unable to fetch kodi data”

1 Like

Ok, I think something has changed in .28

According to documentation is should be:

  media_player:
     platform: kodi
     host: http://192.168.0.123
     port: 8080
     name: Kodi
     user: USERNAME
     password: PASSWORD
     turn_off_action: shutdown

However this does not work anymore. Maybe still not according to specs but this is what works in.28 (however still not loading fan art):

media_player kodi:
  platform: kodi
  host: http://192.168.0.123
  port: 8080
  username: username
  password: password
  turn_off_action: shutdown

Notice the change from “user” to “username” which makes sense as it is more consistent with the other components.

2 Likes

I think they are making efforts to standardize components that used to be separate and had their own config rules.

Hence the move to “climate” over thermostat and “weather” becoming more source specific.

I migrated the kodi media player platform to do configuration checks. As far as I remember was it not a breaking change, only user is now username. Sorry, the docs were not up-to-date.

It’s wired that voluptuous didn’t catch the error. Does the platform work beside the fan art issue?

1 Like

Did not test in detail buy play, stop pause was working fine. As mentioned no fan art (this worked fine before .28).

p.s. I double checked the documentation; it mentiones ‘username’ at the lower part of the page but not the code snippet (that one has still ‘user’)

Docs are re-building as we speak :wink:

1 Like

@fabaff any idea how to fix the fanart issue? Thanks

Not right now as I have no Kodi instance to test it.

A new issue would help to track the fanart problem.

As mentioned here 0.28 (+.28.1 & .28.2) missing fanart Kodi #3383

Fanart has never worked properly when using a username & password. This is because when using a username & password, the img url needs to be formatted as “http://USER:PASS@IPADDRESS/image/…”

As a quick hack/fix, I copied the kodi component to my custom_components/media_player/my_kodi.py then modified/hacked it to get it working.

Adding this @ line 78 hard coding my username & password. “MYUSER = kodi username, MYPASS = kodi password”
self._img_url = url.replace("http://", "http://MYUSER:MYPASS@")

Then I modified the “_get_image_url” function, replacing self._url with self._img_url

def _get_image_url(self):
    """Helper function that parses the thumbnail URLs used by Kodi."""
    url_components = urllib.parse.urlparse(self._item['thumbnail'])

    if url_components.scheme == 'image':
        return '{}/image/{}'.format(
            self._img_url,
            urllib.parse.quote_plus(self._item['thumbnail']))

This was just a quick hack to get it working until I had time to play around with a proper fix or sombody with more python knowledge than me had a chance to fix it as my python skill level is just barely novice. :wink:

1 Like

Good addition! By the way, I also did not know about the my custom_components. Good info