Kodi won't change to online

Hi together,

  • Platform information:
    • Hardware: PI 3
    • OS: openHABian/raspian
    • Java Runtime Environment: -
    • openHAB version:2.2.0 stable

I just tried to set up KODI for testing purposes and wanted to test openHAB integration as well.
KODI (openELEC) is running fine and is configured.

Before installing the binding, i have checked the needed settings according to the docs. https://docs.openhab.org/addons/bindings/kodi/readme.html#preparation

After installing the binding, my Kodi instance gets dicovered.
When I now want to add it, the thing gets offline immediately.

Before writing i have checked the ports:


and
image

Everything is set up according to the docs.

Logs with TRACE enabled:

22:54:19.666 [INFO ] [smarthome.event.InboxAddedEvent      ] - Discovery Result with UID 'kodi:kodi:0c3cfe8b-5ba6-5eb5-b325-ddac6b6a2d12' has been added.
22:54:19.666 [INFO ] [ig.discovery.internal.PersistentInbox] - Added new thing 'kodi:kodi:0c3cfe8b-5ba6-5eb5-b325-ddac6b6a2d12' to inbox.
22:55:00.758 [INFO ] [thome.event.ItemChannelLinkAddedEvent] - Link 'kodi_kodi_0c3cfe8b_5ba6_5eb5_b325_ddac6b6a2d12_volume-kodi:kodi:0c3cfe8b-5ba6-5eb5-b325-ddac6b6a2d12:volume' has been added.
22:55:00.820 [INFO ] [thome.event.ItemChannelLinkAddedEvent] - Link 'kodi_kodi_0c3cfe8b_5ba6_5eb5_b325_ddac6b6a2d12_mute-kodi:kodi:0c3cfe8b-5ba6-5eb5-b325-ddac6b6a2d12:mute' has been added.
22:55:00.853 [INFO ] [thome.event.ItemChannelLinkAddedEvent] - Link 'kodi_kodi_0c3cfe8b_5ba6_5eb5_b325_ddac6b6a2d12_control-kodi:kodi:0c3cfe8b-5ba6-5eb5-b325-ddac6b6a2d12:control' has been added.
22:55:00.885 [INFO ] [thome.event.ItemChannelLinkAddedEvent] - Link 'kodi_kodi_0c3cfe8b_5ba6_5eb5_b325_ddac6b6a2d12_stop-kodi:kodi:0c3cfe8b-5ba6-5eb5-b325-ddac6b6a2d12:stop' has been added.
22:55:00.955 [INFO ] [thome.event.ItemChannelLinkAddedEvent] - Link 'kodi_kodi_0c3cfe8b_5ba6_5eb5_b325_ddac6b6a2d12_title-kodi:kodi:0c3cfe8b-5ba6-5eb5-b325-ddac6b6a2d12:title' has been added.
22:55:01.026 [INFO ] [thome.event.ItemChannelLinkAddedEvent] - Link 'kodi_kodi_0c3cfe8b_5ba6_5eb5_b325_ddac6b6a2d12_showtitle-kodi:kodi:0c3cfe8b-5ba6-5eb5-b325-ddac6b6a2d12:showtitle' has been added.
22:55:01.149 [INFO ] [thome.event.ItemChannelLinkAddedEvent] - Link 'kodi_kodi_0c3cfe8b_5ba6_5eb5_b325_ddac6b6a2d12_album-kodi:kodi:0c3cfe8b-5ba6-5eb5-b325-ddac6b6a2d12:album' has been added.
22:55:01.233 [INFO ] [thome.event.ItemChannelLinkAddedEvent] - Link 'kodi_kodi_0c3cfe8b_5ba6_5eb5_b325_ddac6b6a2d12_artist-kodi:kodi:0c3cfe8b-5ba6-5eb5-b325-ddac6b6a2d12:artist' has been added.
22:55:01.365 [INFO ] [thome.event.ItemChannelLinkAddedEvent] - Link 'kodi_kodi_0c3cfe8b_5ba6_5eb5_b325_ddac6b6a2d12_mediatype-kodi:kodi:0c3cfe8b-5ba6-5eb5-b325-ddac6b6a2d12:mediatype' has been added.
22:55:01.451 [INFO ] [thome.event.ItemChannelLinkAddedEvent] - Link 'kodi_kodi_0c3cfe8b_5ba6_5eb5_b325_ddac6b6a2d12_thumbnail-kodi:kodi:0c3cfe8b-5ba6-5eb5-b325-ddac6b6a2d12:thumbnail' has been added.
22:55:01.563 [INFO ] [thome.event.ItemChannelLinkAddedEvent] - Link 'kodi_kodi_0c3cfe8b_5ba6_5eb5_b325_ddac6b6a2d12_fanart-kodi:kodi:0c3cfe8b-5ba6-5eb5-b325-ddac6b6a2d12:fanart' has been added.
22:55:01.733 [INFO ] [smarthome.event.InboxRemovedEvent    ] - Discovery Result with UID 'kodi:kodi:0c3cfe8b-5ba6-5eb5-b325-ddac6b6a2d12' has been removed.
22:55:01.912 [INFO ] [smarthome.event.ItemStateChangedEvent] - kodi_kodi_0c3cfe8b_5ba6_5eb5_b325_ddac6b6a2d12_volume changed from NULL to 100
22:55:05.033 [DEBUG] [org.openhab.binding.kodi             ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.audio.AudioSink}={service.id=458, service.bundleid=254, service.scope=singleton} - org.openhab.binding.kodi
22:55:05.078 [INFO ] [smarthome.event.ItemStateChangedEvent] - kodi_kodi_0c3cfe8b_5ba6_5eb5_b325_ddac6b6a2d12_mute changed from NULL to OFF
22:55:05.180 [DEBUG] [kodi.internal.protocol.KodiConnection] - checkConnection: try to connect to Kodi ws://192.168.178.192:9090/jsonrpc
22:55:05.194 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'kodi:kodi:0c3cfe8b-5ba6-5eb5-b325-ddac6b6a2d12' changed from UNINITIALIZED to INITIALIZING
22:55:06.218 [DEBUG] [kodi.internal.protocol.KodiConnection] - checkConnection: try to connect to Kodi ws://192.168.178.192:9090/jsonrpc
22:55:06.259 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'kodi:kodi:0c3cfe8b-5ba6-5eb5-b325-ddac6b6a2d12' changed from INITIALIZING to OFFLINE
22:55:07.288 [INFO ] [smarthome.event.ItemStateChangedEvent] - date_today changed from 2018-01-25T22:54:07.263+0100 to 2018-01-25T22:55:07.271+0100
22:55:16.258 [DEBUG] [kodi.internal.protocol.KodiConnection] - checkConnection: try to connect to Kodi ws://192.168.178.192:9090/jsonrpc
22:55:26.293 [DEBUG] [kodi.internal.protocol.KodiConnection] - checkConnection: try to connect to Kodi ws://192.168.178.192:9090/jsonrpc
22:55:38.881 [DEBUG] [kodi.internal.protocol.KodiConnection] - checkConnection: try to connect to Kodi ws://192.168.178.192:9090/jsonrpc
22:55:48.912 [DEBUG] [kodi.internal.protocol.KodiConnection] - checkConnection: try to connect to Kodi ws://192.168.178.192:9090/jsonrpc
22:55:58.968 [DEBUG] [kodi.internal.protocol.KodiConnection] - checkConnection: try to connect to Kodi ws://192.168.178.192:9090/jsonrpc
22:56:09.076 [DEBUG] [kodi.internal.protocol.KodiConnection] - checkConnection: try to connect to Kodi ws://192.168.178.192:9090/jsonrpc
22:56:19.103 [DEBUG] [kodi.internal.protocol.KodiConnection] - checkConnection: try to connect to Kodi ws://192.168.178.192:9090/jsonrpc
...

