Page 5 of 18

Re: Kodi Mediaserver Support

Posted: Saturday 03 October 2015 12:37
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

Re: Kodi Mediaserver Support

Posted: Saturday 03 October 2015 20:24
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).

Re: Kodi Mediaserver Support

Posted: Saturday 03 October 2015 21:28
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!

Re: Kodi Mediaserver Support

Posted: Sunday 04 October 2015 8:55
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.

Re: Kodi Mediaserver Support

Posted: Monday 05 October 2015 21:09
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.

Re: Kodi Mediaserver Support

Posted: Monday 05 October 2015 21:10
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!

Re: Kodi Mediaserver Support

Posted: Tuesday 06 October 2015 17:14
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":[]}'.

Re: Kodi Mediaserver Support

Posted: Wednesday 07 October 2015 12:09
by Dnpwwo
The shutdown issue is being tracked in this viewtopic.php?f=6&t=8256 thread.

Re: Kodi Mediaserver Support

Posted: Wednesday 07 October 2015 20:20
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 5050 times
And I can get it to turn off on movie resume
Running.png
Running.png (10.12 KiB) Viewed 5050 times
But somehow I can't combine them.
Combined.png
Combined.png (14.46 KiB) Viewed 5050 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.

Re: Kodi Mediaserver Support

Posted: Saturday 10 October 2015 10:41
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.

Re: Kodi Mediaserver Support

Posted: Sunday 11 October 2015 11:33
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

Kodi Mediaserver Support

Posted: Sunday 11 October 2015 12:29
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)

Re: Kodi Mediaserver Support

Posted: Sunday 11 October 2015 14:38
by gixxersuperbike
@ Egregius : Thanks I should have thought about that...
Check Lights.png
Check Lights.png (19.87 KiB) Viewed 4990 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

Re: Kodi Mediaserver Support

Posted: Sunday 11 October 2015 16:32
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?

Re: Kodi Mediaserver Support

Posted: Sunday 11 October 2015 23:12
by pvm
Most of the forum is based on beta. Check the wiki for install and upgrade instructions

Re: Kodi Mediaserver Support

Posted: Thursday 22 October 2015 22:37
by locogek
Can I do something like turn a radio station on when pressing a switch?

Re: Kodi Mediaserver Support

Posted: Friday 23 October 2015 12:16
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.

Re: Kodi Mediaserver Support

Posted: Saturday 24 October 2015 0:54
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.

Re: Kodi Mediaserver Support

Posted: Saturday 24 October 2015 12:23
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 4795 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'.

Re: Kodi Mediaserver Support

Posted: Sunday 25 October 2015 2:42
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