I want to pause Kodi when an incoming call comes and resume playback when call ends. However, I only want to detect the current state of Kodi i.e. whether it is playing something or not. I dont see any way to figure out the binding.
Here is my rule
rule "Incoming call"
when
Item Incoming_Call received command
then
if (receivedCommand==ON) {
sendCommand(KodiMediacenter_Control, PAUSE)
}
else {
sendCommand(KodiMediacenter_Control, PLAY)
}
end
How is KodiMediacenter_Control defined, and which binding version are you using ?
I saw a couple of older threads when reading up on this, and state detection didn’t seem to work reliably back then.
The KodiMediacenter_Control item should have the item type Player like this:
Player KodiMediacenter_Control "Kodi control" {
channel="kodi:kodi:myKodi:control"
}
Point is that the state of a Player item can only be PLAY or PAUSE. You cannot see if the state is something like STOP. If you need this you have to add an extra Switch item like this: