Page 16 of 18

Re: Kodi Mediaserver Support

Posted: Sunday 05 March 2017 23:15
by jake
The '0' stands for the nvalue, something I don't really understand either. Anyway, the mentioned levels behind it are the svalues, that stand for the actual values of the updated item (the selector switch)

Just follow the instruction and see of it works.

Re: Kodi Mediaserver Support

Posted: Friday 10 March 2017 19:11
by mvveelen
Anyone using the OSMC version of Kodi? Since a while it's switching the status on/off every minute. Didn't change anything in the settings of Kodi/OSMC, but to solve this I tried adding the lines to the .xml file and also tried another port instead of 9090. But didn't help.

Any help on how to solve this would be much appreciated.

Re: Kodi Mediaserver Support

Posted: Monday 03 April 2017 13:02
by Trigun
Hi Jake,

I've tested the script for a while now and it seems its working perfectly!
I have no issues and the multi selector switch works great now!

thank you for your help & effort!

Grtz.

Bas

Re: Kodi Mediaserver Support

Posted: Thursday 06 April 2017 9:56
by bueno79
Hi,

Domoticz is not alble to start Kodi ? I use domoticz last stable and kodi on an asus chromebox (kodi is libreelec, the lastest stable). Domoticz can shutdown, control but not start ?

It is sad cause I can start it with a specific button Wake on Lan on port 9.

Re: Kodi Mediaserver Support

Posted: Monday 10 April 2017 1:48
by markjgabb
my understanding it the problem is the kodi web server needs to be started for domoticz to talk to it....
which cant happen if kodi isnt already started

Re: Kodi Mediaserver Support

Posted: Saturday 15 April 2017 17:01
by mvveelen
mvveelen wrote:Anyone using the OSMC version of Kodi? Since a while it's switching the status on/off every minute. Didn't change anything in the settings of Kodi/OSMC, but to solve this I tried adding the lines to the .xml file and also tried another port instead of 9090. But didn't help.

Any help on how to solve this would be much appreciated.
Still the same problem. Log:

Code: Select all

2017-04-15 16:55:50.664 Kodi: (Kodi) Connected to '192.168.0.100:8080'.
2017-04-15 16:55:50.665 Kodi: (Kodi) Event: 'On'.
2017-04-15 16:55:57.354 Kodi: Restarting I/O service thread.
2017-04-15 16:56:52.425 Kodi: (Kodi) Missed 1 pings, assumed off.
2017-04-15 16:56:52.426 Kodi: (Kodi) Event: 'Off'.
2017-04-15 16:56:52.529 Kodi: (Kodi) Disonnected.
2017-04-15 16:56:53.435 Kodi: (Kodi) Connected to '192.168.0.100:8080'.
2017-04-15 16:56:53.435 Kodi: (Kodi) Event: 'On'.
2017-04-15 16:56:59.644 Kodi: Restarting I/O service thread.
2017-04-15 16:57:55.144 Kodi: (Kodi) Missed 1 pings, assumed off.
2017-04-15 16:57:55.145 Kodi: (Kodi) Event: 'Off'.
2017-04-15 16:57:55.233 Kodi: (Kodi) Disonnected.
2017-04-15 16:57:56.155 Kodi: (Kodi) Connected to '192.168.0.100:8080'.
2017-04-15 16:57:56.156 Kodi: (Kodi) Event: 'On'.
2017-04-15 16:58:01.964 Kodi: Restarting I/O service thread.
2017-04-15 16:58:57.894 Kodi: (Kodi) Missed 1 pings, assumed off.
2017-04-15 16:58:57.895 Kodi: (Kodi) Event: 'Off'.
2017-04-15 16:58:57.979 Kodi: (Kodi) Disonnected.
2017-04-15 16:58:58.905 Kodi: (Kodi) Connected to '192.168.0.100:8080'.
2017-04-15 16:58:58.905 Kodi: (Kodi) Event: 'On'.
2017-04-15 16:59:04.244 Kodi: Restarting I/O service thread.
2017-04-15 17:00:00.684 Kodi: (Kodi) Missed 1 pings, assumed off.
2017-04-15 17:00:00.910 Kodi: (Kodi) Event: 'Off'.
2017-04-15 17:00:01.796 Kodi: (Kodi) Disonnected.
2017-04-15 17:00:02.704 Kodi: (Kodi) Connected to '192.168.0.100:8080'.
2017-04-15 17:00:02.706 Kodi: (Kodi) Event: 'On'.
2017-04-15 17:00:06.654 Kodi: Restarting I/O service thread.
Which port to use, and do I have to change something in the .xml file or not? Tried several options, but none of them helped.

