Kodi switch to pause

I have installed Kodi binding and it works great.
I am trying to create a switch to “pause” the player. But there is no thing for pause like there is for Stop.
Can I accomplish that with rules? Any pseudo code will be appreciated!

Hi Michael

To pause Kodi it is the same command as Play. See at the Docs page under ‘Available Properties’: XBMC docs

Let me know if that works for you.

Cheers

Thanks for your reply! I was talking about a Switch that will pause/resume. (Stop it’s not the same with Pause)
Anyway I managed to accomplish that with the following code (if anyone find it useful in the future)
Rules

rule "Kodi Pause"
when
Item myKodi_Pause received command
then
if (receivedCommand==ON) {
sendCommand(kodiPlayer, PAUSE)
}
} else {
sendCommand(kodiPlayer, PLAY)
}
end

Items:

Player kodiPlayer “Kodi” {channel=“kodi:kodi:204a9010:control”}
Switch myKodi_Pause “Cody Pause” [“Switchable”] {channel=“kodi:kodi:204a9010:control”}

1 Like

Hi Michael,

I don’t think you need an extra item and a rule to realize your requirement. You can create a Switch item in a sitemap and use a mapping like this:

sitemap demo label="Kodi"
{
    Frame label="Kodi" {
        Switch item=kodiPlayer mappings=[PLAY='Play', PAUSE='Pause']
    }
}

Have a good one.

I needed the new Item in order to “Pause”, “Resume” my kodi using Siri (Homekit).

Alright, didn’t see that.