Kodi Mediaserver Support
Moderator: leecollings
-
- Posts: 31
- Joined: Friday 08 February 2019 8:35
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.9700
- Location: France
- Contact:
Re: Kodi Mediaserver Support
OK,
I will install the beta ASAP, then I will let you informed !
Many thanks !
I will install the beta ASAP, then I will let you informed !
Many thanks !
-
- Posts: 31
- Joined: Friday 08 February 2019 8:35
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.9700
- Location: France
- Contact:
Re: Kodi Mediaserver Support
It's working fine !Dnpwwo wrote: ↑Wednesday 13 February 2019 1:42 @Carthman,
Yes, you will need to switch to the Beta version. Change was pushed over 12 hours ago.
Once you start running the Beta version you will be able to tell if it contains the fix because the:message will disappear from the log (and hopefully the Kodi device state in Domoticz will switch back to 'Video').Kodi: (Kodi) Message warning, unhandled method: 'Player.OnResume'
Thanks a lot for your help !
- philchillbill
- Posts: 396
- Joined: Monday 12 September 2016 13:47
- Target OS: Linux
- Domoticz version: beta
- Location: Eindhoven. NL
- Contact:
Re: Kodi Mediaserver Support
I've recently implemented some basic Kodi transport control (play, pause, stop, next, previous, fast-forward, rewind, mute/unmute) in Alexa, using the fact that
can be 'hijacked' for this. My skill effectively uses Domoticz as a TLS/SSL bridge from the Amazon Cloud through to my internal network where I have Kodi running over HTTP. There is an Alexa interface called Alexa.SeekController that allows commands like Alexa, go back 10 seconds on Kodi or Alexa, skip 17 seconds on Kodi which I'd love to implement. See:
Kodi can handle such a command directly, as it's JSON RPC takes
My problem is that I need to channel this through the Domoticz handler for Kodi and so don't have access to Kodi itself from the outside world.
Any way that the list of actions for the kodimediacommand via Domoticz JSON could be extended with e.g. &seek=15 or &seek=-15 for the number of seconds to jump by (or, even better, milliseconds) ?
Code: Select all
/json.htm?type=command¶m=kodimediacommand&idx=nnn&action=ACTION
Code: Select all
https://developer.amazon.com/docs/device-apis/alexa-seekcontroller.html
Code: Select all
{ "jsonrpc": "2.0", "id": 1, "method": "Player.Seek", "params": { "value": { "seconds": 30 }, "playerid": 1 } }
Any way that the list of actions for the kodimediacommand via Domoticz JSON could be extended with e.g. &seek=15 or &seek=-15 for the number of seconds to jump by (or, even better, milliseconds) ?
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
- 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
@philchillbill,
If you run the Kodi Python plugin you could add a webserver listener on a separate port to Domoticz (example under /plugins/examples) to it and then send Alexa command to that, then you could translate them into the JSON RPC inside the plugin itself.
If you run the Kodi Python plugin you could add a webserver listener on a separate port to Domoticz (example under /plugins/examples) to it and then send Alexa command to that, then you could translate them into the JSON RPC inside the plugin itself.
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
- philchillbill
- Posts: 396
- Joined: Monday 12 September 2016 13:47
- Target OS: Linux
- Domoticz version: beta
- Location: Eindhoven. NL
- Contact:
Re: Kodi Mediaserver Support
Great idea. I’ll take a look at it. I had already started experimenting with Apache and proxypass to create different endpoints that all have the same external IP but map to different servers internally. Would be cool if the Domoticz webserver can do the same thing.
Sent from my iPhone using Tapatalk
Sent from my iPhone using Tapatalk
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
- 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
@philchillbill,
The Domoticz webserver can't (that I know of) but the Python Plugin Framework can.
Some simple Python like:will list for incoming connections and messages. The HTTP Listener example under /plugins/examples shows how to do it.
The Domoticz webserver can't (that I know of) but the Python Plugin Framework can.
Some simple Python like:
Code: Select all
self.httpServerConn = Domoticz.Connection(Name="Server Connection", Transport="TCP/IP", Protocol="HTTP", Port=Parameters["Port"])
self.httpServerConn.Listen()
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
-
- Posts: 742
- Joined: Saturday 30 May 2015 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Contact:
Re: Kodi Mediaserver Support
@Dnpwwo
Thanks for the quick modification of the plugin to support the latest change in Kodi18.
<del>Is it correct that you didn't update the version number? I saw 2.6.4 in the log after update of the plugin and switching it off/on again in Domoticz</del>
I assume that disable /enable a device on the hardware page is not sufficient, since I reviewed the python code, seeing that it indeed was 2.6.5 is mentioned there.
Kodi 18 is recently released for stable in Xbian for RPI, I therefore accidentically updated to it. Except for having to reset the screen resolution back from 640x480 to my 1920x1200 everything ran as before.
However, I came across one issue so far (and I wonder whether it should be looked at from the plugin side or Kodi side):
-Start a new audio album
-Kodi status in Domoticz is 'Audio'
-After 5:00 minutes, Kodi (shown in Domoticz log) gives a status update "GUI.OnScreensaverActivated received"
-Kodi status 'Screensaver' stays active until the next audio track starts, than the status is updated to Audio again
-All remaining tracks will be played afterwards without 'screensaver' status update, no matter how long the tracks are
-When the album is finished, Kodi status will be displayed as 'On' (normal behaviour). But will not turn to 'screensaver', even after > 30 minutes.
-When somewhere during play of the album, the pause button is used, and 'play' button afterwards, the 5:00 minutes thing with the screensaver starts over, repeating the list as described above.
This screensaver status behaviour didn't happen with previous Kodi versions.
I have a Kodi plugin that can do actions, based on Kodi status. This one sends it's preset (by me) virtual switch command to Domoticz 5 minutes after Kodi is idle. This still works fine! (based on this 'idle switch' I turn off my receiver)
Thanks for the quick modification of the plugin to support the latest change in Kodi18.
<del>Is it correct that you didn't update the version number? I saw 2.6.4 in the log after update of the plugin and switching it off/on again in Domoticz</del>
I assume that disable /enable a device on the hardware page is not sufficient, since I reviewed the python code, seeing that it indeed was 2.6.5 is mentioned there.
Kodi 18 is recently released for stable in Xbian for RPI, I therefore accidentically updated to it. Except for having to reset the screen resolution back from 640x480 to my 1920x1200 everything ran as before.
However, I came across one issue so far (and I wonder whether it should be looked at from the plugin side or Kodi side):
-Start a new audio album
-Kodi status in Domoticz is 'Audio'
-After 5:00 minutes, Kodi (shown in Domoticz log) gives a status update "GUI.OnScreensaverActivated received"
-Kodi status 'Screensaver' stays active until the next audio track starts, than the status is updated to Audio again
-All remaining tracks will be played afterwards without 'screensaver' status update, no matter how long the tracks are
-When the album is finished, Kodi status will be displayed as 'On' (normal behaviour). But will not turn to 'screensaver', even after > 30 minutes.
-When somewhere during play of the album, the pause button is used, and 'play' button afterwards, the 5:00 minutes thing with the screensaver starts over, repeating the list as described above.
This screensaver status behaviour didn't happen with previous Kodi versions.
I have a Kodi plugin that can do actions, based on Kodi status. This one sends it's preset (by me) virtual switch command to Domoticz 5 minutes after Kodi is idle. This still works fine! (based on this 'idle switch' I turn off my receiver)
- 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
@jake,
The plugin framework currently only refreshes version and parameter information during Domoticz startup so if the plugin.py has the new version in it then you should be fine.
Domoticz just reacts to the messages from the Kodi so if it broadcasts that the screensaver has kicked in then the Domoticz devices will reflect that. I'm interested though, does the screensaver actually kick in on the Kodi? I'm guessing it does which may be a change in behavior in the new version.
Is there a setting which controls this behavior, something like a 'Allow screensaver while playing music'?
The plugin framework currently only refreshes version and parameter information during Domoticz startup so if the plugin.py has the new version in it then you should be fine.
Domoticz just reacts to the messages from the Kodi so if it broadcasts that the screensaver has kicked in then the Domoticz devices will reflect that. I'm interested though, does the screensaver actually kick in on the Kodi? I'm guessing it does which may be a change in behavior in the new version.
Is there a setting which controls this behavior, something like a 'Allow screensaver while playing music'?
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
-
- Posts: 742
- Joined: Saturday 30 May 2015 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Contact:
Re: Kodi Mediaserver Support
I posted the issue on Xbian forums and it seems to be a known error. There was a fix published last night, however it doesn't work (yet). I guess another fix is needed.Dnpwwo wrote: ↑Monday 18 February 2019 2:01 @jake,
The plugin framework currently only refreshes version and parameter information during Domoticz startup so if the plugin.py has the new version in it then you should be fine.
Domoticz just reacts to the messages from the Kodi so if it broadcasts that the screensaver has kicked in then the Domoticz devices will reflect that. I'm interested though, does the screensaver actually kick in on the Kodi? I'm guessing it does which may be a change in behavior in the new version.
Is there a setting which controls this behavior, something like a 'Allow screensaver while playing music'?
While checking the Kodi - Status device's log, I see that a lot of updates have no description. No 'Audio' or 'Pause' descriptions are mentioned, while they are the device's state at those moments.
-
- Posts: 145
- Joined: Tuesday 08 July 2014 15:10
- Target OS: -
- Domoticz version: 4.9700
- Location: UK
- Contact:
Re: Kodi Mediaserver Support
I've added the Kodi Media server hardware and the device appears in switches but appear to 'cycle' seeing it.
From the switch log
From setup logs
Any ideas?
On Beta 4.10445 although this isn't new just looking to fix it now.
From the switch log
Code: Select all
2019-02-21 16:22:38 On
2019-02-21 16:22:37 Off
2019-02-21 16:21:36 On
2019-02-21 16:21:35 Off
2019-02-21 16:20:34 On
2019-02-21 16:20:33 Off
2019-02-21 16:19:32 On
2019-02-21 16:19:31 Off
2019-02-21 16:18:30 On
2019-02-21 16:18:29 Off
2019-02-21 16:17:28 On
2019-02-21 16:17:27 Off
2019-02-21 16:16:26 On
2019-02-21 16:16:25 Off
2019-02-21 16:15:24 On
2019-02-21 16:15:23 Off
2019-02-21 16:14:22 On
2019-02-21 16:14:21 Off
2019-02-21 16:13:20 On
2019-02-21 16:13:19 Off
2019-02-21 16:12:18 On
2019-02-21 16:12:17 Off
2019-02-21 16:11:16 On
2019-02-21 16:11:15 Off
2019-02-21 16:10:14 On
Code: Select all
2019-02-21 16:20:33.248 Kodi: (Kodi) Missed 1 pings, assumed off.
2019-02-21 16:20:33.251 Kodi: (Kodi) Event: 'Off'.
2019-02-21 16:20:33.257 Kodi: (Kodi) Disconnected.
2019-02-21 16:20:34.249 Kodi: (Kodi) Connected to '192.168.1.19:8080'.
2019-02-21 16:20:34.250 Kodi: (Kodi) Event: 'On'.
2019-02-21 16:20:43.972 Kodi: Restarting I/O service thread.
2019-02-21 16:21:35.259 Kodi: (Kodi) Missed 1 pings, assumed off.
2019-02-21 16:21:35.264 Kodi: (Kodi) Event: 'Off'.
2019-02-21 16:21:35.287 Kodi: (Kodi) Disconnected.
2019-02-21 16:21:36.261 Kodi: (Kodi) Connected to '192.168.1.19:8080'.
2019-02-21 16:21:36.261 Kodi: (Kodi) Event: 'On'.
2019-02-21 16:22:37.274 Kodi: (Kodi) Missed 1 pings, assumed off.
2019-02-21 16:22:37.275 Kodi: (Kodi) Event: 'Off'.
2019-02-21 16:22:37.279 Kodi: (Kodi) Disconnected.
2019-02-21 16:22:38.275 Kodi: (Kodi) Connected to '192.168.1.19:8080'.
2019-02-21 16:22:38.276 Kodi: (Kodi) Event: 'On'.
2019-02-21 16:22:45.996 Kodi: Restarting I/O service thread.
2019-02-21 16:23:39.285 Kodi: (Kodi) Missed 1 pings, assumed off.
2019-02-21 16:23:39.286 Kodi: (Kodi) Event: 'Off'.
2019-02-21 16:23:39.289 Kodi: (Kodi) Disconnected.
2019-02-21 16:23:40.287 Kodi: (Kodi) Connected to '192.168.1.19:8080'.
2019-02-21 16:23:40.289 Kodi: (Kodi) Event: 'On'.
On Beta 4.10445 although this isn't new just looking to fix it now.
- 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
@Calzor Suzay,
Looks like the Kodi is rejecting the connection, have you configured the Kodi to allow control by external applications?
Looks like the Kodi is rejecting the connection, have you configured the Kodi to allow control by external applications?
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
Re: Kodi Mediaserver Support
Hello,
Quitte à New comer on the topic I'm struggling to make something happen through à command from domoticz to kodi.
Is anyone able to show me an exemple of à "set" command to kodi to launch the reading of à playlist or à file ? ( in blokly )
Sorry for the noob question but i didn't manage to make anything happen even if the contrôl remote from domoticz is working well with my kodi
Many Thanks in advance
Quitte à New comer on the topic I'm struggling to make something happen through à command from domoticz to kodi.
Is anyone able to show me an exemple of à "set" command to kodi to launch the reading of à playlist or à file ? ( in blokly )
Sorry for the noob question but i didn't manage to make anything happen even if the contrôl remote from domoticz is working well with my kodi
Many Thanks in advance
-
- Posts: 815
- Joined: Wednesday 15 August 2018 14:38
- Target OS: -
- Domoticz version:
- Contact:
Re: Kodi Mediaserver Support
Hi, I have some problem to detect when a video is starting. If the player is off, it works without problem, but if I m already playing a video and change it, I haven't notification, I need to stop the previous one and start the second one.
The code I m using
I m on the domoticz version 4.9700 so perhaps it's already corrected.
I know the state is always the same (video) but the title is changed, and for exemple for my switch, I have a notification every time I press the button even the state is "button pressed".
The code I m using
Code: Select all
if (devicechanged['kodi']) then
print (devicechanged['kodi'])
if (devicechanged['kodi'] == 'Video') then
print('ok')
end
end
I know the state is always the same (video) but the title is changed, and for exemple for my switch, I have a notification every time I press the button even the state is "button pressed".
- kraades
- Posts: 36
- Joined: Wednesday 24 June 2015 9:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: The Netherlands
- Contact:
Re: Kodi Medisserver Support
Hi,
Is it now possible to get de Kodi status in a blockly? See below for the original question from a while back.
And is the solution now event driven instead of using a polling mechanism?
Thanks.
Is it now possible to get de Kodi status in a blockly? See below for the original question from a while back.
And is the solution now event driven instead of using a polling mechanism?
Thanks.
kraades wrote: ↑Saturday 29 August 2015 9:09 Thanks.
I installed it and it works fine, but how can I get the Kodi status in a blockly?
Edit:
...or in general switch on a lamp if Kodi is paused.
Like for example:Code: Select all
If Kodi = Paused Do Light = On
- 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
Both the native support and Python plugin are event driven not polled.
Media states show up in the Blockly drop down for me, not sure why they don't seem to for you. Maybe switch to a newer version of Domoticz?
Media states show up in the Blockly drop down for me, not sure why they don't seem to for you. Maybe switch to a newer version of Domoticz?
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
-
- Posts: 145
- Joined: Tuesday 08 July 2014 15:10
- Target OS: -
- Domoticz version: 4.9700
- Location: UK
- Contact:
Re: Kodi Mediaserver Support
Any idea how/where I fix this?
Actually pretty sure this is turned on as I use an app on two phones that are connected over that IP/port and they work fine.
Also just tried 127.0.0.1 as Kodi and Domoticz run on same box, still same.
-
- Posts: 815
- Joined: Wednesday 15 August 2018 14:38
- Target OS: -
- Domoticz version:
- Contact:
Re: Kodi Mediaserver Support
The python plugin don't have the same problem ?Thorgal789 wrote: ↑Friday 29 March 2019 14:52 Hi, I have some problem to detect when a video is starting. If the player is off, it works without problem, but if I m already playing a video and change it, I haven't notification, I need to stop the previous one and start the second one.
The code I m using
I m on the domoticz version 4.9700 so perhaps it's already corrected.Code: Select all
if (devicechanged['kodi']) then print (devicechanged['kodi']) if (devicechanged['kodi'] == 'Video') then print('ok') end end
I know the state is always the same (video) but the title is changed, and for exemple for my switch, I have a notification every time I press the button even the state is "button pressed".
-
- Posts: 815
- Joined: Wednesday 15 August 2018 14:38
- Target OS: -
- Domoticz version:
- Contact:
Re: Kodi Mediaserver Support
Ok, so domoticz have the event "video" but it don't trigger the XBMC device is there is no change. So If you are already playing a video, and launch a second one you will not trigger the devicechanged fonction.
Someone have a tips ?
Someone have a tips ?
Who is online
Users browsing this forum: No registered users and 1 guest