I am a bit lost now.
Have I missed something?

I have tried to ad a thing manually by file too.
I have uninstalled and reinstalled the binding already.

The logs are telling me … nothing.
Has anyone a solution for this?

Thanks in advance and BR
Jerome

GNAH forget it.
Error was in front of the screen…
I missed one setting and after checking again it went online now…

Post your finding so others can learn.

Already did:

With a bit of depth:

https://docs.openhab.org/addons/bindings/kodi/readme.html#preparation

tells 2 places for doing settings:

Settings ➔ Services ➔ UPnP / DLNA ➔ Allow remote control via UPnP

and

Settings ➔ Services ➔ Control ➔ Allow remote control from applications on this/other systems


I made those changes and simply didn’t recognize that the second one is done with 2 independent options.

Like:

Settings ➔ Services ➔ Control ➔ Allow remote control from applications on this system => 1 Switch
Settings ➔ Services ➔ Control ➔ Allow remote control from applications on other systems => 1 Switch

I didn’t change the second one, but found it while looking through all settings again.

Do you think we should point that out in the docs? Maybe add a link to the Kodi Wiki? http://kodi.wiki/view/Settings/Services/Control

Yes i think at least a small clarification would be useful.

Maybe i am not the only one who reads the docs and thinks “Ok i have to change 2 settings in 2 different subemenus now”.
(of course just because i didn’t read careful enough, but to be honest who does this all the time? :smile:)

