Page 18 of 18
Re: Kodi Mediaserver Support
Posted: Wednesday 13 February 2019 1:44
by Carthman
OK,
I will install the beta ASAP, then I will let you informed !
Many thanks !
Re: Kodi Mediaserver Support
Posted: Thursday 14 February 2019 0:14
by Carthman
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:
Kodi: (Kodi) Message warning, unhandled method: 'Player.OnResume'
message will disappear from the log (and hopefully the Kodi device state in Domoticz will switch back to 'Video').
It's working fine !
Thanks a lot for your help !
Re: Kodi Mediaserver Support
Posted: Friday 15 February 2019 16:39
by philchillbill
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
Code: Select all
/json.htm?type=command¶m=kodimediacommand&idx=nnn&action=ACTION
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:
Code: Select all
https://developer.amazon.com/docs/device-apis/alexa-seekcontroller.html
Kodi can handle such a command directly, as it's JSON RPC takes
Code: Select all
{ "jsonrpc": "2.0", "id": 1, "method": "Player.Seek", "params": { "value": { "seconds": 30 }, "playerid": 1 } }
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) ?
Re: Kodi Mediaserver Support
Posted: Sunday 17 February 2019 4:46
by Dnpwwo
@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.
Re: Kodi Mediaserver Support
Posted: Sunday 17 February 2019 8:01
by philchillbill
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
Re: Kodi Mediaserver Support
Posted: Sunday 17 February 2019 9:26
by Dnpwwo
@philchillbill,
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()
will list for incoming connections and messages. The HTTP Listener example under /plugins/examples shows how to do it.
Re: Kodi Mediaserver Support
Posted: Sunday 17 February 2019 20:53
by jake
@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)
Re: Kodi Mediaserver Support
Posted: Monday 18 February 2019 2:01
by Dnpwwo
@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'?
Re: Kodi Mediaserver Support
Posted: Monday 18 February 2019 21:03
by jake
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'?
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.
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.
Re: Kodi Mediaserver Support
Posted: Thursday 21 February 2019 17:25
by Calzor Suzay
I've added the Kodi Media server hardware and the device appears in switches but appear to 'cycle' seeing it.
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
From setup logs
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'.
Any ideas?
On Beta 4.10445 although this isn't new just looking to fix it now.
Re: Kodi Mediaserver Support
Posted: Thursday 21 February 2019 21:50
by Dnpwwo
@Calzor Suzay,
Looks like the Kodi is rejecting the connection, have you configured the Kodi to allow control by external applications?
Re: Kodi Mediaserver Support
Posted: Wednesday 13 March 2019 0:29
by Loky31
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
Re: Kodi Mediaserver Support
Posted: Friday 29 March 2019 14:52
by Thorgal789
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
Code: Select all
if (devicechanged['kodi']) then
print (devicechanged['kodi'])
if (devicechanged['kodi'] == 'Video') then
print('ok')
end
end
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".
Re: Kodi Medisserver Support
Posted: Monday 01 April 2019 21:23
by kraades
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.
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:
Re: Kodi Mediaserver Support
Posted: Tuesday 02 April 2019 8:03
by Dnpwwo
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?
Re: Kodi Mediaserver Support
Posted: Thursday 04 April 2019 17:08
by Calzor Suzay
Dnpwwo wrote: ↑Thursday 21 February 2019 21:50
@Calzor Suzay,
Looks like the Kodi is rejecting the connection, have you configured the Kodi to allow control by external applications?
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.
Re: Kodi Mediaserver Support
Posted: Friday 05 April 2019 19:26
by Thorgal789
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
Code: Select all
if (devicechanged['kodi']) then
print (devicechanged['kodi'])
if (devicechanged['kodi'] == 'Video') then
print('ok')
end
end
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 python plugin don't have the same problem ?
Re: Kodi Mediaserver Support
Posted: Saturday 04 May 2019 18:03
by Thorgal789
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 ?