Kodi Mediaserver Support

Moderator: leecollings

Post Reply
User avatar
Ferpando
Posts: 30
Joined: Friday 23 October 2015 9:45
Target OS: NAS (Synology & others)
Domoticz version:
Location: Spain
Contact:

Re: Kodi Mediaserver Support

Post by Ferpando »

Well, it displays what's happening, but events are not working.
This, for example, never gets executed
kod.gif
kod.gif (7.94 KiB) Viewed 5898 times
but the event comes through in the log
2015-10-26 18:07:22.640 Kodi: (Minix) Event: 'Video - The Walking Dead [S6E3], Thank You'.
User avatar
Dnpwwo
Posts: 819
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Kodi Mediaserver Support

Post by Dnpwwo »

I do something similar and it seems to work (although I'm not doing a string compare but using the status instead)
Blockly.jpg
Blockly.jpg (37.6 KiB) Viewed 5884 times
this turns my lights off when I start playing video. I have a more complicated one to turn them back on again.
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
User avatar
Ferpando
Posts: 30
Joined: Friday 23 October 2015 9:45
Target OS: NAS (Synology & others)
Domoticz version:
Location: Spain
Contact:

Re: Kodi Mediaserver Support

Post by Ferpando »

Thank you for the suggestion.
I'll try to compare with status and let you know.
Could you post the other event for the lights? Just curious :-)
User avatar
Dnpwwo
Posts: 819
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Kodi Mediaserver Support

Post by Dnpwwo »

Sure, this dims the same (dimmable) lights depending on the time of night
Blockly.jpg
Blockly.jpg (134.27 KiB) Viewed 5853 times
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
User avatar
Ferpando
Posts: 30
Joined: Friday 23 October 2015 9:45
Target OS: NAS (Synology & others)
Domoticz version:
Location: Spain
Contact:

Re: Kodi Mediaserver Support

Post by Ferpando »

Thank you for the blockly :-)

I don't know why but events are not working now.
I see in the log that the file is playing, but no event reaction.
I'm on domoticz 2.3444 and kodi 15.2, and here's the log now
2015-10-27 20:18:10.437 Error: Kodi: (Minix) Message error, unknown type in OnPlay message: 'unknown' from '{"jsonrpc":"2.0","method":"Player.OnPlay","params":{"data":{"item":{"type":"unknown"},"player":{"playerid":0,"speed":1}},"sender":"xbmc"}}{"jsonrpc":"2.0","method":"Application.OnVolumeChanged","params":{"data":{"muted":false,"volume":46.6666717529296875},"sender":"xbmc"}}{"jsonrpc":"2.0","method":"Playlist.OnAdd","params":{"data":{"item":{"id":1590,"type":"episode"},"playlistid":1,"position":0},"sender":"xbmc"}}{"jsonrpc":"2.0","method":"Player.OnPlay","params":{"data":{"item":{"id":1590,"type":"episode"},"player":{"playeri'
2015-10-27 20:18:10.439 Error: Kodi: (Minix) Code -32100 Text 'Failed to execute method.' ID '1003' Request '{"jsonrpc":"2.0","method":"Player.GetItem","id":1003,"params":{"playerid":1,"properties":["artist","album","year","channel","showtitle","season","episode","title"]}}'
2015-10-27 20:18:10.511 Kodi: (Minix) Event: 'Video - , 4x01. Green Arrow'.
2015-10-27 20:18:15.017 Kodi: (Minix) Event: 'On'.
2015-10-27 20:18:15.961 Error: Kodi: (Minix) Message error, unknown type in OnPlay message: 'unknown' from '{"jsonrpc":"2.0","method":"Player.OnPlay","params":{"data":{"item":{"type":"unknown"},"player":{"playerid":0,"speed":1}},"sender":"xbmc"}}'
2015-10-27 20:18:15.985 Kodi: (Minix) Event: 'Audio - , theme.mp3'.
2015-10-27 20:18:51.504 Kodi: (Minix) Event: 'On'.
and this when turning off
2015-10-27 21:37:40.406 Kodi: (Minix) Starting thread.
2015-10-27 21:37:40.507 Kodi: Starting I/O service thread.
2015-10-27 21:37:40.507 Error: Kodi: (Minix) Async Read Exception: 125, Operation canceled
2015-10-27 21:37:40.507 Kodi: (Minix) Event: 'Off'.
How can I help you fix this?
User avatar
Dnpwwo
Posts: 819
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Kodi Mediaserver Support