Tried with an extra advanced settings.xml and selected port 9095, but I kept getting "connection refused..." errors. Also with ports 9090 or 9094. With port 8080 I don't receive that error, but then it keeps telling me every minute that it's offline and after 1 second it is online.

Grrrr....

Edit:

finally decided to delete OSMC and install OpenELEC. With OpenELEC it seems to work (after adding the advanced settings.xml). When I use port -9090 I see everything working well. But if I change to port 9090, I get an error message and then it tells me Kodi is off. When I turn the switch on, it works fine. So I THINK (...) it's OK for now.

Re: Kodi Mediaserver Support

Posted: Sunday 04 June 2017 15:22
by 1kohm
Hi,

I'm using OSMC with kodi version 17.2 on RPi2.
Domoticz is running in RPi3 v3.5877
When I've connected kodi to domoticz via HW setup with port "8080" I had the same results as you guys - Kodi on/off, on/off - no movie info.
When I've changed to 9090 I've got:

Code: Select all

2017-06-04 15:07:40.706 Error: Kodi: (MediaCenter) Async Read Exception: 125, Operation canceled
and Kodi was Off.
According to domoticz wiki I've enabled debug by entering "-9090" but the output was the same.
In my case the issue was missing "advancedsettings.xml" file. In my case it's located under:

Code: Select all

osmc@MediaCenter:~/.kodi$ cd userdata/
and contains:

Code: Select all

<advancedsettings>
<jsonrpc>
<tcpport>9090</tcpport>
</jsonrpc>
</advancedsettings>
After creating this file YOU HAVE TO REBOOT KODI.
Then Kodi was On in Domoticz and everything works.
That's not the end of the story...
So now, when I've disabled debug by entering port "9090" Kodi went back Off in Domoticz... :(
The fix was to reset Kodi :)
Bottim line:
-missing advancedsettings.xml
- reset kodi after each port change in Domoticz

Re: Kodi Mediaserver Support

Posted: Tuesday 04 July 2017 0:53
by markjgabb
has anyone seen this is there kodi logs before?


2017-07-04 08:39:43.541 Kodi: (markez) Missed 5 pings, assumed off.
2017-07-04 08:39:43.543 Kodi: (markez) Event: 'Off'.
2017-07-04 08:39:43.739 Kodi: (markez) Disonnected.
2017-07-04 08:39:44.555 Kodi: (markez) Connected to '10.0.0.34:8080'.
2017-07-04 08:39:44.556 Kodi: (markez) Event: 'On'.

this happens almost once per minute....this is an exact clone of 2 other devices in my system other than IP address of course.... but it keeps reporting this in log..
only recent change is i updates to the new libreelec 8.0.1 im guessing something has changed in that model...
is anyone else using that version that can confirm?

Re: Kodi Mediaserver Support

Posted: Friday 04 August 2017 23:22
by HM31
Just installed Kodi mediaserver support in Domoticz (on Synology NAS).
All seems to work as expected : Kodi reports to device in Domoticz, remote control from domoticz to Kodi is also working.

But I get some errors in log looking like this when report came from Kodi

Code: Select all

2017-08-04 17:00:33.798 Kodi: (TV-Salon) Event: 'Video - Guardians (2009)'.
2017-08-04 17:00:33.798 Error: EventSystem: Could not determine switch type for event device TV-Salon 
And like this when command is sent using Domoticz remote in the switch

Code: Select all

 2017-08-04 16:58:46.118 Kodi: (TV-Salon) Sent command: 'Input.ExecuteAction playpause'.
2017-08-04 16:58:46.253 Kodi: (TV-Salon) Event: 'Video - Guardians (2009)'.
2017-08-04 16:58:46.253 Error: EventSystem: Could not determine switch type for event device TV-Salon 
When I stop the video on Kodi directly I get

