You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Kodi volume control using dim commands & JSON-RPC
2
2
3
3
You can use HA Bridge to adjust the Kodi software volume output. This allows you to use dim commands and set the volume level with percentage values.
4
+
4
5
### What is JSON-RPC?
5
6
6
7
The short answer is JSON-RPC an interface to communicate with Kodi. [See the official Kodi Wiki for more info](http://kodi.wiki/view/JSON-RPC_API)
8
+
7
9
### Setup Kodi to allow control through JSON-RPC
8
10
9
11
In Kodi navigate to Settings/Services/Control ([screenshot](http://kodi.wiki/view/Settings/Services/Control))
@@ -21,7 +23,7 @@ Make a note of the **PORT**
21
23
Access the HA Bridge Configuration in your browser and open the **Manual Add** tab.
22
24
#### Name
23
25
24
-
Give the device a unique name that doesn’t include **“volume”** as it will cause conflicts with the Echo’s built in volume controls. A device name of **“cody sound”** works well.
26
+
Give the device a unique name that doesn’t include **“volume”** as it will cause conflicts with the Echo’s built in volume controls. A device name of **“cody sound”** works well.
25
27
#### Device type
26
28
27
29
Select **TCP** in the dropdown
@@ -47,7 +49,7 @@ Before you continue, open your custom URL in a browser (making sure Kodi is runn
Go ahead and test the combined URL/JSON in a browser changing **100** to whatever level you want to set. Kodi should adjust the volume accordingly, try a few different levels to be sure it is working correctly.
68
70
69
-
The browser will reformat the URL each time you press return so don’t build the URL in the browser bar without making a copy first.
71
+
The browser will reformat the URL each time you press return so don’t build the URL in the browser bar without making a copy first.
70
72
71
73
Ideally build the URL in a text document which you can easily edit and then copy/paste each time.
72
-
#### Prepare the three URLs
74
+
75
+
### Prepare the three URLs
73
76
74
77
You want to end up with three full URLs in your text file, one for each of the commands.
You should now be able to control the volume of Kodi using the structured URL you built above in a browser. If you can’t get it to work in a browser then you won’t be able to get it to work in HA Bridge.
97
+
### Test the three URLS
96
98
97
-
In order for HA Bridge to send the JSON request you need to encode the URL. This means we take this:
99
+
You should now be able to control the volume of Kodi using the structured URL you built above in a browser.
Note that we are only encoding the JSON, the URL part we leave as is.
106
+
Add a new manual device and give it a name e.g. “Cody Sound”
110
107
111
-
Using the online tool [www.url-encode-decode.com](http://www.url-encode-decode.com/), copy the JSON part (shown in bold below) and paste it into the left hand field.
Paste the final URL in **On URL** field. Just do the one for now, add the device and in the Bridge Control tab click Save.
130
-
131
-
Test the button in the Bridge Devices tab and hopefully it should turn the volume up in Kodi.
132
-
133
-
Go ahead and repeat the steps for the **Off URL**. All the same steps but change 100% to 0%. If you want to use the previous URL you can, just find the 100% in the encoded URL.
You don’t need to encode the `${intensity.percent}` part. This means you can simply replace the number value (100/0) with `${intensity.percent}` as shown below.
135
+
Save and test the button in the Bridge Devices tab and hopefully it should turn the volume up in Kodi.
0 commit comments