Post by Dnpwwo »

You will need to send the full debug version of the log. Set the Kodi device port to be a negative number and it will log all data in & out.

Without that I can't tell what's going on.

Also, what are you using to control the Kodi? The message id numbers are not the ones Domoticz uses.
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
User avatar
Ferpando
Posts: 30
Joined: Friday 23 October 2015 9:45
Target OS: NAS (Synology & others)
Domoticz version:
Location: Spain
Contact:

Re: Kodi Mediaserver Support

Post by Ferpando »

Here's the detailed log
2015-10-29 15:39:05.233 Kodi: (Minix) Starting thread.
2015-10-29 15:39:05.233 Kodi: (Minix) Entering work loop.
2015-10-29 15:39:05.335 Kodi: Starting I/O service thread.
2015-10-29 15:39:31.459 Hardware Monitor: Fetching data (System sensors)
2015-10-29 15:39:50.633 Kodi: (Minix) Connected to '192.168.1.28:-9090'.
2015-10-29 15:39:50.634 Kodi: (Minix) Event: 'On'.
2015-10-29 15:39:50.643 Kodi: (Minix) Sending data: '{"jsonrpc":"2.0","method":"System.GetProperties","params":{"properties":["canhibernate","cansuspend","canshutdown"]},"id":1007}'
2015-10-29 15:39:51.644 Kodi: (Minix) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
2015-10-29 15:39:57.854 Kodi: Restarting I/O service thread.
2015-10-29 15:39:57.854 Kodi: (Minix) Parsing data: '{"id":1007,"jsonrpc":"2.0","result":{"canhibernate":false,"canshutdown":false,"cansuspend":false}}{"id":1001,"jsonrpc":"2.0","result":"pong"}'.
2015-10-29 15:39:57.854 Kodi: (Minix) Sending data: '{"jsonrpc":"2.0","method":"Player.GetActivePlayers","id":1005}'
2015-10-29 15:39:57.862 Kodi: (Minix) Parsing data: '{"id":1005,"jsonrpc":"2.0","result":[]}'.
2015-10-29 15:40:01.575 Hardware Monitor: Fetching data (System sensors)
2015-10-29 15:40:01.654 Kodi: (Minix) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
2015-10-29 15:40:01.656 Kodi: (Minix) Parsing data: '{"id":1001,"jsonrpc":"2.0","result":"pong"}'.
2015-10-29 15:40:03.062 Kodi: (Minix) Event: 'Off'.
2015-10-29 15:40:03.072 Kodi: (Minix) Disonnected.
2015-10-29 15:40:11.675 Kodi: (Minix) Connected to '192.168.1.28:-9090'.
2015-10-29 15:40:11.675 Kodi: (Minix) Event: 'On'.
2015-10-29 15:40:11.684 Kodi: (Minix) Sending data: '{"jsonrpc":"2.0","method":"System.GetProperties","params":{"properties":["canhibernate","cansuspend","canshutdown"]},"id":1007}'
2015-10-29 15:40:12.686 Kodi: (Minix) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
2015-10-29 15:40:18.896 Kodi: Restarting I/O service thread.
2015-10-29 15:40:18.896 Kodi: (Minix) Parsing data: '{"id":1007,"jsonrpc":"2.0","result":{"canhibernate":false,"canshutdown":false,"cansuspend":false}}{"id":1001,"jsonrpc":"2.0","result":"pong"}'.
2015-10-29 15:40:18.896 Kodi: (Minix) Sending data: '{"jsonrpc":"2.0","method":"Player.GetActivePlayers","id":1005}'
2015-10-29 15:40:18.908 Kodi: (Minix) Parsing data: '{"id":1005,"jsonrpc":"2.0","result":[]}'.
2015-10-29 15:40:22.697 Kodi: (Minix) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
2015-10-29 15:40:22.697 Kodi: (Minix) Parsing data: '{"id":1001,"jsonrpc":"2.0","result":"pong"}'.
2015-10-29 15:40:26.904 Kodi: (Minix) Parsing data: '{"jsonrpc":"2.0","method":"VideoLibrary.OnScanFinished","params":{"data":null,"sender":"xbmc"}}'.
2015-10-29 15:40:26.904 Kodi: (Minix) Message warning, unhandled method: 'VideoLibrary.OnScanFinished'
2015-10-29 15:40:29.903 Kodi: (Minix) Parsing data: '{"jsonrpc":"2.0","method":"Playlist.OnAdd","params":{"data":{"item":{"type":"unknown"},"playlistid":0,"position":0},"sender":"xbmc"}}'.
2015-10-29 15:40:29.903 Kodi: (Minix) Message warning, unhandled method: 'Playlist.OnAdd'
2015-10-29 15:40:29.914 Kodi: (Minix) Parsing data: '{"jsonrpc":"2.0","method":"Application.OnVolumeChanged","params":{"data":{"muted":false,"volume":50},"sender":"xbmc"}}'.
2015-10-29 15:40:29.914 Kodi: (Minix) Volume changed to 50.00000, Muted: false.
2015-10-29 15:40:30.180 Kodi: (Minix) Parsing data: '{"jsonrpc":"2.0","method":"Player.OnPlay","params":{"data":{"item":{"type":"unknown"},"player":{"playerid":0,"speed":1}},"sender":"xbmc"}}'.
2015-10-29 15:40:30.180 Error: Kodi: (Minix) Message error, unknown type in OnPlay message: 'unknown' from '{"jsonrpc":"2.0","method":"Player.OnPlay","params":{"data":{"item":{"type":"unknown"},"player":{"playerid":0,"speed":1}},"sender":"xbmc"}}'
2015-10-29 15:40:30.180 Kodi: (Minix) Sending data: '{"jsonrpc":"2.0","method":"Player.GetItem","id":1003,"params":{"playerid":0,"properties":["artist","album","year","channel","showtitle","season","episode","title"]}}'
2015-10-29 15:40:30.202 Kodi: (Minix) Parsing data: '{"id":1003,"jsonrpc":"2.0","result":{"item":{"album":"","artist":[],"label":"theme.mp3","title":"theme.mp3","type":"song","year":0}}}'.
2015-10-29 15:40:30.202 Kodi: (Minix) Sending data: '{"jsonrpc":"2.0","method":"Player.GetProperties","id":1002,"params":{"playerid":0,"properties":["live","percentage","speed"]}}'
2015-10-29 15:40:30.204 Kodi: (Minix) Parsing data: '{"id":1002,"jsonrpc":"2.0","result":{"live":false,"percentage":-0.058685444295406341553,"speed":1}}'.
2015-10-29 15:40:30.205 Kodi: (Minix) Event: 'Audio - , theme.mp3'.
2015-10-29 15:40:30.459 Kodi: (Minix) Parsing data: '{"jsonrpc":"2.0","method":"Application.OnVolumeChanged","params":{"data":{"muted":false,"volume":46.6666717529296875},"sender":"xbmc"}}'.
2015-10-29 15:40:30.459 Kodi: (Minix) Volume changed to 46.66667, Muted: false.
2015-10-29 15:40:31.691 Hardware Monitor: Fetching data (System sensors)
2015-10-29 15:40:32.707 Kodi: (Minix) Sending data: '{"jsonrpc":"2.0","method":"Player.GetProperties","id":1002,"params":{"playerid":0,"properties":["live","percentage","speed"]}}'
2015-10-29 15:40:32.708 Kodi: (Minix) Parsing data: '{"id":1002,"jsonrpc":"2.0","result":{"live":false,"percentage":6.9584169387817382812,"speed":1}}'.
2015-10-29 15:40:36.158 Kodi: (Minix) Parsing data: '{"jsonrpc":"2.0","method":"Playlist.OnAdd","params":{"data":{"item":{"id":1590,"type":"episode"},"playlistid":1,"position":0},"sender":"xbmc"}}'.
2015-10-29 15:40:36.158 Kodi: (Minix) Message warning, unhandled method: 'Playlist.OnAdd'
2015-10-29 15:40:36.647 Kodi: (Minix) Parsing data: '{"jsonrpc":"2.0","method":"Player.OnPlay","params":{"data":{"item":{"id":1590,"type":"episode"},"player":{"playerid":1,"speed":1}},"sender":"xbmc"}}'.
2015-10-29 15:40:36.648 Kodi: (Minix) Sending data: '{"jsonrpc":"2.0","method":"Player.GetItem","id":1003,"params":{"playerid":1,"properties":["artist","album","year","channel","showtitle","season","episode","title"]}}'
2015-10-29 15:40:36.708 Kodi: (Minix) Parsing data: '{"id":1003,"jsonrpc":"2.0","result":{"item":{"album":"","artist":[],"episode":-1,"label":"4x01. Green Arrow","season":-1,"showtitle":"","title":"","type":"unknown","year":0}}}'.
2015-10-29 15:40:36.708 Kodi: (Minix) Sending data: '{"jsonrpc":"2.0","method":"Player.GetProperties","id":1002,"params":{"playerid":1,"properties":["live","percentage","speed"]}}'
2015-10-29 15:40:36.722 Kodi: (Minix) Parsing data: '{"id":1002,"jsonrpc":"2.0","result":{"live":false,"percentage":0.00525962095707654953,"speed":1}}'.
2015-10-29 15:40:36.723 Kodi: (Minix) Event: 'Video - , 4x01. Green Arrow'.
2015-10-29 15:40:37.187 Kodi: (Minix) Parsing data: '{"jsonrpc":"2.0","method":"Application.OnVolumeChanged","params":{"data":{"muted":false,"volume":100},"sender":"xbmc"}}'.
2015-10-29 15:40:37.187 Kodi: (Minix) Volume changed to 100.00000, Muted: false.
2015-10-29 15:40:42.717 Kodi: (Minix) Sending data: '{"jsonrpc":"2.0","method":"Player.GetProperties","id":1002,"params":{"playerid":1,"properties":["live","percentage","speed"]}}'
2015-10-29 15:40:42.719 Kodi: (Minix) Parsing data: '{"id":1002,"jsonrpc":"2.0","result":{"live":false,"percentage":0.22557494044303894043,"speed":1}}'.
2015-10-29 15:40:52.733 Kodi: (Minix) Sending data: '{"jsonrpc":"2.0","method":"Player.GetProperties","id":1002,"params":{"playerid":1,"properties":["live","percentage","speed"]}}'
2015-10-29 15:40:52.735 Kodi: (Minix) Parsing data: '{"id":1002,"jsonrpc":"2.0","result":{"live":false,"percentage":0.61329537630081176758,"speed":1}}'.
2015-10-29 15:41:01.824 Hardware Monitor: Fetching data (System sensors)
2015-10-29 15:41:02.747 Kodi: (Minix) Sending data: '{"jsonrpc":"2.0","method":"Player.GetProperties","id":1002,"params":{"playerid":1,"properties":["live","percentage","speed"]}}'
2015-10-29 15:41:02.752 Kodi: (Minix) Parsing data: '{"id":1002,"jsonrpc":"2.0","result":{"live":false,"percentage":1.0118882656097412109,"speed":1}}'.
2015-10-29 15:41:12.757 Kodi: (Minix) Sending data: '{"jsonrpc":"2.0","method":"Player.GetProperties","id":1002,"params":{"playerid":1,"properties":["live","percentage","speed"]}}'
2015-10-29 15:41:12.760 Kodi: (Minix) Parsing data: '{"id":1002,"jsonrpc":"2.0","result":{"live":false,"percentage":1.4046328067779541016,"speed":1}}'.
2015-10-29 15:41:21.074 Kodi: (Minix) Parsing data: '{"jsonrpc":"2.0","method":"Player.OnStop","params":{"data":{"end":false,"item":{"id":1590,"type":"episode"}},"sender":"xbmc"}}'.
2015-10-29 15:41:21.074 Kodi: (Minix) Event: 'On'.
2015-10-29 15:41:21.712 Kodi: (Minix) Parsing data: '{"jsonrpc":"2.0","method":"Playlist.OnClear","params":{"data":{"playlistid":0},"sender":"xbmc"}}'.
2015-10-29 15:41:21.713 Kodi: (Minix) Message warning, unhandled method: 'Playlist.OnClear'
2015-10-29 15:41:21.713 Kodi: (Minix) Parsing data: '{"jsonrpc":"2.0","method":"Playlist.OnAdd","params":{"data":{"item":{"type":"unknown"},"playlistid":0,"position":0},"sender":"xbmc"}}'.
2015-10-29 15:41:21.713 Kodi: (Minix) Message warning, unhandled method: 'Playlist.OnAdd'
2015-10-29 15:41:21.718 Kodi: (Minix) Parsing data: '{"jsonrpc":"2.0","method":"Application.OnVolumeChanged","params":{"data":{"muted":false,"volume":50},"sender":"xbmc"}}'.
2015-10-29 15:41:21.718 Kodi: (Minix) Volume changed to 50.00000, Muted: false.
2015-10-29 15:41:21.749 Kodi: (Minix) Parsing data: '{"jsonrpc":"2.0","method":"VideoLibrary.OnUpdate","params":{"data":{"item":{"id":1590,"type":"episode"}},"sender":"xbmc"}}'.
2015-10-29 15:41:21.749 Kodi: (Minix) Message warning, unhandled method: 'VideoLibrary.OnUpdate'
2015-10-29 15:41:21.949 Kodi: (Minix) Parsing data: '{"jsonrpc":"2.0","method":"Player.OnPlay","params":{"data":{"item":{"type":"unknown"},"player":{"playerid":0,"speed":1}},"sender":"xbmc"}}'.
2015-10-29 15:41:21.949 Error: Kodi: (Minix) Message error, unknown type in OnPlay message: 'unknown' from '{"jsonrpc":"2.0","method":"Player.OnPlay","params":{"data":{"item":{"type":"unknown"},"player":{"playerid":0,"speed":1}},"sender":"xbmc"}}'
2015-10-29 15:41:21.949 Kodi: (Minix) Sending data: '{"jsonrpc":"2.0","method":"Player.GetItem","id":1003,"params":{"playerid":0,"properties":["artist","album","year","channel","showtitle","season","episode","title"]}}'
2015-10-29 15:41:21.976 Kodi: (Minix) Parsing data: '{"id":1003,"jsonrpc":"2.0","result":{"item":{"album":"","artist":[],"label":"theme.mp3","title":"theme.mp3","type":"song","year":0}}}'.
2015-10-29 15:41:21.976 Kodi: (Minix) Sending data: '{"jsonrpc":"2.0","method":"Player.GetProperties","id":1002,"params":{"playerid":0,"properties":["live","percentage","speed"]}}'
2015-10-29 15:41:21.977 Kodi: (Minix) Parsing data: '{"id":1002,"jsonrpc":"2.0","result":{"live":false,"percentage":-0.22356359660625457764,"speed":1}}'.
2015-10-29 15:41:21.978 Kodi: (Minix) Event: 'Audio - , theme.mp3'.
2015-10-29 15:41:22.332 Kodi: (Minix) Parsing data: '{"jsonrpc":"2.0","method":"Application.OnVolumeChanged","params":{"data":{"muted":false,"volume":46.6666717529296875},"sender":"xbmc"}}'.
2015-10-29 15:41:22.332 Kodi: (Minix) Volume changed to 46.66667, Muted: false.
2015-10-29 15:41:22.767 Kodi: (Minix) Sending data: '{"jsonrpc":"2.0","method":"Player.GetProperties","id":1002,"params":{"playerid":0,"properties":["live","percentage","speed"]}}'
2015-10-29 15:41:22.768 Kodi: (Minix) Parsing data: '{"id":1002,"jsonrpc":"2.0","result":{"live":false,"percentage":2.0679633617401123047,"speed":1}}'.
2015-10-29 15:41:31.941 Hardware Monitor: Fetching data (System sensors)
2015-10-29 15:41:32.777 Kodi: (Minix) Sending data: '{"jsonrpc":"2.0","method":"Player.GetProperties","id":1002,"params":{"playerid":0,"properties":["live","percentage","speed"]}}'
2015-10-29 15:41:32.778 Kodi: (Minix) Parsing data: '{"id":1002,"jsonrpc":"2.0","result":{"live":false,"percentage":30.066509246826171875,"speed":1}}'.
2015-10-29 15:41:42.787 Kodi: (Minix) Sending data: '{"jsonrpc":"2.0","method":"Player.GetProperties","id":1002,"params":{"playerid":0,"properties":["live","percentage","speed"]}}'
2015-10-29 15:41:42.788 Kodi: (Minix) Parsing data: '{"id":1002,"jsonrpc":"2.0","result":{"live":false,"percentage":58.0147552490234375,"speed":1}}'.
Kodi is running on Minix, an android machine. What do you mean by control? I use an IR remote control. Kodi came from google play store.
User avatar
Egregius
Posts: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Kodi Mediaserver Support

Post by Egregius »

Hint: use the code tag instead of the quote tag ;)
MisterT2000
Posts: 2
Joined: Wednesday 11 November 2015 13:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Kodi Mediaserver Support

Post by MisterT2000 »

Hi
I'm a new Domoticz User in Raspberry Pi and a good Kodi user and i dicovered this compatibility between this two software but i have a problem with parameters.
I configured Domoticz like this:
add Kodi server in Domoticz hardware
add ip and port in every kodi in my home
For Bar : 192.168.1.21 for exemple
Kodi is on 8086

I tested this parameters but the result is not good.See below the log. I can't find the solution

2015-11-11 13:14:35.929 Kodi: (Bar) Missed 1 pings, assumed off.
2015-11-11 13:14:35.934 Kodi: (Bar) Event: 'Off'.
2015-11-11 13:14:35.939 Kodi: (Bar) Disonnected.
2015-11-11 13:14:36.938 Kodi: (Bar) Connected to '192.168.1.21:-8086'.
2015-11-11 13:14:36.943 Kodi: (Bar) Event: 'On'.
2015-11-11 13:14:36.950 Kodi: (Bar) Sending data: '{"jsonrpc":"2.0","method":"System.GetProperties","params":{"properties":["canhibernate","cansuspend","canshutdown"]},"id":1007}'


