You can try this flow I made. Uses a http request to send a JSON command. You need to setup ip and username and password. You can change the type of request to anything listed here:
https://kodi.wiki/view/JSON-RPC_API/v9
I used “Player.GetActivePlayers”
[{"id":"7cbcf40a.ef84ec","type":"inject","z":"54477b72.9b0d74","name":"play","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":2140,"wires":[["ffe1468e.8481d8"]]},{"id":"ffe1468e.8481d8","type":"www-request","z":"54477b72.9b0d74","name":"","method":"GET","ret":"obj","url":"http://192.168.1.97:8080/jsonrpc?request={%22jsonrpc%22:%20%222.0%22,%20%22id%22:%201,%20%22method%22:%20%22Player.GetActivePlayers%22}","follow-redirects":false,"persistent-http":false,"tls":"","x":330,"y":2140,"wires":[["ea0dc6ed.05a5f8"]]},{"id":"ea0dc6ed.05a5f8","type":"debug","z":"54477b72.9b0d74","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":570,"y":2140,"wires":[]}]
