Kodi Community Forum
v18 Volume slider for Node-red Dashboard - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+---- Forum: JSON-RPC (https://forum.kodi.tv/forumdisplay.php?fid=174)
+---- Thread: v18 Volume slider for Node-red Dashboard (/showthread.php?tid=350881)



Volume slider for Node-red Dashboard - konrul - 2020-01-11

Hello, 

I am very new here and I have just registered to solve my problem. I want to use Node-RED in order to control Kodi. I am able to control play-pause with this code: {"jsonrpc": "2.0", "method": "Player.PlayPause", "params": { "playerid": 1 }, "id": 1}

I am doing well with this code: { "jsonrpc": "2.0", "method": "Application.SetVolume", "params": { "volume": "increment" }, "id": 1 } However, obviously, it is always increasing even my slider decreasing.

I want to use a slider to increase or decrease volume, but I couldn't find any solution, and I stuck! Can anyone help me?


RE: Volume slider for Node-red Dashboard - black_eagle - 2020-01-11

If you can get the position of the slider then you can use that as the value for the volume.

{ "jsonrpc": "2.0", "method": "Application.SetVolume", "params": { "volume": '$VALUE' }, "id": 1 }


RE: Volume slider for Node-red Dashboard - konrul - 2020-01-11

Hello black_eagle,

Thanks for your quick reply but I don't know what should I put for "$VALUE" I know it should be slider value but I could not be successful to put the slider value in this part of the code. Is there any slider controlled example for kodi / Node-Red?


RE: Volume slider for Node-red Dashboard - mpg732 - 2020-02-01

The value for the slider will be 0 to 100.  if you enter 50, it will take you to the halfway mark.  I haven't played around with Node-Red but most of those types of software will allow you to set a range for a slider.  So you would set it 0 to 100.  Then as you move the slider it will give you a variable that you can enter into the code you where given above.