Here is some code to control one or more Kodi (was XBMC) media players. The code runs on a Color CTouch as it uses HTTP requests to talk to the JSON RPC interface on Kodi (which you'll need to enable in Kodi settings) The code is actually pretty simple, but I found the learning curve quite steep (mainly because of clunkiness & case sensivity in the Kodi interface), so maybe it is a leg up for others. To use the code just set the Group Address "AV Action" to the values in the case statement ... uncomment the LogMessages to see what's being sent over the interface ... For what it's worth ... I've rebuilt my entire home around RaspberryPi 2, running Kodi 15, with CEC and IR controlled amps/TVs ... so I mostly use this code to shut everything off and play/pause Kodi's party mode. However in my pool, I use this as the primary interface to fire up the system, control the interface etc, so you can control the AV for the whole room from a touch screen if you wish. The Kodi control apps on phones & smart watches make the whole system work pretty well ... simple control from a DLT (basically play/pause) and full control from your smart device ... Before using the code, in the constant section do something like [CODE]AVRoomIPAddress = '192.168.0.';[/CODE] to set the base address of your network. A couple of lines into the code there are two ways to set the last byte of the IP address ... either directly, or from a group (so you can control different Kodi instances this way). And put these in your global variables section [CODE]TempInt, TempInt2: integer; TempString, TempString2: array[0..256] of char;[/CODE] The strings have to be defined this way or they'll overrun the default size in the logic engine. Then stick this lot in a Module ... [CODE]TempInt := GetLightingLevel("AV Action"); if TempInt > 0 then begin //TempInt2 := GetLightingLevel("AV Select Room"); TempInt2 := 215; // Pool Media Player IP Address case TempInt of 1 : TempString := 'back'; 2 : TempString := 'up'; 3 : TempString := 'left'; 4 : TempString := 'select'; 5 : TempString := 'right'; 6 : TempString := 'down'; 7 : TempString := 'contextmenu'; 8 : TempString := 'home'; 10 : TempString := 'skipprevious'; 11 : TempString := 'skipnext'; 12 : TempString := 'rewind'; 13 : TempString := 'fastforward'; 14 : TempString := 'play'; 15 : TempString := 'pause'; 16 : TempString := 'stop'; 17 : TempString := 'record'; 20 : TempString := 'volumedown'; 21 : TempString := 'volumeup'; 22 : TempString := 'mute'; end ; //LogMessage('AV action is ',TempString); if (TempInt < 10) then // ditect Input command for these format(TempString2,'http://',AVRoomIPAddress,TempInt2:1, '/jsonrpc?request={"jsonrpc":"2.0",', '"method":"Input.',TempString, '","id":1}') else if (TempInt < 100) then // ExecuteAction for these format(TempString2,'http://',AVRoomIPAddress,TempInt2:1, '/jsonrpc?request={"jsonrpc":"2.0",', '"method":"Input.ExecuteAction",', '"params":{"action":"',TempString, '"},"id":1}') else // start party mode format(TempString2,'http://',AVRoomIPAddress,TempInt2:1, '/jsonrpc?request={"jsonrpc":"2.0",', '"method":"Player.Open",', '"params":{"item":{"partymode":"music"}},', '"id":1}'); //LogMessage('Sending ',TempString2); GetHTTPData(TempString2); SetLightingLevel("AV Action",0,0); delay(0.2); ReadHTTPData(TempString2); //LogMessage('Returned ',TempString2); end; [/CODE]