Activate two window ID with json-rpc
#1
Hi guys,

I was able to activate custom window ID with jsaon-RPC and addon script.

the addon script:

import xbmc
import xbmcgui
import xbmcplugin
import xbmcaddon
 
xbmc.executebuiltin('ActivateWindow(1199)')

the json-rpc script:
import requests
import xbmc
import xbmcgui
import xbmcplugin
import xbmcaddon

headers = {
    'Content-Type': 'application/json',
}

data = '{"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"addonid":"script.activatewindowid","params":{"windowid":"1199"}},"id":1}'

response = requests.post('http://192.168.1.200:8080/jsonrpc',
headers=headers,
data=data,
auth=('kodi', '1234'))


My question what if I want to be able to choose which window to be activated for example:

I want to create two buttons :

1- button-1 will activate window id 1199
2-button-2 will activate window id 1150

those buttons are in the sender kodi but the window id in the receiver kodi

How can I do that, please

thanks for all
Reply
#2
I can do it if statement :

i = "1199"
 
if i == "1199":
xbmc.executebuiltin('ActivateWindow(1199)')
else:
xbmc.executebuiltin('ActivateWindow(1100)')

but how can I send I variable from kodi sender with json-rpc?

Thanks for all
Reply
#3
Hi Guys

I tried this but I have this error:

DEBUG: JSONRPC: Incoming request: {"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"addonid":"script.activatewindowid","params":{"i":1199}},"id":1}
17:41:51.583 T:140640063035136   DEBUG: JSONRPC: Invalid additional property "i" in type

how can I pass "i" value to addon script?
Reply

Logout Mark Read Team Forum Stats Members Help
Activate two window ID with json-rpc0