My proposal would be to seperate the corresponding setting into 2 lines like i did above.
I can file an PR this Weekend if you would find that useful too. :slight_smile:

That would be very much appreciated. Thanks.

1 Like

For the record:

PR filed and already merged

Perfect. Thanks.

I can’t get the Kodi binding to work either but I believe the Kodi settings are correct as described in this thread.

In paper UI, the Kodi media device remains Uninitialized and making any changes to the settings in paper UI gives a server Error 500 message.

I’ve cleared the caches, reinstalled the binding, restarted the system etc etc and the log gives:

2019-06-27 10:50:59.913 [ERROR] [st.core.internal.thing.ThingResource] - Exception during HTTP PUT request for update config at 'things/kodi:kodi:xxxxxxxx/config'
java.lang.IllegalStateException: Thing with UID kodi:kodi:xxxxxxxx has no handler attached.
	at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.updateConfiguration(ThingRegistryImpl.java:94) ~[?:?]
	at org.eclipse.smarthome.io.rest.core.internal.thing.ThingResource.updateConfiguration(ThingResource.java:438) [119:org.eclipse.smarthome.io.rest.core:0.10.0.201810141956]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]

etc

Any ideas?

Thanks!

I’ve also tried removing any instances of Kodi Things from the JSONdb file and creating a Kodi thing in a Kodi.thing file:

Thing kodi:kodi:myKodi "Kodi" @ "TV Room" [ipAddress="192.168.1.90", port=9090, httpPort=8080] {

Channels:

    Type switch : osmcMute     "Kodi mute"  [ channel="kodi:kodi:myKodi:mute" ]
    Type dimmer : osmcVolume   "volume"     [channel="kodi:kodi:myKodi:volume" ]
    Type player : osmcPlayer   "control"    [ channel="kodi:kodi:myKodi:control" ]
    Type switch : osmcStop     "Kodi stop"  [ channel="kodi:kodi:myKodi:stop" ]
}

That doesn’t work either. How would I know that the Thing was online or initialized? I assume it would appear in HABmin (it doesn’t).

Do I need the items in an item file or as channels in my example above? I tried both and neither worked.

openHAB 2.4
Kodi binding 2.4 snapshot.

Any ideas?

Thanks!

It appears that the Kodi binding bundle is not starting. It’s “waiting”. I’ve re-installed it, stopped it, started it and restarted it and it’s still waiting.

Debug log when editing the Kodi thing in Paper UI:

2019-07-03 14:39:31.840 [ERROR] [st.core.internal.thing.ThingResource] - Exception during HTTP PUT request for update config at 'things/kodi:kodi:8f8a8e67/config'
java.lang.IllegalStateException: Thing with UID kodi:kodi:8f8a8e67 has no handler attached.
	at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.updateConfiguration(ThingRegistryImpl.java:94) ~[?:?]
	at org.eclipse.smarthome.io.rest.core.internal.thing.ThingResource.updateConfiguration(ThingResource.java:438) [119:org.eclipse.smarthome.io.rest.core:0.10.0.201810141956]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) [171:org.glassfish.jersey.core.jersey-server:2.22.2]
