Kodi REWIND/FASTFORWARD not working

Hi,

I have a Vero 4K box with OSMC (Kodi 17.3), which is controlled by OpenHab2. Most of the controls are working correctly with the Kodi binding, but I cannot get REWIND and FASTFORWARD to work.

I have the following item in my kodi.items:

Player	kodi_control			"Control"				{ channel="kodi:kodi:2cd68910:control" }

I have two widgets of type template, which are sending the following commands

sendCmd('kodi_control', 'REWIND')
sendCmd('kodi_control', 'FASTFORWARD')

…but nothing happens.

The event.logs-logfile states:

2017-06-26 19:57:32.888 [ItemCommandEvent          ] - Item 'kodi_control' received command FASTFORWARD
2017-06-26 19:57:32.972 [ItemStateChangedEvent     ] - kodi_control changed from PLAY to FASTFORWARD

…but actually nothing is happening.

When controlling the box via Chorus (http://ip-address:8080), FastForward/Rewind are working perfectly, but noth within my HabPanel :frowning:

What am I doing wrong?

Hey Peter,

I currently have no answer for you. I will test it in my environment tomorrow. In the meantime I ask you kindly to set the log level of the Kodi binding to DEBUG, evaluate and post what happens in your log file after sending those commands to the control channel.

Confirmed. It does not work. I will open an issue in OH2.

Sending FASTWORWARD:

2017-07-04 21:07:25.605 [DEBUG] [i.internal.protocol.KodiClientSocket] - send message: {"jsonrpc":"2.0","id":103,"method":"Player.SetSpeed","params":{"playerid":1,"speed":"2"}}
2017-07-04 21:07:25.610 [DEBUG] [i.internal.protocol.KodiClientSocket] - Message received from server: {"error":{"code":-32602,"data":{"method":"Player.SetSpeed","stack":{"message":"Received value does not match any of the union type definitions","name":"speed","type":["string","integer"]}},"message":"Invalid params."},"id":103,"jsonrpc":"2.0"}
2017-07-04 21:07:25.612 [DEBUG] [i.internal.protocol.KodiClientSocket] - Response received from server: {"error":{"code":-32602,"data":{"method":"Player.SetSpeed","stack":{"message":"Received value does not match any of the union type definitions","name":"speed","type":["string","integer"]}},"message":"Invalid params."},"id":103,"jsonrpc":"2.0"}
2017-07-04 21:07:25.613 [DEBUG] [i.internal.protocol.KodiClientSocket] - callMethod returns {"error":{"code":-32602,"data":{"method":"Player.SetSpeed","stack":{"message":"Received value does not match any of the union type definitions","name":"speed","type":["string","integer"]}},"message":"Invalid params."},"id":103,"jsonrpc":"2.0"}

Sending REWIND:

2017-07-04 21:12:25.842 [DEBUG] [i.internal.protocol.KodiClientSocket] - send message: {"jsonrpc":"2.0","id":165,"method":"Player.SetSpeed","params":{"playerid":1,"speed":"-1"}}
2017-07-04 21:12:25.845 [DEBUG] [i.internal.protocol.KodiClientSocket] - Message received from server: {"error":{"code":-32602,"data":{"method":"Player.SetSpeed","stack":{"message":"Received value does not match any of the union type definitions","name":"speed","type":["string","integer"]}},"message":"Invalid params."},"id":165,"jsonrpc":"2.0"}
2017-07-04 21:12:25.846 [DEBUG] [i.internal.protocol.KodiClientSocket] - Response received from server: {"error":{"code":-32602,"data":{"method":"Player.SetSpeed","stack":{"message":"Received value does not match any of the union type definitions","name":"speed","type":["string","integer"]}},"message":"Invalid params."},"id":165,"jsonrpc":"2.0"}
2017-07-04 21:12:25.848 [DEBUG] [i.internal.protocol.KodiClientSocket] - callMethod returns {"error":{"code":-32602,"data":{"method":"Player.SetSpeed","stack":{"message":"Received value does not match any of the union type definitions","name":"speed","type":["string","integer"]}},"message":"Invalid params."},"id":165,"jsonrpc":"2.0"}

Issue #2429:

PR #2434

Hi Christoph,

thanks for confirming and raising the issue. I was just unsure whether or not I was doing something wrong.

By the way, “Input.ShowCodec” is not working either. Because it was not that important for me, I did not mention it.

2017-07-04 21:37:19.617 [DEBUG] [i.internal.protocol.KodiClientSocket] - send message: {"jsonrpc":"2.0","id":49,"method":"Input.ShowCodec"} 2017-07-04 21:37:19.632 [DEBUG] [i.internal.protocol.KodiClientSocket] - Message received from server: {"error":{"code":-32601,"message":"Method not found."},"id":49,"jsonrpc":"2.0"} 2017-07-04 21:37:19.632 [DEBUG] [i.internal.protocol.KodiClientSocket] - Response received from server:{"error":{"code":-32601,"message":"Method not found."},"id":49,"jsonrpc":"2.0"} 2017-07-04 21:37:19.632 [DEBUG] [i.internal.protocol.KodiClientSocket] - callMethod returns {"error":{"code":-32601,"message":"Method not found."},"id":49,"jsonrpc":"2.0"}

Hi Peter,

you are welcome.

One question: At wich time is the “Input.ShowCodec” request triggered? I do not know this method.

Hi Christoph,

the method is used in the (HabPanel-)remote control to display information about the codec used in the current movie file.

Best regards

Hi Peter,

I never used that input channel before. Investigating the problem should take some time. The request seems to be correct (see documentation JSON-RPC-API). Maybe you should open an issue in OH2.

Hi Christoph,

okay, I did:
https://github.com/openhab/openhab2-addons/issues/2442.

Christoph, another (maybe dumb) question: Is it also possible/allowed to open issues for improvements?

It would e.g. IMHO be a great improvement if it would be possible to double the REWIND/FASTFORWARD speed when sending it another time (up to the maximum allowed speed). I would actually implement it myself, but I’m still wondering how to check the repository out correctly (I’m used to Subversion…).

Edit: Check out actually succeeded. But how can I run OH2 directly from Eclipse? When I run the OpenHab_Runtime, OH2 actually starts, but I am not able to install/use any bindings (e.g. Kodi). Is it possible to easily use the configuration of my locally installed OH2? HabPanel is also missing…

Hi Peter,

first of all it is not a dumb question. I am happy you asked. Both, opening issues for improvements and contributions, are very much appreciated.

Your idea is great. It came to my mind, too. Please implement it. If you need any help just ask.

First step is done. If you know Subversion it is not that hard to switch to Git. One big advantage of Git is that you can share your code with anybody you like.

I don’t know if you can run OH2 from eclipse. I only compile the bindings, I am working on. Each binding is put into a separate .jar file which one can copy to his environment, which runs OH2. So yes, you are able to use your local OH2. There exists a special folder for manually installed addons. I have for example a productiv and a development setup. Please have a look at the developer guide or search this forum for more information. There are a lot of good articles.

Hey Peter,

it is also possible to run OH in eclipse which helps a lot for debugging (break points etc). If you have used eclipse installer and checked the OH2 addons setup, everything is configured for you already. You click on the triangle next to the run or debug icon and select “Debug/Run configurations…”. There should be a target configured for Openhab in the left tree view. Select the tab “Plugins” in the right panel and select all plugins to be executed (like HabPanel etc). The documentation explains this in a greater detail actually :slight_smile:

Cheers, David

it is also possible to run OH in eclipse

Sounds cool. Thanks for the hint.

Thanks for the guidance, I will try this…

Hi Peter,

any news an this? Did you some progress? If not, should I look into it?

Hi Christoph,

nope, sorry. I did the implementation already, but I wasn’t able to test
it yet. I was not able to build that kodi-jar and to exchange it in my
test environment.

I’m used to eclipse and svn, but did not use maven yet.

Because I currently still have a lots of other things to do (to finish
my homecinema), OpenHab has moved down in my priority list…

Best regards,
Peter

Take your time. Just wanted to ask if you are on the road. Have fun setting up your home cinema.

In case someone stumbles on this Input.ShowCodec problem, let me copy/paste here what I also wrote in the github issue created by Peter:

This is not an openHAB or Kodi Binding issue. The Input.ShowCodec method no longer seems to exist in Kodi. When using curl I get the exact same “Method not found.” error:

# curl -s --data-binary '{"jsonrpc": "2.0", "method": "Input.ShowCodec", "id": 1}' -H 'content-type: application/json;' http://localhost:8080/jsonrpc
{"error":{"code":-32601,"message":"Method not found."},"id":1,"jsonrpc":"2.0"}

According to http://kodi.wiki/view/CodecInfo most of the ShowCodec info has been moved to the PlayerProcessInfo window.

# curl -s --data-binary '{"jsonrpc": "2.0", "method": "Input.ShowPlayerProcessInfo", "id": 1}' -H 'content-type: application/json;' http://localhost:8080/jsonrpc
{"id":1,"jsonrpc":"2.0","result":"OK"}

Executing:

# curl -s --data-binary '{"jsonrpc": "2.0", "method": "Input.ExecuteAction", "params":{"action":"codecinfo"}, "id": 1}' -H 'content-type: application/json;' http://localhost:8080/jsonrpc
{"id":1,"jsonrpc":"2.0","result":"OK"}

displays the same window.

Thanks for the information.

By the way, “Input.ShowCodec” is not working either.

@cyb7 Could you try to change your (HabPanel-)remote solution to use “Input.ShowPlayerProcessInfo”?

I can confirm that “Input.ShowPlayerProcessInfo” is working great, thank you!

Is there a way you can get the codec into a variable to be used in a rule? I want to change my amp based on the codec playing - not just see it on the screen