I try the Kodi Binding and everything works perfect.
Except the Kodi state for "Stop"
My rule knows the state “Play” & “Pause” but the state “Stop” doesnt work (it takes my rule for “Pause”).
My rule:
rule "Adjust living room lighting when XBMC starts/stops"
when
Item KodiKeller_Kontrolle changed
then
var String stateKino = KodiKeller_Kontrolle.state.toString()
if (Xbmc_Kino_EA.state == ON){
switch (stateKino.lowerCase) {
case "play" : {
Kino_ColorGroup1_Brightness.sendCommand(0)
Kino_ColorGroup2_Brightness.sendCommand(0)
Kino_ColorGroup3_Brightness.sendCommand(0)
Kino_ColorGroup4_Brightness.sendCommand(0)
}
case "pause" : {
Kino_ColorGroup1_Brightness.sendCommand(50)
Kino_ColorGroup2_Brightness.sendCommand(50)
Kino_ColorGroup3_Brightness.sendCommand(50)
Kino_ColorGroup4_Brightness.sendCommand(50)
}
case "stop" : {
callScript("langzeitdimmer_kino")
}
}
}
end
As a workaround: I solved this with the Script plugin on Kodi side. My Kodi issues MQTT commands on states. This is probably a little more complicated, but on the other hand, you have much more access to Kodi.
1 to find this out as well - as a test I have the state showing in my sitemap and it never shows stop, only play and pause (in caps as well - yuck)
Also noticed that the showtitle channel does not clear - always shows the last one played.
I guess the above comment about the smarthome comment also explaings why the player control doesnt have a stop button - wonder why this is the case I cant see why a basic media function like stop isnt included?
Have the same issue, play, pause works fine, but the stop channel doesn’t update if I stops from my Kodi remote. I have no idea why the stop has its own channel btw, why not put it in control like the rest?
rule "Kodi stopped or playing"
when
Item myKodiMediaType changed
then
if (myKodiMediaType.state == "") {
logInfo('Kodi','Kodi has stopped')
} else if (myKodiMediaType.state != null) {
logInfo('Kodi','kodi is playing something')
}
end
Edit: But I do agree that it makes little sense not to have a “STOP” state for the Player item
rule "Kodi stopped or playing"
when
Item myKodiMediaType changed
then
if (myKodiMediaType.state == "") {
E1Lachter1_Dimmer.sendCommand(100) // Kodi has stopped playing
} else if (myKodiMediaType.state != null) {
E1Lachter1_Dimmer.sendCommand(0) // Kodi is playing
}
end
The media player control was not changed but the Kodi bindings contains now a separate stop channel. Don’t remember when it was introduced but the current snapshot builds contains this channel
The stop channel doesn’t work properly for me. I can stop playback by sending ON to the stop channel. But when I stop playback in kodi directly, the channel doesn’t update in OH2.
Also nothing in the event log, I see that player, title and type for example change, but stop does not.
How can I check, which version of the addon I’m using? I tried via the karaf console, feature:list | grep kodi: openhab-binding-kodi | 2.0.0 | x | Started | addons-2.0.0 | Kodi Binding
But in Paper UI under Control, I see that Kodi has a Stop switch so I assume it is supported?