Page 13 of 18

Re: Kodi Mediaserver Support

Posted: Sunday 08 January 2017 0:04
by Trigun
jake wrote:
Trigun wrote:Hi All,

I hope if anyone can help me.
I am looking to find a way to control Kodi with domoticz.
I was thinking of using a multi selector switch with, for example: Play, Pauze, Stop.

Is there an easy way to do this?
I am new to scripting though :(
Have a look first of all on the Kodi wiki page on domoticz.com. The 'standard' Kodi hardware support already offers a play pause stop through LUA

Hi jake,

Thank you for taking the effort to reply.
I already had a look at the wiki page and with blocky I managed to setup a sort of scene. But the goal is to have one selector switch with three "buttons". I don't know how it works but I can't be far off.

Thanks again!!

Grtz!

Re: Kodi Mediaserver Support

Posted: Monday 09 January 2017 20:24
by jake
Trigun wrote:
jake wrote:
Trigun wrote:Hi All,

I hope if anyone can help me.
I am looking to find a way to control Kodi with domoticz.
I was thinking of using a multi selector switch with, for example: Play, Pauze, Stop.

Is there an easy way to do this?
I am new to scripting though :(
Have a look first of all on the Kodi wiki page on domoticz.com. The 'standard' Kodi hardware support already offers a play pause stop through LUA

Hi jake,

Thank you for taking the effort to reply.
I already had a look at the wiki page and with blocky I managed to setup a sort of scene. But the goal is to have one selector switch with three "buttons". I don't know how it works but I can't be far off.
Grtz!
To my understanding, you need some LUA to get this going.

With a program like 'Notepad++', create file with the name script_device_kodi.lua and put it in the domoticz/scrips/lua folder

Put the following code in it. With this code it will control 2 things:

- Control Kodi when clicked on Play, Pause, Stop (or whatever language you want to see on the dashboard, you can set it in the first lines)
- Update the multi selector buttons when you operate Kodi with another remote control, or when a song / video is finished and Kodi will return to 'On'

What's needed:
- A virtual multi switch
- Kodi Hardware defined

Make note of the switch name of the 'virtual multi switch name' and 'Kodi hardware' (case sensitive).
Set and make note of the different levels that have to be defined for the multi switch: the 'level' number and 'level name'
Set the above in the first lines of code:

Code: Select all

-- Title: script_device_kodi
-- Date: 09-01-2017 
-- Start, Pause and Stop media playing on Kodi driven media center

-- Define local variables to match (virtual) hardware in Domoticz

-- Make sure capital letters are matching ('Kodi Media Center' is something different than 'kodi media center'), so everything is case sensitive

local kodidevice = 'Kodi Media Center' -- The name of the Kodi Hardware as it can be found in the 'switches' page
local kodi_multiswitch = 'Kodi Remote' -- the name of the self made virtual multi-selector as it can be found in the 'switches' page
-- The following lines are to define the different levels of the selector switch
local kodiplay = "Play" -- by using a variable the possibility is to use a local language on the dashboard (level name)
local kodiplay_level = "0" -- level value of the 'Play' level name
local kodipause = "Pause" -- by using a variable the possibility is to use a local language on the dashboard (level name)
local kodipause_level = "10" -- level value of the 'Pause' level name
local kodistop = "Stop"  -- by using a variable the possibility is to use a local language on the dashboard (level name)
local kodistop_level = "20" -- level value of the 'Stop' level name

-- No need to change anything below this line

commandArray = {}
-- Set Kodi to react to input of selector switch in Domoticz
if (devicechanged[kodi_multiswitch] == kodiplay and (otherdevices [kodidevice] ~= "Audio" and otherdevices [kodidevice] ~= "Video")) then
	commandArray [kodidevice] = "Play"
elseif (devicechanged[kodi_multiswitch] == kodipause and otherdevices [kodidevice] ~= "Paused") then
	commandArray [kodidevice] = "Pause"
elseif (devicechanged[kodi_multiswitch] == kodistop and otherdevices [kodidevice] ~= "On") then
	commandArray [kodidevice] = "Stop"
end

-- Set selector switch in Domoticz to react to status change of Kodi
if ((devicechanged[kodidevice] == "Audio" or devicechanged[kodidevice] == "Video") and otherdevices [kodi_multiswitch] ~= kodiplay) then
	commandArray [kodi_multiswitch] = 'Set Level: ' .. kodiplay_level
elseif (devicechanged[kodidevice] == "Paused" and otherdevices [kodi_multiswitch] ~= kodipause) then
	commandArray [kodi_multiswitch] = 'Set Level: ' .. kodipause_level
elseif (devicechanged[kodidevice] == "On" and otherdevices [kodi_multiswitch] ~= kodistop) then
	commandArray [kodi_multiswitch] = 'Set Level: ' .. kodistop_level
end


return commandArray
Enjoy!

Re: Kodi Mediaserver Support

Posted: Monday 09 January 2017 20:54
by Trigun
jake wrote:
Trigun wrote:
jake wrote: Have a look first of all on the Kodi wiki page on domoticz.com. The 'standard' Kodi hardware support already offers a play pause stop through LUA

Hi jake,

Thank you for taking the effort to reply.
I already had a look at the wiki page and with blocky I managed to setup a sort of scene. But the goal is to have one selector switch with three "buttons". I don't know how it works but I can't be far off.
Grtz!
To my understanding, you need some LUA to get this going.

With a program like 'Notepad++', create file with the name script_device_kodi.lua and put it in the domoticz/scrips/lua folder

Put the following code in it. With this code it will control 2 things:

- Control Kodi when clicked on Play, Pause, Stop (or whatever language you want to see on the dashboard, you can set it in the first lines)
- Update the multi selector buttons when you operate Kodi with another remote control, or when a song / video is finished and Kodi will return to 'On'

What's needed:
- A virtual multi switch
- Kodi Hardware defined

Make note of the switch name of the 'virtual multi switch name' and 'Kodi hardware' (case sensitive).
Set and make note of the different levels that have to be defined for the multi switch: the 'level' number and 'level name'
Set the above in the first lines of code:

Code: Select all

-- Title: script_device_kodi
-- Date: 09-01-2017 
-- Start, Pause and Stop media playing on Kodi driven media center

-- Define local variables to match (virtual) hardware in Domoticz

-- Make sure capital letters are matching ('Kodi Media Center' is something different than 'kodi media center'), so everything is case sensitive

local kodidevice = 'Kodi Media Center' -- The name of the Kodi Hardware as it can be found in the 'switches' page
local kodi_multiswitch = 'Kodi Remote' -- the name of the self made virtual multi-selector as it can be found in the 'switches' page
-- The following lines are to define the different levels of the selector switch
local kodiplay = "Play" -- by using a variable the possibility is to use a local language on the dashboard (level name)
local kodiplay_level = "0" -- level value of the 'Play' level name
local kodipause = "Pause" -- by using a variable the possibility is to use a local language on the dashboard (level name)
local kodipause_level = "10" -- level value of the 'Pause' level name
local kodistop = "Stop"  -- by using a variable the possibility is to use a local language on the dashboard (level name)
local kodistop_level = "20" -- level value of the 'Stop' level name

-- No need to change anything below this line

commandArray = {}
-- Set Kodi to react to input of selector switch in Domoticz
if (devicechanged[kodi_multiswitch] == kodiplay and (otherdevices [kodidevice] ~= "Audio" and otherdevices [kodidevice] ~= "Video")) then
	commandArray [kodidevice] = "Play"
elseif (devicechanged[kodi_multiswitch] == kodipause and otherdevices [kodidevice] ~= "Paused") then
	commandArray [kodidevice] = "Pause"
elseif (devicechanged[kodi_multiswitch] == kodistop and otherdevices [kodidevice] ~= "On") then
	commandArray [kodidevice] = "Stop"
end

-- Set selector switch in Domoticz to react to status change of Kodi
if ((devicechanged[kodidevice] == "Audio" or devicechanged[kodidevice] == "Video") and otherdevices [kodi_multiswitch] ~= kodiplay) then
	commandArray [kodi_multiswitch] = 'Set Level: ' .. kodiplay_level
elseif (devicechanged[kodidevice] == "Paused" and otherdevices [kodi_multiswitch] ~= kodipause) then
	commandArray [kodi_multiswitch] = 'Set Level: ' .. kodipause_level
elseif (devicechanged[kodidevice] == "On" and otherdevices [kodi_multiswitch] ~= kodistop) then
	commandArray [kodi_multiswitch] = 'Set Level: ' .. kodistop_level
end


return commandArray
Enjoy!

Hi Jake,

thanks a lot for your reply!
I am sure this is going to help, I am going to try it right away!
I'll let you know the outcome!

thanks again for your help!

Cheers

Re: Kodi Mediaserver Support

Posted: Monday 09 January 2017 21:18
by Trigun
Trigun wrote:
jake wrote:
Trigun wrote:

Hi jake,

Thank you for taking the effort to reply.
I already had a look at the wiki page and with blocky I managed to setup a sort of scene. But the goal is to have one selector switch with three "buttons". I don't know how it works but I can't be far off.
Grtz!
To my understanding, you need some LUA to get this going.

With a program like 'Notepad++', create file with the name script_device_kodi.lua and put it in the domoticz/scrips/lua folder

Put the following code in it. With this code it will control 2 things:

- Control Kodi when clicked on Play, Pause, Stop (or whatever language you want to see on the dashboard, you can set it in the first lines)
- Update the multi selector buttons when you operate Kodi with another remote control, or when a song / video is finished and Kodi will return to 'On'

What's needed:
- A virtual multi switch
- Kodi Hardware defined

Make note of the switch name of the 'virtual multi switch name' and 'Kodi hardware' (case sensitive).
Set and make note of the different levels that have to be defined for the multi switch: the 'level' number and 'level name'
Set the above in the first lines of code:

Code: Select all

-- Title: script_device_kodi
-- Date: 09-01-2017 
-- Start, Pause and Stop media playing on Kodi driven media center

-- Define local variables to match (virtual) hardware in Domoticz

-- Make sure capital letters are matching ('Kodi Media Center' is something different than 'kodi media center'), so everything is case sensitive

local kodidevice = 'Kodi Media Center' -- The name of the Kodi Hardware as it can be found in the 'switches' page
local kodi_multiswitch = 'Kodi Remote' -- the name of the self made virtual multi-selector as it can be found in the 'switches' page
-- The following lines are to define the different levels of the selector switch
local kodiplay = "Play" -- by using a variable the possibility is to use a local language on the dashboard (level name)
local kodiplay_level = "0" -- level value of the 'Play' level name
local kodipause = "Pause" -- by using a variable the possibility is to use a local language on the dashboard (level name)
local kodipause_level = "10" -- level value of the 'Pause' level name
local kodistop = "Stop"  -- by using a variable the possibility is to use a local language on the dashboard (level name)
local kodistop_level = "20" -- level value of the 'Stop' level name

-- No need to change anything below this line

commandArray = {}
-- Set Kodi to react to input of selector switch in Domoticz
if (devicechanged[kodi_multiswitch] == kodiplay and (otherdevices [kodidevice] ~= "Audio" and otherdevices [kodidevice] ~= "Video")) then
	commandArray [kodidevice] = "Play"
elseif (devicechanged[kodi_multiswitch] == kodipause and otherdevices [kodidevice] ~= "Paused") then
	commandArray [kodidevice] = "Pause"
elseif (devicechanged[kodi_multiswitch] == kodistop and otherdevices [kodidevice] ~= "On") then
	commandArray [kodidevice] = "Stop"
end

-- Set selector switch in Domoticz to react to status change of Kodi
if ((devicechanged[kodidevice] == "Audio" or devicechanged[kodidevice] == "Video") and otherdevices [kodi_multiswitch] ~= kodiplay) then
	commandArray [kodi_multiswitch] = 'Set Level: ' .. kodiplay_level
elseif (devicechanged[kodidevice] == "Paused" and otherdevices [kodi_multiswitch] ~= kodipause) then
	commandArray [kodi_multiswitch] = 'Set Level: ' .. kodipause_level
elseif (devicechanged[kodidevice] == "On" and otherdevices [kodi_multiswitch] ~= kodistop) then
	commandArray [kodi_multiswitch] = 'Set Level: ' .. kodistop_level
end


return commandArray
Enjoy!

Hi Jake,

thanks a lot for your reply!
I am sure this is going to help, I am going to try it right away!
I'll let you know the outcome!

thanks again for your help!

Cheers

Hi Jake,

The script works partially.
so far only the "Stop"function works.
maybe a dumb question but I assume I have to add the script to the "selector actions"?
I assume this will be: script://script_device_kodi.lua?

thanks again!

Re: Kodi Mediaserver Support

Posted: Monday 09 January 2017 21:37
by jake
Trigun wrote: Hi Jake,

The script works partially.
so far only the "Stop"function works.
maybe a dumb question but I assume I have to add the script to the "selector actions"?
I assume this will be: script://script_device_kodi.lua?

thanks again!
No, just put the lua file in the domoticz/scripts/lua folder and have your 3 buttons set up. Choose type 'Selector'. I named the selector levels as following 0 = Play, 10 = Pause, 20= Stop
Make sure to take care of the CAPITAL letters (doesn't matter what you choose, but put the same in the lua file variables.

No need to put something in the selector page actions, leave them empty.

Re: Kodi Mediaserver Support

Posted: Monday 09 January 2017 22:41
by Trigun
jake wrote:
Trigun wrote: Hi Jake,

The script works partially.
so far only the "Stop"function works.
maybe a dumb question but I assume I have to add the script to the "selector actions"?
I assume this will be: script://script_device_kodi.lua?

thanks again!
No, just put the lua file in the domoticz/scripts/lua folder and have your 3 buttons set up. Choose type 'Selector'. I named the selector levels as following 0 = Play, 10 = Pause, 20= Stop
Make sure to take care of the CAPITAL letters (doesn't matter what you choose, but put the same in the lua file variables.

No need to put something in the selector page actions, leave them empty.
Hi Jake,

It works! great!! thank you very much, your help was very much appreciated!

Cheers!

Re: Kodi Mediaserver Support

Posted: Thursday 12 January 2017 22:28
by Trigun
Trigun wrote:
jake wrote:
Trigun wrote: Hi Jake,

The script works partially.
so far only the "Stop"function works.
maybe a dumb question but I assume I have to add the script to the "selector actions"?
I assume this will be: script://script_device_kodi.lua?

thanks again!
No, just put the lua file in the domoticz/scripts/lua folder and have your 3 buttons set up. Choose type 'Selector'. I named the selector levels as following 0 = Play, 10 = Pause, 20= Stop
Make sure to take care of the CAPITAL letters (doesn't matter what you choose, but put the same in the lua file variables.

No need to put something in the selector page actions, leave them empty.
Hi Jake,

It works! great!! thank you very much, your help was very much appreciated!

Cheers!
Hi Jake,

quick question.
if want more Kodi device to work like this, do I need more of these scripts?
or is there another solution to this?

also, if I select "Hide off level" the switch is still showing the off level, is there a way to only have the three options(Play, Pause, Stop)?

Thanks in advance!

Grtz.

Re: RE: Re: Kodi Mediaserver Support

Posted: Thursday 12 January 2017 22:52
by jake
Trigun wrote:Hi Jake,

quick question.
if want more Kodi device to work like this, do I need more of these scripts?
or is there another solution to this?

also, if I select "Hide off level" the switch is still showing the off level, is there a way to only have the three options(Play, Pause, Stop)?

Thanks in advance!

Grtz.
Pfoo, you make it more challenging. I added myself a 'not requested wish' challenge to update the buttons automatically when the Kodi status changes. That worked.
But this is the next level. I usually google the commands together, so I will give you some suggestions for you to start with:
As you can read in my code, things get triggered by the 'devicechanged' command. You will need to tell the script WHICH Kodi device, or WHICH selector switch is updated. I think it will be possible to make it work in 1 script, but that might become complex and not easy to read afterwards anymore. The 'dirty' way of doing is by simply copy-pasting the LUA file, make some logic names in the file name, as long as the word 'device' is in there, meaning that the script will trigger on a devicechanged. In the 2nd LUA file, simply change the variables (kodi device xyz and selector switch xyz) to the new (virtual) hardware.

Regarding your 2nd question about the 'off stage', I don't have any intelligence about that. You can ask that in a more general topic within Domoticz as well, since it is not 1 to 1 Kodi related.

Re: RE: Re: Kodi Mediaserver Support

Posted: Friday 13 January 2017 11:38
by Trigun
jake wrote:
Trigun wrote:Hi Jake,

quick question.
if want more Kodi device to work like this, do I need more of these scripts?
or is there another solution to this?

also, if I select "Hide off level" the switch is still showing the off level, is there a way to only have the three options(Play, Pause, Stop)?

Thanks in advance!

Grtz.
Pfoo, you make it more challenging. I added myself a 'not requested wish' challenge to update the buttons automatically when the Kodi status changes. That worked.
But this is the next level. I usually google the commands together, so I will give you some suggestions for you to start with:
As you can read in my code, things get triggered by the 'devicechanged' command. You will need to tell the script WHICH Kodi device, or WHICH selector switch is updated. I think it will be possible to make it work in 1 script, but that might become complex and not easy to read afterwards anymore. The 'dirty' way of doing is by simply copy-pasting the LUA file, make some logic names in the file name, as long as the word 'device' is in there, meaning that the script will trigger on a devicechanged. In the 2nd LUA file, simply change the variables (kodi device xyz and selector switch xyz) to the new (virtual) hardware.

Regarding your 2nd question about the 'off stage', I don't have any intelligence about that. You can ask that in a more general topic within Domoticz as well, since it is not 1 to 1 Kodi related.
Hi Jake,

thanks for your reply.
3 different named scripts works for me, I'll try that.
can you share the script that updates the buttons, it will make it a very nice feature.

Thanks in advance!

Re: Kodi Mediaserver Support

Posted: Friday 13 January 2017 15:03
by jake
Have you read the script at all? It consists of 2 If functions, the first one to update kodi, the second one to update the selector switch. See the comments with the function:

Code: Select all

--- Set selector switch in Domoticz to react to status change of Kodi
You should be fine with the script as it is. :D

Re: Kodi Mediaserver Support

Posted: Saturday 14 January 2017 10:40
by Trigun
Hi jake, thanks! You are right! I guess I misunderstood you comment :( I got all the other Kodi devices also working like a charm, thanks!


Sent from my iPad using Tapatalk

Re: Kodi Mediaserver Support

Posted: Saturday 14 January 2017 11:11
by jake
Thanks, you're welcome. This finally was within my scope of reach, so, happy to help :)

Re: RE: Re: Kodi Mediaserver Support

Posted: Wednesday 18 January 2017 16:41
by jake
Dnpwwo wrote:@Jake,

Things are still evolving a little while the Python Framework is in Beta.

If you are running the latest version then you will need to create a directory under the plugins directory (I called my 'Kodi') and drop the file in there. You will also need to rename it 'plugin.py'.
Is there an updated version of the kodi.py program? Should we report bugs on the 1.0 version?

Re: Kodi Mediaserver Support

Posted: Thursday 19 January 2017 2:29
by Dnpwwo
@jake,

There is not a version with any functional changes but depending on which beta you are running you may have started to see error messages around parameter issues.

If that is the case there is a new version, see viewtopic.php?f=4&t=15233&p=114933#p114782

Or were you having other problems?

Re: Kodi Mediaserver Support

Posted: Saturday 21 January 2017 16:39
by paegan
G3rard wrote:
Dnpwwo wrote:@G3rard, Don't worry about ther Kodi webserver settings, Domoticz does not use it.

If 9090 is not responding then check that both controls on this page are checked (particularly the 2nd one)http://kodi.wiki/view/Settings/Services#Remote_control
I have added an advancedsettings.xml in Kodi on my Nvidia Shield with

Code: Select all

<advancedsettings>
	<jsonrpc>
		<tcpport>9095</tcpport>
	</jsonrpc>
</advancedsettings>
Changed to port 9095 in Domoticz and now it's working :D
All day troubleshooting, Why won't this freaking thing work?
Did G3rard his fix in advancesettings.xml an it worked instantly

Domoticz could connect to kodi, but no info in de mediaplayer icon in domoticz and no remote control from domoticz to kodi.
But, again with G3rard's fix it did, thnx G3rard!!

Re: Kodi Mediaserver Support

Posted: Saturday 21 January 2017 22:47
by jake
Dnpwwo wrote:@jake,

There is not a version with any functional changes but depending on which beta you are running you may have started to see error messages around parameter issues.

If that is the case there is a new version, see viewtopic.php?f=4&t=15233&p=114933#p114782

Or were you having other problems?
I had / have issues with the functions:
-The music video tv-show buttons work, but don't turn Kodi to that same setting (video might lead to music, etc etc)
-Sound level to 0, shows a 'mute' in Kodi, but turning it up afterwards doesn't 'unmute' it, unless the loudspeaker icon is clicked while still at 0% loudness.
-Sometimes there is a 'status' change without an obvious reason, there is no extra text in the log to be seen in those circumstances.

I didn't see any difference in behavior with the 1.02 version (instead of 1.00 before). Is that correct, or do I need to remove the hardware and add it again?

Re: Kodi Mediaserver Support

Posted: Sunday 22 January 2017 2:42
by Dnpwwo
@jake,

Can you turn debug on in the Hardware page and reproduce these? If you post the logging output I maybe able to work out the issue.

Re: Kodi Mediaserver Support

Posted: Sunday 22 January 2017 19:13
by jake
Dnpwwo wrote:@jake,

Can you turn debug on in the Hardware page and reproduce these? If you post the logging output I maybe able to work out the issue.
What is the best approach for switching between 1.00 and 1.02 version? Is a Domoticz service stop - start necessary in between?
Should I recreate hardware between 1.00 and 1.02?
What test would you like me to do? On Domoticz side, Kodi side or without any interaction with Kodi-Domoticz?

Re: Kodi Mediaserver Support

Posted: Monday 23 January 2017 16:44
by Melotron
I can only get kodi as status ON

Here are my log :

Code: Select all

2017-01-23 15:59:14.648 Kodi: Starting I/O service thread.
2017-01-23 15:59:14.651 Error: Kodi: (Kodi Storarum) Async Read Exception: 125, Operation canceled
2017-01-23 15:59:14.655 Kodi: (Kodi Storarum) Event: 'Off'.
2017-01-23 15:59:15.552 Kodi: (Kodi Storarum) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
2017-01-23 15:59:25.554 Kodi: (Kodi Storarum) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
2017-01-23 15:59:35.556 Kodi: (Kodi Storarum) Missed 1 pings, assumed off.
2017-01-23 15:59:35.562 Kodi: (Kodi Storarum) Event: 'Off'.
2017-01-23 15:59:35.584 Kodi: (Kodi Storarum) Disonnected.
2017-01-23 15:59:36.559 Kodi: (Kodi Storarum) Connected to '192.168.0.126:8080'.
2017-01-23 15:59:36.564 Kodi: (Kodi Storarum) Event: 'On'.
2017-01-23 15:59:36.584 Kodi: (Kodi Storarum) Sending data: '{"jsonrpc":"2.0","method":"System.GetProperties","params":{"properties":["canhibernate","cansuspend","canshutdown"]},"id":1007}'
2017-01-23 15:59:37.585 Kodi: (Kodi Storarum) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
2017-01-23 15:59:46.952 Kodi: Restarting I/O service thread.
2017-01-23 15:59:47.588 Kodi: (Kodi Storarum) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
2017-01-23 15:59:57.590 Kodi: (Kodi Storarum) Missed 1 pings, assumed off.
2017-01-23 15:59:57.595 Kodi: (Kodi Storarum) Event: 'Off'.
2017-01-23 15:59:57.616 Kodi: (Kodi Storarum) Disonnected.
2017-01-23 15:59:58.593 Kodi: (Kodi Storarum) Connected to '192.168.0.126:8080'.
2017-01-23 15:59:58.596 Kodi: (Kodi Storarum) Event: 'On'.
2017-01-23 15:59:58.616 Kodi: (Kodi Storarum) Sending data: '{"jsonrpc":"2.0","method":"System.GetProperties","params":{"properties":["canhibernate","cansuspend","canshutdown"]},"id":1007}'
2017-01-23 15:59:59.617 Kodi: (Kodi Storarum) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
2017-01-23 16:00:00.392 Starting automatic database backup procedure...
2017-01-23 16:00:08.122 Kodi: Restarting I/O service thread.
2017-01-23 16:00:09.688 Kodi: (Kodi Storarum) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
2017-01-23 16:00:19.691 Kodi: (Kodi Storarum) Missed 1 pings, assumed off.
2017-01-23 16:00:24.789 Kodi: (Kodi Storarum) Event: 'Off'.
2017-01-23 16:00:24.823 Ending automatic database backup procedure...
2017-01-23 16:00:25.695 Kodi: (Kodi Storarum) Connected to '192.168.0.126:8080'.
2017-01-23 16:00:25.700 Kodi: (Kodi Storarum) Event: 'On'.
2017-01-23 16:00:25.720 Kodi: (Kodi Storarum) Sending data: '{"jsonrpc":"2.0","method":"System.GetProperties","params":{"properties":["canhibernate","cansuspend","canshutdown"]},"id":1007}'
2017-01-23 16:00:26.721 Kodi: (Kodi Storarum) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
2017-01-23 16:00:29.132 Kodi: Restarting I/O service thread.
2017-01-23 16:00:36.732 Kodi: (Kodi Storarum) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
2017-01-23 16:00:46.734 Kodi: (Kodi Storarum) Missed 1 pings, assumed off.
2017-01-23 16:00:46.740 Kodi: (Kodi Storarum) Event: 'Off'.
2017-01-23 16:00:46.762 Kodi: (Kodi Storarum) Disonnected.
2017-01-23 16:00:47.737 Kodi: (Kodi Storarum) Connected to '192.168.0.126:8080'.
2017-01-23 16:00:47.742 Kodi: (Kodi Storarum) Event: 'On'.
2017-01-23 16:00:47.762 Kodi: (Kodi Storarum) Sending data: '{"jsonrpc":"2.0","method":"System.GetProperties","params":{"properties":["canhibernate","cansuspend","canshutdown"]},"id":1007}'
2017-01-23 16:00:48.763 Kodi: (Kodi Storarum) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
2017-01-23 16:00:50.139 Kodi: Restarting I/O service thread.
2017-01-23 16:00:58.765 Kodi: (Kodi Storarum) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
2017-01-23 16:01:08.767 Kodi: (Kodi Storarum) Missed 1 pings, assumed off.
2017-01-23 16:01:08.772 Kodi: (Kodi Storarum) Event: 'Off'.
2017-01-23 16:01:08.793 Kodi: (Kodi Storarum) Disonnected.
2017-01-23 16:01:09.770 Kodi: (Kodi Storarum) Connected to '192.168.0.126:8080'.
2017-01-23 16:01:09.774 Kodi: (Kodi Storarum) Event: 'On'.
2017-01-23 16:01:09.794 Kodi: (Kodi Storarum) Sending data: '{"jsonrpc":"2.0","method":"System.GetProperties","params":{"properties":["canhibernate","cansuspend","canshutdown"]},"id":1007}'
Ive tryed to change the port to 9090 on both sides.

I've tryed to add advancedsettings.xml with :

Code: Select all

<advancedsettings>
   <jsonrpc>
      <tcpport>9095</tcpport>
   </jsonrpc>
</advancedsettings>
On UPnP/DLNA I have allow remote controll via UPnP ON
On Web Server I have Allow remote controll via HTTP ON
On Remote Control both options are ON.

I can play, pause and stop movies on the webpage.
What ever I do I can only get the status to change to OFF or ON.

I know that there are something that I've missed to do some where. But I cant find it.

Regards Magnus Svensson

Re: Kodi Mediaserver Support

Posted: Tuesday 24 January 2017 10:20
by Dnpwwo
@Melotron,

The Kodi plugin doco clearly states that it does not use the Kodi web interface. Setting the port to use it (on 8080) demonstrates this, you connect but then the Kodi drops the connection because it wants http requests on that port not json.

I don't understand how you 'changed the port to 9090 on both sides'. I believe you are still changing the web server port, if so it won't make any difference (see above).

I would recommend this:
  • Via the Kodi UI put the port back to 8080 for the webserver
  • Remove the advancedsettings.xml on the Kodi and restart
  • Set the port to -9090 in Domoticz and restart then post the log if it still does not work