Do you have an idea?
Thaks for next answers
User avatar
Dnpwwo
Posts: 819
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Kodi Mediaserver Support

Post by Dnpwwo »

To me this looks like you have specified the webserver port.

Have a look at http://www.domoticz.com/wiki/Kodi#Kodi_Settings, As it says:
Do not change any of these web server settings in an attempt to make this plugin work. It does not use the Kodi Webserver so it will make no difference.
Unless you have logged onto the command line of your Kodi and changed the config in an editor to look like this:

Code: Select all

<jsonrpc>
    <compactoutput>false</compactoutput>
    <tcpport>8086</tcpport>
</jsonrpc>
then the port to use is 9090.
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
patoche
Posts: 10
Joined: Monday 09 November 2015 19:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Kodi Mediaserver Support

Post by patoche »

There isno log "stop", so it is not possible to swith on the light when we stop playing movie. Is it possible to add it ?
User avatar
Dnpwwo
Posts: 819
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Kodi Mediaserver Support

Post by Dnpwwo »

if you look further up this thread there are examples on how to do this with the existing events: if you link the events to a user variable you can turn the lights on only when they were turned off by a Kodi event.

Using a variable like this also makes sure that the event only fires once
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
bluepi

Re: Kodi Mediaserver Support

Post by bluepi »