... etc

2019-07-03 14:47:05.340 [DEBUG] [scovery.KodiUpnpDiscoveryParticipant] - Manufacturer matched: search: XBMC Foundation, device value: XBMC Foundation.
2019-07-03 14:47:05.343 [DEBUG] [scovery.KodiUpnpDiscoveryParticipant] - Device type matched: search: MediaRenderer, device value: MediaRenderer.
2019-07-03 14:47:05.563 [INFO ] 

Any ideas?

You shouldn’t need a Kodi thing file, all channels should be discovered and added from PaperUI.
Check that the IP/ports are the same configured on your Kodi server, make sure that you have enabled remote control from Kodi.

Thank you for taking the time to reply. I had deleted the Kodi.thing file some time ago, cleared the caches etc…
The Kodi thing, as found in PaperUI, remains uninitialized.
When trying to set the password, or user name, I get a server error 500 message.
The password created automatically in the jsondb is

      "httpPassword": "8320444fde9a59ba",

All Kodi settings are correct.

A restart (after clearing the cache), shows:

2019-07-04 14:35:19.947 [DEBUG] [org.openhab.binding.kodi            ] - BundleEvent STARTING - org.openhab.binding.kodi
2019-07-04 14:35:19.971 [DEBUG] [org.openhab.binding.kodi            ] - BundleEvent STARTED - org.openhab.binding.kodi
2019-07-04 14:35:19.988 [DEBUG] [org.openhab.binding.kodi            ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.type.DynamicStateDescriptionProvider, org.openhab.binding.kodi.internal.KodiDynamicStateDescriptionProvider}={service.id=365, service.bundleid=229, service.scope=bundle, component.name=org.openhab.binding.kodi.internal.KodiDynamicStateDescriptionProvider, component.id=215} - org.openhab.binding.kodi
2019-07-04 14:35:20.134 [DEBUG] [org.openhab.binding.kodi            ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.upnp.UpnpDiscoveryParticipant}={service.id=366, service.bundleid=229, service.scope=bundle, component.name=org.openhab.binding.kodi.internal.discovery.KodiUpnpDiscoveryParticipant, component.id=217} - org.openhab.binding.kodi
2019-07-04 14:35:20.142 [DEBUG] [org.openhab.binding.kodi            ] - BundleEvent [unknown:512] - org.openhab.binding.kodi

and then further down:

[st.core.internal.thing.ThingResource] - Exception during HTTP PUT request for update config at 'things/kodi:kodi:8f8a8e67/config'
java.lang.IllegalStateException: Thing with UID kodi:kodi:8f8a8e67 has no handler attached.
	at 

I have removed any Kodi related items.

When I manually remove the Kodi entry in the JSONdb file and delete the PaperUI created thing, clear the caches and restart, a new Kodi thing appears in the PaperUI inbox. All well and good.
However, when I select it I get an Conflict Error 409 error - as if a Kodi thing already exists.

The log shows this:

2019-07-04 15:49:23.741 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'kodi:kodi:9da5ebf7-83b4-bd97-1b37-f8b7f4901aaa' to inbox.
2019-07-04 16:18:27.258 [WARN ] [g.discovery.internal.PersistentInbox] - Cannot create thing. No binding found that supports creating a thing of type kodi:kodi.
2019-07-04 16:18:33.779 [WARN ] 

My next question is, apart from manually created thing files and the JSONdb thing file, where else is data on a thing stored so I clear them out?

Really not sure what else to do.

Thanks.

Maybe you can try to setup the Kodi connection without user/password first and add them only once you successfully complete the basic setup.

I don’t think I ever removed something manually to avoid these kind of inconsistencies.

If the error reads “No binding found…” I would try to reinstall the Kodi binding and search again for the kodi thing.

I’ve done all that, several times.

Hope it’s okay to repeat my question.

Someone must know if ‘Thing’ data is stored anywhere apart from in this file:

org.eclipse.smarthome.core.thing.Thing

In my case, this does not contain a Kodi Thing but when I try and add the one discovered in my inbox, I get error 409 - conflict.

Thanks in advance for any more pointers!