Title info is changing when other action is made

Hello all;

I'm still trying to handle Kodi-node-red working, but there is another problem.

I can see the title of playing a song or video. This image is a properly working title example:

However, when I try to change volume, the title field and year field become like this:

I also want to remind you that if something plays via youtube, the title and year working well. But when I listen to music from my library, I can't see the info. I have found some examples over the internet, and one of them is below: (Please note, http://kodiipaddress:kodiport field is related to Kodi's IP address and port. If you don't have Kodi, you might not be able to work with this. The address should be pasted in the browser.)

http://kodiipaddress:kodiport/jsonrpc?request={"jsonrpc": "2.0", "method": "Player.GetItem", "params": { "properties": ["title", "album", "artist", "season", "episode", "duration", "showtitle", "tvshowid", "thumbnail", "file", "fanart", "streamdetails"], "playerid": 1 }, "id": "VideoGetItem"}

The example address above working very well and show every kind of information regardless of youtube or library sources. But I could not import this into Node-Red in order to see info like in image 1.

All my eyes open for your advice! Thanks in advance.

Show us the configuration of the display node that is showing the wrong thing, and put a debug node showing what is going into that node to see what it is being sent. This is the process of debugging. You have to look at the data going in and what you are telling the system to do with it and work out why it is not behaving as you expect. Also don't complicate the issue by considering other examples on the internet. Concentrate on what you have and on getting it to do what you want.

Hello Colin,

This flow showing image 1 when you play something via youtube.