Code: Select all

 2017-08-04 17:13:59.342 Kodi: (TV-Salon) Event: 'On'.
2017-08-04 17:13:59.343 Error: EventSystem: Could not determine switch type for event device TV-Salon 
Thus it seems that it is when event came from Kodi. What does it mean ?

Synology DS214Play DSM 5.2-5644 Update 5
Domocticz Version: 3.7324 Build Hash: 09c345e-modified Compile Date: 2017-04-14 16:06:38
Kodi 17.3 Git:20170524-147cec4 Compile Date : May 24 2017

Re: Kodi Mediaserver Support

Posted: Sunday 13 August 2017 18:54
by dressie
Hi guys,

I just installed Kodi and it works great with Domoticz! I'm just curious if it's possible to start an action with the "data" field.
For example: when I play a workout video I want the living room fan to turn on when I'm into it for 30 seconden. I tried blocky by putting the data-info in an comment field, but it doesn't work.
Did anyone try it yet and is able to post an example?

Thanks!

Re: Kodi Mediaserver Support

Posted: Sunday 10 September 2017 20:40
by jake
With either a normal remote, or even the Kodi plugin 'on-screen' remote, it is possible to rewind the playing item to the beginning (0:00). In order to do that through a LUA script, I have searched all over the place for a json command to do the same. This is the only thing I came across, that was close to what I need:

Code: Select all

http://192.168.1.101:8080/jsonrpc?request={"jsonrpc":"2.0","method":"Input.ExecuteAction","params":{"action":"rewind"},"id":1}
However, this 'Rewind' command performs the '<<' action and not the '|<<' action instead.

Any suggestions?

Re: Kodi Mediaserver Support

Posted: Monday 16 October 2017 9:04
by Hugo857
leaving your living-room and also figure out in a wiz. Android TV Box Remote Controller To transform your normal TV right into Android TV.

Re: Kodi Mediaserver Support

Posted: Saturday 18 November 2017 9:38
by rizzah
Hi,

I am using Kodi on a Nvidia Shield. Im not 100% sure if this would work (starting kodi) when the shield is in standby mode. I can make the connection using the kodi wiki. That part is fine, when i start a movie i see in the log: 2017-11-18 09:36:54.065 Kodi: (Kodi) Event: 'Video - Good Time (2017)'.

So connection so far is working. However when i look at my switches i see Kodi as "on". When i try to disable it, i get a popup from domoticz saying:
Error sending switch command, check device/hardware !

At that moment i see in the log file:
2017-11-18 09:36:09.052 User: admin initiated a switch command (424/Kodi/Off)
2017-11-18 09:36:09.053 Kodi: (Kodi) Shutdown requested but is probably not supported.

I have tried to add an advancedsettings.xml in the right dir on my nvidia shield and restarted kodi. But this did not help.
Can anyone help me with this?

Re: Kodi Mediaserver Support

Posted: Sunday 19 November 2017 2:27
by CDuv
I confirm something is weird (at least to my understanding) about Kodi-triggered events support in Domoticz.

Here are the Kodi events as shown in the Domoticz Log page for various Kodi actions:
Kodi is starting:
2017-11-19 01:44:45.540 Kodi: (mykodi) Connected to 'kodi.example.lan:9090'.
2017-11-19 01:44:45.569 Kodi: (mykodi) Event: 'On'.
Starting video playback:
2017-11-19 01:39:16.515 Kodi: (mykodi) Event: 'Video - Some TV Show [S4E2], Some title (1970)'.
Pausing video playback:
2017-11-19 01:39:36.051 Kodi: (mykodi) Event: 'Paused - Some TV Show [S4E2], Some title (1970)'.
Resuming video playback:
2017-11-19 01:39:49.961 Kodi: (mykodi) Event: 'Video - Some TV Show [S4E2], Some title (1970)'.
Video playback stops (manual stop or end of file):
2017-11-19 01:39:59.856 Kodi: (mykodi) Event: 'On'.
Kodi shutdowns:
2017-11-19 01:44:07.301 Kodi: (mykodi) Event: 'Off'.
2017-11-19 01:44:07.819 Kodi: (mykodi) Disonnected.
I have created a Blockly test event (Event Type = Device) for debugging purpose as follows:
Kodi-BlocklyEvent.png
Kodi-BlocklyEvent.png (158.89 KiB) Viewed 7468 times
But the only log entries I get from it are:
For Kodi starting and video playback stops:
EventSystem: Event triggered: KodiTest_1
DEBUG: Kodi=On
and Kodi shutdowns:
EventSystem: Event triggered: KodiTest_2
DEBUG: Kodi=Off
It seems Domoticz correctly receives Kodi changes of states but does not triggers Blockly events accordingly

