estbeetoo / node-red-contrib-kodi

Node-RED plugin (node) to communicate with Kodi/XBMC
Other
3 stars 4 forks source link

no responses received ? #4

Closed zosky closed 4 years ago

zosky commented 6 years ago

i am able to send messages to kodi with the output node and get what kodi broadcasts with the input (like onPlay, onPause...)

where are the replies to msgs i send ? im trying to find what is playing ... and get it back but i am missing something ?

here's my flow. shouldn't the getPlayer inject cause a new msg on kodi-input ?

zosky commented 6 years ago

i ended up what i need using the tcp-request function, which has in and out. should their be a kodi function with in & out too or am i missing something super obvious ?

aborovsky commented 5 years ago

@zosky Kodi-in node works properly, just checked. You may test my test Flow:

[{"id":"333ed853.ced4f","type":"kodi-in","z":"ec70309.83665d","name":"","controller":"c3b9a0e0.c292","x":780,"y":80,"wires":[["d25af5a.9d07708"]]},{"id":"d25af5a.9d07708","type":"debug","z":"ec70309.83665d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":960,"y":80,"wires":[]},{"id":"c3b9a0e0.c292","type":"kodi-controller","z":"","name":"WC player //192.168.5.24","host":"localhost","port":"9090"}]

With this i've got events in Debug tab:

{"topic":"kodi","payload":{"notification":"GUI.OnScreensaverDeactivated","data":{"data":{"shuttingdown":false},"sender":"xbmc"}},"_msgid":"2fef71da.28a17e"}
{"topic":"kodi","payload":{"notification":"Player.OnPlay","data":{"data":{"item":{"title":"Lounge FM Terrace","type":"song"},"player":{"playerid":0,"speed":1}},"sender":"xbmc"}},"_msgid":"dfb5e1b9.7f3dd"}
vajonam commented 5 years ago

This is okay when staring stopping content, but similar to the OP's question, I want to check the output from this before I do an update on a library for instance, only update the library when nothing is playing. like the OP said, could use tcp/in/out node, but looks like this sort of functionality isn't supported

{"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1}

zosky commented 5 years ago

i think this may be a delta between what i expected this to do and what it does ?

seems we're both expecting any msg pushed through the out node to trigger a response on the in node, but i think the input node (like the TCP node) only receives what kodi is broadcasting like "i started playing", "i started scanning", "I started the screenSaver"

when i need a response back -like all shows in a tag, or movie meta- i use HTTP node pointing at http://{{sender}}/jsonrpc

for the record i scan clean only if inactive by checking the last msg received on TCP-IN ... if not screenSaver active... check the next one

aborovsky commented 5 years ago

kodi-in node really works for me. it received kodi status notifications as it should. All types, mentioned here: https://kodi.wiki/view/JSON-RPC_API/v8#Notifications_2