Kodi Notifications to external windows app
#1
I am creating a small app to control Kodi. I am using VB6.
I have found on the internet that i can receive notifications
by using TCP from my app.
I am using the winsock control to connect and listen to port 9090
(if this is correct port) but i dont seems to get any data being returned.

What exactly do i need to do to receive notifications.

Any help will be appreciated.

Garry
Reply
#2
Haven't used it myself, but I think you need JSON notifications.

http://kodi.wiki/view/JSON-RPC_API/v6#Notifications_2
Add-on : Bluray iso utils Rewrite of BR_iso_enhancements
Add-on : BR_iso_Enhancements Give theatrical & directors cut from the same bluray iso each their own library entry, use bluray iso's of tv shows as if they are already ripped.
Reply
#3
(2016-11-02, 10:29)Wimpie Wrote: Haven't used it myself, but I think you need JSON notifications.

http://kodi.wiki/view/JSON-RPC_API/v6#Notifications_2

They can be captured with Monitor.onNotification but I don't thinks they are sent anywhere by default.

As for the OP question, it's not clear what data should be sent where. You can pull some info from Kodi via JSON-RPC, but if you need to receive some messages from Kodi to your app, I think you have to create your own addon that will send those messages.
Reply
#4
hi. thanks for replies.

I currently am able to use jsonrpc to control certain functions. (VB6 with inet control)
I can start a Library scan from my windows application , but wanted to know
if i can see when the scan is finished. i can already check for IsLibraryScanning
when i click a button to check. (dont really want to set up timer and poll)
But thought it was possible for Kodi to push Notifications through TCP IP / Port

And then my exe could listen and respond to that.

Thanks
Reply
#5
Just to advise. I have now figured out how to receive notifications in VB6 from kodi.
if anyone else is interested, reply to post.
Reply
#6
I'm interested...
Add-on : Bluray iso utils Rewrite of BR_iso_enhancements
Add-on : BR_iso_Enhancements Give theatrical & directors cut from the same bluray iso each their own library entry, use bluray iso's of tv shows as if they are already ripped.
Reply
#7
at work at present so will update when i get home today.

(2016-11-03, 11:03)Wimpie Wrote: I'm interested...
Reply
#8
(2016-11-03, 11:03)Wimpie Wrote: I'm interested...

1st open a new VB6 project and add a form. then add a Winsock component to the form.
then add 2 textboxes txtSend and txtOutput
Code:
Private Sub Form_Load()
    ' The name of the Winsock control is tcpClient.
    ' Note: to specify a remote host, you can use
    ' either the IP address (ex: "121.111.1.1") or
    ' the computer's "friendly" name
    tcpClient.RemoteHost = "192.168.xxx.xxx"
    tcpClient.RemotePort = 9090
     tcpClient.Connect
End Sub

Private Sub Form_Unload(Cancel As Integer)
tcpClient.Close
tcpClient.LocalPort = 0
tcpClient.RemotePort = 0
End Sub

Private Sub tcpClient_DataArrival _
(ByVal bytesTotal As Long)
    Dim strData As String
    tcpClient.GetData strData
    txtOutput.Text = strData
End Sub

Private Sub txtSend_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
   tcpClient.SendData txtSend.Text
   KeyAscii = 0
   End If
End Sub

Now enter the jsonrpc commands into the send textbox and press enter

ie
(xxx.xxx = ip number)

http://192.168.xxx.xxx/jsonrpc?request={"jsonrpc":"2.0","id":1,"method":"JSONRPC.Ping"}

you should get a responce back. like {"id":1,"jsonrpc":"2.0","result":"pong"}

if you issue this
http://192.168.xxx.xxx/jsonrpc?request={"jsonrpc":"2.0","method":"VideoLibrary.Scan"}

the txtOutput show show.
{"jsonrpc":"2.0","method":"VideoLibrary.OnScanStarted","params":{"data":null,"sender":"xbmc"}}

when the scan finishes then it will display

{"jsonrpc":"2.0","method":"VideoLibrary.OnScanFinished","params":{"data":null,"sender":"xbmc"}}

i hope this helps you out
Reply
#9
Thanks!!
Add-on : Bluray iso utils Rewrite of BR_iso_enhancements
Add-on : BR_iso_Enhancements Give theatrical & directors cut from the same bluray iso each their own library entry, use bluray iso's of tv shows as if they are already ripped.
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi Notifications to external windows app0