[{"id":"37b37ea9.6287b2","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"3ccbfc8a.e078f4","type":"kodi-in","z":"37b37ea9.6287b2","name":"kodi","controller":"d202ce84.24c45","x":433,"y":525.67724609375,"wires":[["3fbc2b19.ab6894"]],"outputLabels":["title"]},{"id":"c613a39b.10347","type":"debug","z":"37b37ea9.6287b2","name":"baslik-debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":812,"y":469.67724609375,"wires":[]},{"id":"75da431e.8ee85c","type":"ui_text","z":"37b37ea9.6287b2","group":"2f101410.857cfc","order":13,"width":0,"height":0,"name":"","label":"Başlık","format":"{{msg.payload}}","layout":"col-center","x":823.482666015625,"y":542,"wires":[]},{"id":"3fbc2b19.ab6894","type":"change","z":"37b37ea9.6287b2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.data.data.item.title","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":581.982666015625,"y":603,"wires":[["c613a39b.10347","75da431e.8ee85c"]]},{"id":"b95135e6.b5a078","type":"kodi-in","z":"37b37ea9.6287b2","name":"kodi","controller":"d202ce84.24c45","x":494.982666015625,"y":275,"wires":[["959cce11.c1ad2"]],"outputLabels":["title"]},{"id":"98b0f83d.229a38","type":"debug","z":"37b37ea9.6287b2","name":"baslik-debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":873.982666015625,"y":219,"wires":[]},{"id":"587dc49.c67aa3c","type":"ui_text","z":"37b37ea9.6287b2","group":"2f101410.857cfc","order":15,"width":0,"height":0,"name":"","label":"Yıl","format":"{{msg.payload}}","layout":"col-center","x":885.46533203125,"y":291.32275390625,"wires":[]},{"id":"959cce11.c1ad2","type":"change","z":"37b37ea9.6287b2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.data.data.item.year","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":643.96533203125,"y":352.32275390625,"wires":[["98b0f83d.229a38","587dc49.c67aa3c"]]},{"id":"d202ce84.24c45","type":"kodi-controller","z":"","name":"kodi","host":"localhost","port":"9090"},{"id":"2f101410.857cfc","type":"ui_group","z":"","name":"Kodi Kontrol","tab":"743f23a2.ece61c","order":4,"disp":true,"width":"6","collapse":true},{"id":"743f23a2.ece61c","type":"ui_tab","z":"","name":"R10 Dome","icon":"home","order":2,"disabled":false,"hidden":false}]

and this is the debug message:

13.01.2020 20:29:39node: baslik-debugkodi : msg : Object
object
topic: "kodi"
payload: "Thomas Bergersen - One Million Voices"
_msgid: "ba3635ae.089a08"

I am able to see title and year information if debug output like this. (i.e. image 1)

The same flow, giving this debug when I change the volume:

13.01.2020 20:33:45node: baslik-debugkodi : msg : Object
object
topic: "kodi"
payload: object
notification: "Application.OnVolumeChanged"
data: object
data: object
muted: false
volume: 65
sender: "xbmc"
_msgid: "53955c64.8bad14"

If debug looking like this; I obtain image2. This information is also shown in the dashboard and stays still until I play/pause the song/video.

I hope I could express myself and this post give what you need to solve the problem. Sorry for my bad English. :confused:

Edit: this is live radio broadcast flow:

[{"id":"37b37ea9.6287b2","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"d1d980f6.293ef","type":"function","z":"37b37ea9.6287b2","name":"love ice radio","func":"return {\n    payload: \n        {\n            \"cmd\":\"Player.Open\",\n            \"args\":{\n                \"item\":{\n                    \"file\":\"http://100radio-love.ice.infomaniak.ch/100radio-love-128.mp3\"   \n                }\n                \n            }\n        }\n};","outputs":1,"noerr":0,"x":500,"y":322,"wires":[["b5865d60.c3d8d"]]},{"id":"b5865d60.c3d8d","type":"kodi-out","z":"37b37ea9.6287b2","name":"media-server kodi","controller":"d202ce84.24c45","unit_number":"1","output":"1","kodicommand":"empty","x":744.944450378418,"y":325.999990940094,"wires":[]},{"id":"48d0e259.d54aac","type":"inject","z":"37b37ea9.6287b2","name":"play","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":316.99999237060547,"y":321,"wires":[["d1d980f6.293ef"]]},{"id":"37275f95.ac14c","type":"ui_button","z":"37b37ea9.6287b2","name":"","group":"2f101410.857cfc","order":11,"width":0,"height":0,"passthru":false,"label":"Love Radio","tooltip":"","color":"","bgcolor":"","icon":"fa-broadcast-tower","payload":"","payloadType":"str","topic":"","x":400.4826354980469,"y":369.211669921875,"wires":[["d1d980f6.293ef"]]},{"id":"d202ce84.24c45","type":"kodi-controller","z":"","name":"kodi","host":"localhost","port":"9090"},{"id":"2f101410.857cfc","type":"ui_group","z":"","name":"Kodi Kontrol","tab":"743f23a2.ece61c","order":4,"disp":true,"width":"6","collapse":true},{"id":"743f23a2.ece61c","type":"ui_tab","z":"","name":"R10 Dome","icon":"home","order":2,"disabled":false,"hidden":false}]

If radio plays I can't see any info related to title, but I can see volume-related untidy messages like image2. Here is debug message:

13.01.2020 20:45:37node: kodimsg : string[73]
"send error: Error: Server responded with error: Failed to execute method."

Start here: https://nodered.org/docs/user-guide/messages
It might help for your latest topic too.
Your regular message with now playing has the payload as a type string, the second message is a response from a command, and holds an object with properties on it.
Try putting a switch node (regular, not the dashboard type) in between the output of that kodi node and the dashboard show thing. Then use that switch node to make sure only messages that actually show now playing info appear on the dashboard.

Thank you afelix, I have just seen your message but I solved the problem. I put the flow here if someone needs to use it.

[{"id":"b936ac9f.cd593","type":"tab","label":"Flow 4","disabled":false,"info":""},{"id":"a030c119.aa1af","type":"inject","z":"b936ac9f.cd593","name":"","topic":"","payload":"{\"jsonrpc\": \"2.0\", \"method\": \"Player.GetActivePlayers\", \"id\": 1}","payloadType":"json","repeat":"50","crontab":"","once":false,"onceDelay":0.1,"x":213,"y":263,"wires":[["355fd059.7e031"]]},{"id":"355fd059.7e031","type":"http request","z":"b936ac9f.cd593","name":"","method":"GET","ret":"obj","paytoqs":false,"url":"http://xxx.xxx.xxx.xxx:yyyyy/jsonrpc?request={\"jsonrpc\": \"2.0\", \"method\": \"Player.GetActivePlayers\", \"id\": 1}","tls":"","proxy":"","authType":"","x":491.5,"y":262,"wires":[["59bd0b9a.4ae3b4"]]},{"id":"59bd0b9a.4ae3b4","type":"switch","z":"b936ac9f.cd593","name":"","property":"payload.result[0].playerid","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":579,"y":399,"wires":[["413a6b05.5f9204"],["1c8a6d1f.3eb7e3"]]},{"id":"4c478441.fe8c3c","type":"debug","z":"b936ac9f.cd593","name":"00","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1264.5,"y":381,"wires":[]},{"id":"dfe00194.55294","type":"debug","z":"b936ac9f.cd593","name":"11","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1208.5,"y":471,"wires":[]},{"id":"1c8a6d1f.3eb7e3","type":"http request","z":"b936ac9f.cd593","name":"","method":"GET","ret":"obj","paytoqs":false,"url":"http://xxx.xxx.xxx.xxx:yyyyy/jsonrpc?request={\"jsonrpc\": \"2.0\", \"method\": \"Player.GetItem\", \"params\": { \"properties\": [\"title\", \"album\", \"artist\", \"season\", \"episode\", \"duration\", \"showtitle\", \"tvshowid\", \"thumbnail\", \"file\", \"fanart\", \"streamdetails\"], \"playerid\": 1 }, \"id\": \"VideoGetItem\"}","tls":"","proxy":"","authType":"","x":756,"y":449,"wires":[["8c650728.d88728"]]},{"id":"413a6b05.5f9204","type":"http request","z":"b936ac9f.cd593","name":"","method":"GET","ret":"obj","paytoqs":false,"url":"http://xxx.xxx.xxx.xxx:yyyyy/jsonrpc?request={\"jsonrpc\": \"2.0\", \"method\": \"Player.GetItem\", \"params\": { \"properties\": [\"title\", \"album\", \"artist\", \"season\", \"episode\", \"duration\", \"showtitle\", \"tvshowid\", \"thumbnail\", \"file\", \"fanart\", \"streamdetails\"], \"playerid\": 0 }, \"id\": \"VideoGetItem\"}","tls":"","proxy":"","authType":"","x":792,"y":337,"wires":[["596d160a.611098"]]},{"id":"596d160a.611098","type":"change","z":"b936ac9f.cd593","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.result.item.label","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1002,"y":303,"wires":[["4c478441.fe8c3c","da72321f.1a21"]]},{"id":"8c650728.d88728","type":"change","z":"b936ac9f.cd593","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.result.item.label","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":459,"wires":[["dfe00194.55294","da72321f.1a21"]]},{"id":"da72321f.1a21","type":"ui_text","z":"b936ac9f.cd593","group":"2f101410.857cfc","order":20,"width":0,"height":0,"name":"","label":"Şu an çalınıyor:","format":"{{msg.payload}}","layout":"col-center","x":1254,"y":427,"wires":[]},{"id":"2f101410.857cfc","type":"ui_group","z":"","name":"Kodi Kontrol","tab":"743f23a2.ece61c","order":4,"disp":true,"width":"6","collapse":true},{"id":"743f23a2.ece61c","type":"ui_tab","z":"","name":"R10 Dome","icon":"home","order":2,"disabled":false,"hidden":false}]

xxx.xxx.xxx.xxx should be your Kodi's IP number
yyyyy should be your Kodi's port number.

Best regards! :slight_smile: