OSMC Pause-Light

Hi there!

Would it be possible to have a script running in the background checking if a movie is paused and if nothing is running?

I have a 5M RGB LED stripe around my projector screen. I would like it to light up when no movie is running and when a movie gets paused.

Maybe I could check if anything is running or is paused through the terminal somehow?

Looking forward to see creative solutions :slight_smile: The RGB light is controlled with gpio pins.

Yes this should be possible. No I have no idea how you’d do it though.

Yes via json rpc
http://kodi.wiki/view/JSON-RPC_API/Examples

Hi there Fzinken, I can’t find out how to use json rpc to check if anything is running through terminal. Sorry for being a rookie… Could you maybe explain further? :slight_smile:

Btw, as written I wish to be able to check if the movie is paused or not.

Through Json rpc I can find solution checking if there is any movie playing or not. But that’s not the same as if a movie is paused or not. :frowning:

You send json commands via the web interface. If you want to do it from the local command line you use 127.0.0.1

curl --header 'Content-Type: application/json' --data-binary '{ "id": 1, "jsonrpc": "2.0", "method": "Player.Stop", "params": { "playerid": 1 } }' 'http://127.0.0.1:8080/jsonrpc'

Eg use Player properties and check the speed. If speed=0 it is paused
http://kodi.wiki/view/JSON-RPC_API/v4#Player.Property.Name

Hi Fzinken.

Could you also give me an example of how the command would be for checking the Player.Probery.Name - speed?

:see_no_evil:

Sorry, but I think the explanation I gave above she be clear enough. Just replace the method.

Well, I’ll give it one more try :see_no_evil: I’m a rookie trying to get my little hobby project done :smiley:

curl --header 'Content-Type: application/json' --data-binary '{ "id": 1, "jsonrpc": "2.0", "method": "Player.Property.Value", "params": {"properties": ["speed"]}}' 'http://127.0.0.1:8080/jsonrpc'

Could you maybe try help me, what’s wrong here?

I am mobile so hard to check. But read this thread should tell you how to do it
https://forum.kodi.tv/showthread.php?tid=230874

This is the right syntax>

curl --header ‘Content-Type: applicati “2.0”, “method”: “Player.GetProperties”, “params”: {“playerid”:1,“properties”: [“speed”]}}’ ‘http://127.0.0.1:8080/jsonrpc’

Also if you have configured a user/password for the http access you need to add that

1 Like