Hi Guys,
I am using a program called HSTouch ( Homeseer ) to send command to Window XBMC Frodo but seem to be struggling with nextaudio
Is nextaudio available in the latest Frodo json-rpc? Came across a
list which would suggest it is but in the script I am using is giving me an error
Being a compleat no hoper where scripts are concerned any help would be great thanks
this is the command I am sending
Code:
JsonStr="{""jsonrpc"":""2.0"",""method"":""Input.ExecuteAction"",""params"":{""action"":""audionextlanguage""},""id"":1}"
here is the error
Code:
01/04/2013 15:42:24 - XBMC - {"error":{"code":-32601,"message":"Method not found."},"id":1,"jsonrpc":"2.0"}
Here is the full script that was created by jon00 a guy over at the
homeseer forum all the command are working other than the nextaudio
Code:
Sub Main(ByVal ComStr As String)
Dim IP As String = "192.168.0.19"
Dim port As String = "8080"
Dim PlayerID As String = "1"
Dim URLStr As String = "http://" & IP & ":" & port & "/jsonrpc?request="
Dim ReplyStr As String = ""
Dim JsonStr As String = ""
Select Case ComStr.ToLower
Case "nextaudio"
JsonStr="{""jsonrpc"":""2.0"",""method"":""Input.ExecuteAction"",""params"":{""action"":""audionextlanguage""},""id"":1}"
Case "rewind"
JsonStr="{""jsonrpc"":""2.0"",""id"":1,""method"":""Player.SetSpeed"",""params"":{""playerid"":1,""speed"":""decrement""}}"
Case "fastforward"
JsonStr="{""jsonrpc"":""2.0"",""id"":1,""method"":""Player.SetSpeed"",""params"":{""playerid"":1,""speed"":""increment""}}"
Case "updatevideo"
JsonStr="{""jsonrpc"":""2.0"",""method"":""VideoLibrary.Scan"",""id"":1}"
Case "quit"
JsonStr="{""jsonrpc"":""2.0"",""method"":""Application.Quit"",""id"":1}"
Case "stop"
JsonStr="{""jsonrpc"":""2.0"",""method"":""Player.Stop"",""params"":{""playerid"":" & PlayerID & "},""id"":1}"
Case "playpause"
JsonStr="{""jsonrpc"":""2.0"",""method"":""Player.PlayPause"",""params"":{""playerid"":" & PlayerID & "},""id"":1}"
Case "down"
JsonStr="{""jsonrpc"":""2.0"",""method"":""Input.Down"",""id"":1}"
Case "up"
JsonStr="{""jsonrpc"":""2.0"",""method"":""Input.Up"",""id"":1}"
Case "home"
JsonStr="{""jsonrpc"":""2.0"",""method"":""Input.Home"",""id"":1}"
Case "left"
JsonStr="{""jsonrpc"":""2.0"",""method"":""Input.Left"",""id"":1}"
Case "right"
JsonStr="{""jsonrpc"":""2.0"",""method"":""Input.Right"",""id"":1}"
Case "select"
JsonStr="{""jsonrpc"":""2.0"",""method"":""Input.Select"",""id"":1}"
Case "info"
JsonStr="{""jsonrpc"":""2.0"",""method"":""Input.Info"",""id"":1}"
Case "contextmenu"
JsonStr="{""jsonrpc"":""2.0"",""method"":""Input.ContextMenu"",""id"":1}"
Case "30secforward"
JsonStr="{""jsonrpc"":""2.0"",""id"":1,""method"":""Player.Seek"",""params"":{""playerid"":" & PlayerID & ",""value"":""smallforward""}}"
Case "30secback"
JsonStr="{""jsonrpc"":""2.0"",""id"":1,""method"":""Player.Seek"",""params"":{""playerid"":" & PlayerID & ",""value"":""smallbackward""}}"
Case "back"
JsonStr="{""jsonrpc"":""2.0"",""method"":""Input.Back"",""id"":1}"
Case "subtitlenext"
JsonStr="{""jsonrpc"":""2.0"",""id"":1,""method"":""Player.SetSubtitle"",""params"":{""playerid"":" & PlayerID & ",""subtitle"":""next""}"
Case "subtitleoff"
JsonStr="{""jsonrpc"":""2.0"",""id"":1,""method"":""Player.SetSubtitle"",""params"":{""playerid"":" & PlayerID & ",""subtitle"":""off""}}"
Case "subtitleon"
JsonStr="{""jsonrpc"":""2.0"",""id"":1,""method"":""Player.SetSubtitle"",""params"":{""playerid"":" & PlayerID & ",""subtitle"":""off""}}"
Case "showosd"
JsonStr="{""jsonrpc"":""2.0"",""method"":""Input.ShowOSD"",""id"":1}"
Case "setfullscreen"
JsonStr="{""jsonrpc"": ""2.0"", ""method"": ""GUI.SetFullscreen"", ""params"": { ""fullscreen"": ""toggle"" }, ""id"": ""1""}"
Case "movieslist"
JsonStr="{ ""jsonrpc"": ""2.0"", ""method"": ""GUI.ActivateWindow"", ""params"": { ""window"": ""video"", ""parameters"": [ ""MovieTitles"" ] }, ""id"": 1 }"
Case "tvlist"
JsonStr="{""jsonrpc"": ""2.0"", ""method"": ""GUI.ActivateWindow"", ""params"": { ""window"": ""video"", ""parameters"": [ ""TvShowTitles"" ] }, ""id"": 1 }"
Case else
hs.writelog("XBMC", "Command not recognised")
exit sub
End select
If hs.ping(IP) = 0 Then
URLStr = URLStr & JsonStr
ReplyStr = hs.urlaction(URLStr,"GET","","")
If ReplyStr <> "" Then hs.writelog("XBMC", ReplyStr)
Else
hs.writelog("XBMC", "Cannot Send Command - Host Offline")
End If
End Sub