REST answer for a runing online radio "data.data.item.type" is "movie" instead "song"
#1
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?
Reply
#2
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.
|Banned add-ons (wiki) Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

My Blog Posts
Reply
#3
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.
Reply
#4
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.
Reply
#5
Could you please share the m3u file you are using for radio playback, I can run some tests and probably find something.
Reply
#6

#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.
Reply
#7
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
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#8
I thought I could modifie this request I already use:
"jsonrpc":"2.0",
        "id":1,
        "method":"XBMC.GetInfoLabels",
        "params":
            {"labels":["player.title",]},
       

Into:
"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?
Reply
#9
sure, you're close..you just need to change the name of the param to booleans

"params":{"booleans":["Player.HasVideo"]}
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply



Logout Mark Read Team Forum Stats Members Help
REST answer for a runing online radio "data.data.item.type" is "movie" instead "song"0
This forum uses Lukasz Tkacz MyBB addons.