This thread has been great...

Got my openelec system working with my lights... Perfect :D
patoche
Posts: 10
Joined: Monday 09 November 2015 19:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Kodi Mediaserver Support

Post by patoche »

I have a blockly which done on /off light if video is pause or playing regarding time sunset.Ansd it works fine since many weeks but i have not with the "stop button" movie.
Attachments
kodi blockly.jpg
kodi blockly.jpg (39.77 KiB) Viewed 5568 times
MisterT2000
Posts: 2
Joined: Wednesday 11 November 2015 13:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Kodi Mediaserver Support

Post by MisterT2000 »

Dnpwwo wrote:To me this looks like you have specified the webserver port.

Have a look at http://www.domoticz.com/wiki/Kodi#Kodi_Settings, As it says:
Do not change any of these web server settings in an attempt to make this plugin work. It does not use the Kodi Webserver so it will make no difference.
Unless you have logged onto the command line of your Kodi and changed the config in an editor to look like this:

Code: Select all

<jsonrpc>
    <compactoutput>false</compactoutput>
    <tcpport>8086</tcpport>
</jsonrpc>
then the port to use is 9090.

thx Dnpwwo for this answers and i try this parameters but is not resolved.
I put the parameters in advancesettings xml in kodi and changed 8086 to 9090 in domoticz parameters and I have always the same problem.
Every is good if i changed in 8080 port in kodi but i use Sarah domotic software witch is in the same port and there is a conflict. Do you have an other idea?
User avatar
Dnpwwo
Posts: 819
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Kodi Mediaserver Support

