Kodi Mediaserver Support

Moderator: leecollings

Post Reply
User avatar
Synasenn
Posts: 1
Joined: Saturday 03 October 2015 12:21
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Eindhoven
Contact:

Re: Kodi Mediaserver Support

Post by Synasenn »

Hi,

new user here and enjoying Domoticz very much.

I updated to the latest beta (v2.3219), but I don't have the options in blockly to select Paused, Audio, Video etc.
Do I have to adjust something to get these options?

Regards
salvation
Posts: 38
Joined: Saturday 06 September 2014 15:34
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Kodi Mediaserver Support

Post by salvation »

As far as I understood the piece of code to make that possible will be available in the next beta, so you will have to wait (or build from source).
User avatar
bizziebis
Posts: 182
Joined: Saturday 19 October 2013 14:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8805
Location: The Netherlands
Contact:

Re: Kodi Mediaserver Support

Post by bizziebis »

Dnpwwo wrote:The event functionality is still under development but today I pushed an update that should allow events to be fired from Blocky (tested) and Lua (untested) for any player state (On, Off, Video, Audio & Paused).

This will allow you to ring your doorbell when a video stream pauses but not the other way around :lol:

This means that:
Untitled.png
Messages will be written to the log when the Lounge Kodi starts playing music but the Set command won't do anything (yet).

I haven't done any coding with Domoticz events so I'm on a journey of discovery, if you want to take the next beta and test the lua that would be helpful.
It's working great in LUA.
Thanks for your effort!
User avatar
Dnpwwo
Posts: 820
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 »

Thanks bizziebis, good to know.

I found out I was wrong before and that setting the device state to 'Off' in blockly was alreadying working :o . So I've added a few more options, documented here http://www.domoticz.com/wiki/Kodi#Event ... ifications, to control playback.

Pause/resume can now be triggered in response to other events. Enjoy.

Source was updated an hour ago, standard delays apply depending on the build you are using.
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
salvation
Posts: 38
Joined: Saturday 06 September 2014 15:34
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Kodi Mediaserver Support

Post by salvation »

Dnpwwo wrote:Can you follow these instructions and post the output? http://www.domoticz.com/wiki/Kodi#Troubleshooting
When trying with the latest beta the problem doesn't occur anymore on my machine.
salvation
Posts: 38
Joined: Saturday 06 September 2014 15:34
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Kodi Mediaserver Support

Post by salvation »

Dnpwwo wrote:The event functionality is still under development but today I pushed an update that should allow events to be fired from Blocky (tested) and Lua (untested) for any player state (On, Off, Video, Audio & Paused).

This will allow you to ring your doorbell when a video stream pauses but not the other way around Image

This means that:
Untitled.png
Messages will be written to the log when the Lounge Kodi starts playing music but the Set command won't do anything (yet).

I haven't done any coding with Domoticz events so I'm on a journey of discovery, if you want to take the next beta and test the lua that would be helpful.
Pause media via an Lua trigger is working on the current beta, great work!
Justintime
Posts: 228
Joined: Thursday 21 May 2015 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Kodi Mediaserver Support

Post by Justintime »

My Domoticz is still crashing when doing the off button in Domoticz.



Code: Select all

2015-10-06 17:12:33.932 Kodi: (Kodi Beneden) Connected to '192.168.1.50:-9090'.
2015-10-06 17:12:33.933 Kodi: (Kodi Beneden) Event: 'On'.
2015-10-06 17:12:33.977 Kodi: (Kodi Beneden) Sending data: '{"jsonrpc":"2.0","method":"System.GetProperties","params":{"properties":["canhibernate","cansuspend","canshutdown"]},"id":7}'
2015-10-06 17:12:34.978 Kodi: (Kodi Beneden) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1}'
2015-10-06 17:12:36.018 (zwave) Lux (Licht Fibaro)
2015-10-06 17:12:36.175 Kodi: Restarting I/O service thread.
2015-10-06 17:12:36.175 Kodi: (Kodi Beneden) Parsing data: '{"id":7,"jsonrpc":"2.0","result":{"canhibernate":false,"canshutdown":true,"cansuspend":true}}{"id":1,"jsonrpc":"2.0","result":"pong"}'.
2015-10-06 17:12:36.176 Kodi: (Kodi Beneden) Sending data: '{"jsonrpc":"2.0","method":"Player.GetActivePlayers","id":5}'
2015-10-06 17:12:36.177 Kodi: (Kodi Beneden) Parsing data: '{"id":5,"jsonrpc":"2.0","result":[]}'.
User avatar
Dnpwwo
Posts: 820
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 »

The shutdown issue is being tracked in this viewtopic.php?f=6&t=8256 thread.
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
gixxersuperbike
Posts: 3
Joined: Wednesday 07 October 2015 19:40
Target OS: Windows
Domoticz version: 2.3267
Location: The Netherlands
Contact:

Re: Kodi Mediaserver Support

Post by gixxersuperbike »

First of all , Dnpwwo great work on this support for Kodi!
Been waiting a while for this to stop me breaking a leg during movie pauses :)

Got it up and running but I probably did something wrong....

I can get it to turn lights on during "Paused" on Kodi.
Pauze.jpg
Pauze.jpg (14.03 KiB) Viewed 5035 times
And I can get it to turn off on movie resume
Running.png
Running.png (10.12 KiB) Viewed 5035 times
But somehow I can't combine them.
Combined.png
Combined.png (14.46 KiB) Viewed 5035 times
Nothing seems to happen any more. (not even in 2 seperate events)

Where did I go wrong ?
I checked the "Show current states"
And they seem fine.
User avatar
Egregius
Posts: 2592
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 »

Nice implementation :)

When dark, lights go on when paused, off when unpaused, except when manually switched in the last hour.

Code: Select all

<?php
//KODI
	if($SLicht_Hall_Auto=='On') {
		if($Kodi['Status']=='Video') {
			if($DlevelZithoek>0 && xcache_get('dimtimeZithoek')<$time-3600) Schakel($DIZithoek, 'Off');
			if($DlevelEettafel>0 && xcache_get('dimtimeEettafel')<$time-3600) Schakel($DIEettafel, 'Off');
		}
		else if($Kodi['Status']=='Paused') {
			if($DlevelZithoek<20) Dim($DIZithoek, 25);
			if($DlevelEettafel<20) Dim($DIEettafel, 30);	
		}
	}
@gixxersuperbike You should also check if the light is already on or of. Otherwise the command will be sent every minute.
cwiekol
Posts: 4
Joined: Sunday 11 October 2015 11:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Kodi Mediaserver Support

Post by cwiekol »

Hi,
i'm quite new here in domoticz comunity, so excuse for my basic questions..

I've installed domoticz on my raspberry pi 1 (sd card image downloaded from domoticz.com)/ I did software update/upgrade and i'm running now 2.2563.
I cannot find Kodi support in my Hardware->type. How can i make it enable?

The second question:
gixxersuperbike posted pictures of some "puzzles" which seems to me GUI for programming my input/output devices.. could you please advise me what is that?

thanks
Michal
pvm
Posts: 550
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: 4.10538
Location: NL
Contact:

Kodi Mediaserver Support

Post by pvm »

I think kodi is only supported in the beta version and not in stable. You can, at your own risk, switch to beta verslons in the settings panel and update to the latest beta.

The puzzels are blocky which can be found in settings, events (i use a translaties version of domoticz, but should be something like that)
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
gixxersuperbike
Posts: 3
Joined: Wednesday 07 October 2015 19:40
Target OS: Windows
Domoticz version: 2.3267
Location: The Netherlands
Contact:

Re: Kodi Mediaserver Support

Post by gixxersuperbike »

@ Egregius : Thanks I should have thought about that...
Check Lights.png
Check Lights.png (19.87 KiB) Viewed 4975 times
But now this thing is driving me crazy....
It keeps switching on and off no matter which state Kodi has.....

And I don't see how this is possible because in the current states it shows only Video on play and Paused on pauze
cwiekol
Posts: 4
Joined: Sunday 11 October 2015 11:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Kodi Mediaserver Support

Post by cwiekol »

thanks,
just found both things..
however, i cannot install beta.. is there a way to do it/force it via ssh? trying to upgrade via web page i'm getting the following error (everytime, even after restarting server and/or raspberry):

Error while downloading Update,
check your internet connection or try again later !...

i didn't find a space on this forum dedicated to beta.. is there some?
pvm
Posts: 550
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: 4.10538
Location: NL
Contact:

Re: Kodi Mediaserver Support

Post by pvm »

Most of the forum is based on beta. Check the wiki for install and upgrade instructions
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
locogek
Posts: 28
Joined: Thursday 15 October 2015 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Kodi Mediaserver Support

Post by locogek »

Can I do something like turn a radio station on when pressing a switch?
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 »

Hello,
I installed the koi device yesterday without success.
Today, after some time I just deleted the device and created a new one.
Now it seems to work, but I get an error in the log:
2015-10-23 12:10:06.605 Kodi: (Minix) Event: 'Video - , 4x01. Green Arrow'.
2015-10-23 12:10:13.288 Kodi: (Minix) Event: 'On'.
2015-10-23 12:10:14.039 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-23 12:10:14.065 Kodi: (Minix) Event: 'Audio - , theme.mp3'.
Any idea what is going on?
I have a Minix device with koi 15.2 and experience 1080 theme.
User avatar
Dnpwwo
Posts: 820
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 are having issues it helps if you follow the instructions here: http://www.domoticz.com/wiki/Kodi#Troubleshooting because it gives us a lot more to go on.

I'm still running 14.2 and the 'OnPlay' event always returns picture, episode, song, channel or movie. Your Kodi has literally returned 'unknown' which surprising (anyone else seen this?) because I don't know how Kodi can play something when it doesn't know what it is ;)

Can you up the logging as described in the troubleshooting instructions and capture the log for a number of different files and post them and I'll have a look.
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 »

As you as see, the video event returns what is playing. Also the audio event. This appears ok in the switch.
kodi.gif
kodi.gif (8.78 KiB) Viewed 4780 times
So this is working. The remote also works as supposed.

The problem is with the message...
Maybe Kodi changed a lot with v15. I don't know if the theme could also affect.

Here's some more log for you.
2015-10-24 12:16:47.864 Hardware Monitor: Fetching data (System sensors)
2015-10-24 12:17:03.247 Kodi: (Minix) Connected to '192.168.1.28:9090'.
2015-10-24 12:17:03.248 Kodi: (Minix) Event: 'On'.
2015-10-24 12:17:08.779 Kodi: Restarting I/O service thread.
2015-10-24 12:17:17.949 Hardware Monitor: Fetching data (System sensors)
2015-10-24 12:17:48.033 Hardware Monitor: Fetching data (System sensors)
2015-10-24 12:18:18.131 Hardware Monitor: Fetching data (System sensors)
2015-10-24 12:18:40.386 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-24 12:18:40.410 Kodi: (Minix) Event: 'Audio - , theme.mp3'.
2015-10-24 12:18:48.215 Hardware Monitor: Fetching data (System sensors)
2015-10-24 12:19:15.794 Kodi: (Minix) Event: 'On'.
2015-10-24 12:19:18.299 Hardware Monitor: Fetching data (System sensors)
2015-10-24 12:19:25.866 Kodi: (Minix) Event: 'Video - , 4x01. Green Arrow'.
2015-10-24 12:19:36.510 Kodi: (Minix) Event: 'Paused - , 4x01. Green Arrow'.
2015-10-24 12:19:42.737 Kodi: (Minix) Event: 'Video - , 4x01. Green Arrow'.
2015-10-24 12:19:46.507 Kodi: (Minix) Event: 'On'.
2015-10-24 12:19:47.632 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-24 12:19:47.659 Kodi: (Minix) Event: 'Audio - , theme.mp3'.
2015-10-24 12:19:48.398 Hardware Monitor: Fetching data (System sensors)
2015-10-24 12:19:51.774 Kodi: (Minix) Event: 'On'.
2015-10-24 12:19:56.787 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-24 12:19:56.819 Kodi: (Minix) Event: 'Audio - , theme.mp3'.
2015-10-24 12:19:58.973 Kodi: (Minix) Event: 'Video - Fargo [S2E2], Before the Law'.
2015-10-24 12:20:11.698 Kodi: (Minix) Event: 'On'.
2015-10-24 12:20:12.832 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-24 12:20:12.862 Kodi: (Minix) Event: 'Audio - , theme.mp3'.
2015-10-24 12:20:16.440 Kodi: (Minix) Event: 'On'.
2015-10-24 12:20:17.756 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-24 12:20:17.779 Kodi: (Minix) Event: 'Audio - , theme.mp3'.
2015-10-24 12:20:18.548 Hardware Monitor: Fetching data (System sensors)
2015-10-24 12:20:19.124 Kodi: (Minix) Event: 'Video - The Flash (2014) [S2E3], Family of Rogues'.
2015-10-24 12:20:25.095 Kodi: (Minix) Event: 'Paused - The Flash (2014) [S2E3], Family of Rogues'.
2015-10-24 12:20:29.844 Kodi: (Minix) Event: 'Video - The Flash (2014) [S2E3], Family of Rogues'.
2015-10-24 12:20:29.958 Kodi: (Minix) Event: 'Paused - The Flash (2014) [S2E3], Family of Rogues'.
2015-10-24 12:20:31.495 Kodi: (Minix) Event: 'Video - The Flash (2014) [S2E3], Family of Rogues'.
2015-10-24 12:20:34.313 Kodi: (Minix) Event: 'On'.
2015-10-24 12:20:35.174 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-24 12:20:35.200 Kodi: (Minix) Event: 'Audio - , theme.mp3'.
2015-10-24 12:20:38.778 Kodi: (Minix) Event: 'On'.
2015-10-24 12:20:48.632 Hardware Monitor: Fetching data (System sensors)
2015-10-24 12:21:03.233 Kodi: (Minix) Event: 'Audio - Alphaville (First harvest 1984-1992), Big in Japan'.
2015-10-24 12:21:14.435 Kodi: (Minix) Event: 'Paused - Alphaville (First harvest 1984-1992), Big in Japan'.
2015-10-24 12:21:17.110 Kodi: (Minix) Event: 'Audio - Alphaville (First harvest 1984-1992), Big in Japan'.
2015-10-24 12:21:18.732 Hardware Monitor: Fetching data (System sensors)
2015-10-24 12:21:20.361 Kodi: (Minix) Event: 'On'.
User avatar
Dnpwwo
Posts: 820
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 »

From your log it looks like everything works. The message is there for debugging because I never thought it would happen.

I'll remove it from the next version
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 1 guest