Kodi - Media Player Configuration

This is just a dumb question about how my Kodi displays in Lovelace.

I have a Vero running OSMC with Kodi. This is automatically detected in Home Assistant since a few versions ago.

Before it was auto-=detected, I manually added Kodi in config.yaml:

media_player:
  - platform: kodi
    host: !secret my_kodi_host
    enable_websocket: true

What is confusing me is when I have both the discovered one and the manually configured one, it shows different information.
This is what shows when it’s playing:


This is when it’s not playing:

In the dev tools states, the info there is also different:

image

So I don’t understand why they don’t show the same information??? If they did I would just get rid of one of them. It’s nice that the OSMC one shows the last played even when it’s ‘off’

That is rather odd. The immediate thing I notice is the supported_features is different, which may make a difference in presentation in the UI. You need to look at the media_player component to see what these mean.

It makes no sense. Both are on the same IP address etc… the supported features don’t seem to be documented that I can see.

Yeah you need to look at the source, they are bitwise. For media_player they are:

SUPPORT_PAUSE = 1
SUPPORT_SEEK = 2
SUPPORT_VOLUME_SET = 4
SUPPORT_VOLUME_MUTE = 8
SUPPORT_PREVIOUS_TRACK = 16
SUPPORT_NEXT_TRACK = 32

SUPPORT_TURN_ON = 128
SUPPORT_TURN_OFF = 256
SUPPORT_PLAY_MEDIA = 512
SUPPORT_VOLUME_STEP = 1024
SUPPORT_SELECT_SOURCE = 2048
SUPPORT_STOP = 4096
SUPPORT_CLEAR_PLAYLIST = 8192
SUPPORT_PLAY = 16384
SUPPORT_SHUFFLE_SET = 32768
SUPPORT_SELECT_SOUND_MODE = 65536

See here

Ok but still doesn’t really explain why it’s doing this.

So the first one (21053) supports:

SUPPORT_PAUSE = 1
SUPPORT_VOLUME_SET = 4
SUPPORT_VOLUME_MUTE = 8
SUPPORT_PREVIOUS_TRACK = 16
SUPPORT_NEXT_TRACK = 32
SUPPORT_PLAY_MEDIA = 512
SUPPORT_STOP = 4096
SUPPORT_PLAY = 16384

No it doesn’t!

1 Like

And the other supports these (and yes it perhaps doesn’t help but I am recording my analysis as much as anything.)

SUPPORT_PAUSE = 1
SUPPORT_SEEK = 2
SUPPORT_VOLUME_SET = 4
SUPPORT_VOLUME_MUTE = 8
SUPPORT_PREVIOUS_TRACK = 16
SUPPORT_NEXT_TRACK = 32
SUPPORT_PLAY_MEDIA = 512
SUPPORT_VOLUME_STEP = 1024
SUPPORT_STOP = 4096
SUPPORT_PLAY = 16384
SUPPORT_SHUFFLE_SET = 32768

Appreciate your input. So weird. I maybe should log an issue

I’m on team kodi, but not as a programmer. I like to see it working :slight_smile:

1 Like

Issue here: https://github.com/home-assistant/home-assistant/issues/18040

Thanks Nick.

Sorry to but-in…
I might set up Discovery for my Kodi, what do you do about the Web Interface HTTP password? I mean how does HA know what it is?

I also have this in my configuration @klogg

# Discover some devices automatically
discovery:
  enable:
    - dlna_dmr

The component doc is here I don’t see any way to add a username and password… In my case it’s on my local network and the last thing I want to do is use auth for Kodi. If I wanted to access it externally I’d just add it to my caddyfile proxy and it’s own subdomain.

The Kodi docs do allow username/password… maybe try that with discovery as well in the dlna_dmr - seems similar format… worth a try?

Mine don’t have passwords either.

Adding credentials stops some of the functions working like the image display etc once password is removed it displays as normal with Leia on libreelec

Will report back with logs later

Regards

Ex team xbmc developer C-Quel