Post by Dnpwwo »

I don't know anything about Sarah but would recommend standard trouble shooting by debugging one thing at a time.
  • Shutdown Sarah server, take Kodi back to it's default settings
  • Don't change anything on the Kodi and add it into Domoticz again using the IP address and port -9090 and it should work (log should look like the one shown on the Kodi wiki page)
  • Change the port in Domoticz to 9090 to turn off debugging and make sure it still works
  • Then change the Kodi web server port from 8080 to something else via the Kodi gui (80 or 8086) - don't change anything in Domoticz
  • Restart Sarah.
Should work.

As it shows in the wiki (http://www.domoticz.com/wiki/Kodi#Troubleshooting), unless you see some log entries were Domoticz is 'Parsing data' then you have connected to the wrong port.

Good luck!
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
jake
Posts: 742
Joined: Saturday 30 May 2015 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Kodi Mediaserver Support

Post by jake »

Since November 15 my 'Kodi' appears to be 'OFF' in Domoticz, while Kodit itself is working normally. Both Domoticz and Xbian (Kodi) are up to date. I never changed ports or IP addresses, the Domoticz logs proof that before November 15 Kodi was publishing what song or video was being played.
User avatar
Dnpwwo
Posts: 819
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Kodi Mediaserver Support

Post by Dnpwwo »

Hi Jake, sorry to hear you are having issues.

The Kodi functionality has not been touched in the last 3 weeks so the problem is most likely at your end. I've tested it with both Kodi 14 & 15 and it seems ok.

Couple or questions:
  • Did you change anything around that time? A major Kodi version change resets some settings, check your Kodi against the requirements on the wiki page, particularly around letting external programs control your Kodi
  • Does you your Kodi have a fixed IP address? If not, DHCP may have allocated it a new one, compare the Kodi network settings to the device you created in Domoticz
If those don't work, follow the troubleshooting guide on the wiki and post some results
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
jake
Posts: 742
Joined: Saturday 30 May 2015 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Kodi Mediaserver Support

Post by jake »

Dnpwwo wrote:Hi Jake, sorry to hear you are having issues.

The Kodi functionality has not been touched in the last 3 weeks so the problem is most likely at your end. I've tested it with both Kodi 14 & 15 and it seems ok.

Couple or questions:
  • Did you change anything around that time? A major Kodi version change resets some settings, check your Kodi against the requirements on the wiki page, particularly around letting external programs control your Kodi
  • Does you your Kodi have a fixed IP address? If not, DHCP may have allocated it a new one, compare the Kodi network settings to the device you created in Domoticz
If those don't work, follow the troubleshooting guide on the wiki and post some results
Thanks for looking into this matter for me
Good to know nothing changed on the Domoticz update side of things, that narrows the search down a bit

SOLVED: I did all the steps as described here below, without results. 5-6 hours later I open Domoticz, check the log and it's spammed with Kodi messages (caused by the '-' 9090 port number). I removed the '-' and played some music via Kodi. Everything works as before. No idea why it came back to live ater 6 days of absence, but I am good to go now!
Only remainder is my question about the Wiki page.

Steps taken:
  • I don't recall changing anything to Kodi lately, maybe that an update of Xbian / Kodi happened around that time
  • The settings within Kodi to allow external programs to control Kodi are both 'On', as they were before
  • The Kodi device still has the same IP address that it always had. I can ping it from a Windows PC, but Domoticz pings it as well every 10 minutes as a 'System Alive Checker'. Timeout <64ms
  • I never manipulated the Kodi advancedsettings.xml file
  • In Domoticz hardware page the 'Kodi Media Server' shows a '1' for port number (as where 'system alive checker' shows 'www')
  • In Domoticz I changed the Kodi device settings to have the port number showing -9090, but the log only shows the following:

Code: Select all

 2015-11-21 11:06:09.241 Kodi: (Kodi Media Center) Starting thread.
2015-11-21 11:06:09.241 Kodi: (Kodi Media Center) Entering work loop.
2015-11-21 11:06:09.341 Kodi: Starting I/O service thread. 
  • When I click on the 'Kodi Switch' on the dashboard to turn Kodi on/off, it gives an error with the following in the log:

Code: Select all

 2015-11-21 11:20:14.177 Error: Kodi: (Kodi Media Center) Data not sent to NULL socket: '{"jsonrpc":"2.0","method":"System.GetProperties","params":{"properties":["canhibernate","cansuspend","canshutdown"]},"id":1004}'
2015-11-21 11:20:14.177 Kodi: (Kodi Media Center) Shutdown requested but is probably not supported. 
The Domoticz Wiki about Kodi states:
  • Ping timeout controls how many missed pings (sent once per Poll Interval) can be missed before a Kodi is consider 'Off'. For backwards compatibility, if the number specified is greater than 1000 it will be divided by 1000. Recommended value is 2 or 3.
What does the 'recommended value is 2 or 3' mean? I only see the screenshot of a ping interval of 10 and timeout of 1000
User avatar
Dnpwwo
Posts: 819
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Kodi Mediaserver Support

Post by Dnpwwo »

Glad to hear you are back up and running !

The log extracts you posted shows that it was never connecting at all. Given that the pinger was working I was going to suggest using a 'telnet IP port' command to the Kodi port from the Domoticz machine to see if there was a firewall issue. If it connects paste in {"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1} and hit enter and see if it responds. Maybe consider that if it stops working again.

The Ping interval setting controls how often an idle Kodi is sent an application level 'ping' message (you will have seen these in the log when the device was in debug mode). For a Kodi playing media it controls how often the Kodi is asked for the percentage complete the current media is.

The ping timeout just covers how many times a ping response can be missed before Domoticz assumes it is 'Off'.

So a ping interval of 10 seconds and a ping timeout of 2 means that if there is not response in 20 seconds Domoticz will mark the Kodi as 'Off'.
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests