Kodi Community Forum

Full Version: REST answer for a runing online radio "data.data.item.type" is "movie" instead "song"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I try to set some smart home rules which are only available if no movie or PVR runs in Kodi.
Normally the whole day online radio (.m3u) is running. If I ask kodi what is running (node-red) kodi tells me that it is a movie (payload.data.data.item.type). Is there another way to get the kind of media that is running?
This would be better asked in the JSON-RPC section so the people in the know have more chance to see it.

I'll move it there.
This section of the forum is a general everything concerning Kodi and not specifically a support thread. I think your query might be the music add-on section. Here's a link that might help.

Darrin suggested JSON-RPC which might be appropriate.
Hi PatK I don't need help for a radio addon. Becaus the stream works fine. I only need a way to check what type of media is currently playing.
I need this Information to be able to tell my robot vacuum cleaner that he should not clean while a movie runs.
Could you please share the m3u file you are using for radio playback, I can run some tests and probably find something.
m3u:

#EXTM3U

http://mp3.radio.ch/radiozuerisee128k

I use Kodi as Radio which runs most of the day. Because the TV power off if the screen shows the same Image a long time, I have visualization active.
i'm not familiar with node-red and how it interfaces with kodi, but if it is using json-rpc you can query the Player.HasAudio boolean using the XBMC.GetInfoBooleans json-rpc method.

https://kodi.wiki/view/JSON-RPC_API/v12#...foBooleans
https://kodi.wiki/view/List_of_boolean_c...ons#Player
I thought I could modifie this request I already use:
json:
"jsonrpc":"2.0",
        "id":1,
        "method":"XBMC.GetInfoLabels",
        "params":
            {"labels":["player.title",]},
       

Into:
json:
"jsonrpc":"2.0",
        "id":1,
        "method":"XBMC.GetInfoBooleans",
        "params":
            {"xbmc.getCondVisibility":["Player.HasVideo",]},
       

But that seems not working.
Do you know how I have to form the Request?
sure, you're close..you just need to change the name of the param to booleans

json:
"params":{"booleans":["Player.HasVideo"]}