Version used:
Kodi: v17.5-RC1
Domoticz: v3.8742 (beta)

Re: Kodi Mediaserver Support

Posted: Tuesday 26 December 2017 15:59
by TheCondor
Hello @ all and merry Christmas.
There's any possibility to change the default behaviour of the KODI hardware plugin inside domoticz?
For instance i have imagine this scenario:

when nothing is playing in kodi -> kodi goes to screensaver (after some minutes)
when kodi goes in screensaver -> tv and amp is shutted down (trough CEC)
when i power on tv trough its remote -> cec wake up kodi
when i power on tv trough domoticz -> cec wake up tv

the only need i have is to let domoticz to know WHEN kodi is in screensaver mode, and it's seems possible trough json, check here:
https://forum.kodi.tv/showthread.php?tid=214466
as current domoticz plugin know when it's in playing or in ON-IDLE.
Maybe is also better if we can set screensaver ON-OFF as method for know when kodi box is ON or OFF instead a PING.
Anybody can help about this? Thanks in advance!

Re: Kodi Mediaserver Support

Posted: Tuesday 26 December 2017 21:59
by Bartb
CDuv wrote: Sunday 19 November 2017 2:27 I confirm something is weird (at least to my understanding) about Kodi-triggered events support in Domoticz.

Here are the Kodi events as shown in the Domoticz Log page for various Kodi actions:
Kodi is starting:
2017-11-19 01:44:45.540 Kodi: (mykodi) Connected to 'kodi.example.lan:9090'.
2017-11-19 01:44:45.569 Kodi: (mykodi) Event: 'On'.
Starting video playback:
2017-11-19 01:39:16.515 Kodi: (mykodi) Event: 'Video - Some TV Show [S4E2], Some title (1970)'.
Pausing video playback:
2017-11-19 01:39:36.051 Kodi: (mykodi) Event: 'Paused - Some TV Show [S4E2], Some title (1970)'.
Resuming video playback:
2017-11-19 01:39:49.961 Kodi: (mykodi) Event: 'Video - Some TV Show [S4E2], Some title (1970)'.
Video playback stops (manual stop or end of file):
2017-11-19 01:39:59.856 Kodi: (mykodi) Event: 'On'.
Kodi shutdowns:
2017-11-19 01:44:07.301 Kodi: (mykodi) Event: 'Off'.
2017-11-19 01:44:07.819 Kodi: (mykodi) Disonnected.
I have created a Blockly test event (Event Type = Device) for debugging purpose as follows:
Kodi-BlocklyEvent.png

But the only log entries I get from it are:
For Kodi starting and video playback stops:
EventSystem: Event triggered: KodiTest_1
DEBUG: Kodi=On
and Kodi shutdowns:
EventSystem: Event triggered: KodiTest_2
DEBUG: Kodi=Off
It seems Domoticz correctly receives Kodi changes of states but does not triggers Blockly events accordingly

Version used:
Kodi: v17.5-RC1
Domoticz: v3.8742 (beta)
I have the same issue since quite a while.
One way it is partially solved is by looking at the statusses in alphabetic order.
Meaning status Paused is smaller then Video (P comes before V) etc etc
When a video plays the status is not just Video. The status when playing a video is more like "Video - Armagedon"
So anything greater than "Video" means its playing something at least.

The following blocky works for me:
Screenshot_20171226-215431.jpg
Screenshot_20171226-215431.jpg (280.46 KiB) Viewed 7086 times
In other words I can confirm having the same issue, which I actually believe is a bug. It should be fixed, but my workaround solves it partially.

Re: Kodi Mediaserver Support

Posted: Wednesday 27 December 2017 1:10
by jake
TheCondor wrote:Hello @ all and merry Christmas.
There's any possibility to change the default behaviour of the KODI hardware plugin inside domoticz?
For instance i have imagine this scenario:

when nothing is playing in kodi -> kodi goes to screensaver (after some minutes)
when kodi goes in screensaver -> tv and amp is shutted down (trough CEC)
when i power on tv trough its remote -> cec wake up kodi
when i power on tv trough domoticz -> cec wake up tv

the only need i have is to let domoticz to know WHEN kodi is in screensaver mode, and it's seems possible trough json, check here:
https://forum.kodi.tv/showthread.php?tid=214466
as current domoticz plugin know when it's in playing or in ON-IDLE.
Maybe is also better if we can set screensaver ON-OFF as method for know when kodi box is ON or OFF instead a PING.
Anybody can help about this? Thanks in advance!
Please check out this topic:
https://www.domoticz.com/forum/viewtopi ... 11#p161311
it is a python plugin for Kodi and just some weeks ago the 'Sleeping' mode has been added to the list of Kodi status options.

Before that I used a plugin within Kodi to send a JSON command to Domoticz to enable a self created virtual switch called 'Kodi Idle'. That switch is the trigger to switch on/off some devices. I mentioned the procedure in the same topic:
https://www.domoticz.com/forum/viewtopi ... 63#p144963



Re: Kodi Mediaserver Support

Posted: Wednesday 27 December 2017 22:26
by TheCondor
jake wrote: Wednesday 27 December 2017 1:10
TheCondor wrote:Hello @ all and merry Christmas.
There's any possibility to change the default behaviour of the KODI hardware plugin inside domoticz?
For instance i have imagine this scenario:

when nothing is playing in kodi -> kodi goes to screensaver (after some minutes)
when kodi goes in screensaver -> tv and amp is shutted down (trough CEC)
when i power on tv trough its remote -> cec wake up kodi
when i power on tv trough domoticz -> cec wake up tv

the only need i have is to let domoticz to know WHEN kodi is in screensaver mode, and it's seems possible trough json, check here:
https://forum.kodi.tv/showthread.php?tid=214466
as current domoticz plugin know when it's in playing or in ON-IDLE.
Maybe is also better if we can set screensaver ON-OFF as method for know when kodi box is ON or OFF instead a PING.
Anybody can help about this? Thanks in advance!
Please check out this topic:
https://www.domoticz.com/forum/viewtopi ... 11#p161311
it is a python plugin for Kodi and just some weeks ago the 'Sleeping' mode has been added to the list of Kodi status options.

Before that I used a plugin within Kodi to send a JSON command to Domoticz to enable a self created virtual switch called 'Kodi Idle'. That switch is the trigger to switch on/off some devices. I mentioned the procedure in the same topic:
https://www.domoticz.com/forum/viewtopi ... 63#p144963
Awesome!!! I've Just a mod to suggestione. Thanks the TV is now fully controlled under domoticz!!

Re: Kodi Mediaserver Support

Posted: Sunday 22 April 2018 9:04
by JesusArmy
Hello there,

I have some strange issue with Kodi plugin.

I can see what it is playing and get events from Domoticz. I can also use the Domoticz Kodi remote, so I guess communication using JSON from Domoticz to Kodi is working fine.

But, I am not able to launch anything from Blocky. For example, this simple Blocky does not do anything... :(

Image

I have also tried to replace the "Play Favorites" with "Pause", "Stop", etc, but nothing happen too...
Anything obious that I am doing wrong here ?

Re: Kodi Mediaserver Support

Posted: Sunday 29 April 2018 21:51
by DosN
Hi

im busy with Kodi mediaserver with Domoticz
it is working , when now i press play at kodi , my light will switch in color
So when status is "Video"

But what i actually want, is when i play a movie it should switch the lights, and not when i stream IPTV
Is there a way to to see a difference ?? and to used that in a LUA script??

The status "Video" is when the device starts streaming Live TV, TV Shows or Movies.

but what i see in the log is

2018-04-28 22:58:25 Video - NL: FOX Sports 1 Eredivisie 720p, Jupiler League op Zaterdag Schakelshow
2018-04-28 22:58:09 Video - Big Hero 6 (2014)

So it would be nice if i could check in LUA what is played actially. Filter on "NL:" or on "(2014)" is that possible