Parse Param to Script
#1
Hi

is it possible to parse params to a script addon.

I can start my addon with json

http://192.168.2.190:8080/jsonrpc?request={"jsonrpc": "2.0","method":"Addons.ExecuteAddon","params":{"addonid":"script.audio.radiotuner"},"id": 0}

and can send input with

http://192.168.2.190:8080/jsonrpc?request={"jsonrpc": "2.0","method":"Input.Back","params": {},"id": 0}

for example to stop my addon

but i want to control my addon: activate special buttons etc.

best regards Martin
Reply
#2
You can send navigation commands via JSON-RPC, but it's not reliable. Basically it would be like controlling your Kodi with TV/display off.

Another variant is to create your own remote-control service that would allow to remotely execute commands/actions specific to your addon. I mean not interaction with your addon UI controls but execution functions/methods behind them.
Reply
#3
i'm not familiar with the Addons.ExecuteAddon json method, but looking at the introspect it does seem you can pass additional args to the call

Code:
"Addons.ExecuteAddon": {
            "description": "Executes the given addon with the given parameters (if possible)",
            "params": [
                {
                    "name": "addonid",
                    "required": true,
                    "type": "string"
                },
                {
                    "default": "",
                    "name": "params",
                    "type": [
                        {
                            "additionalProperties": {
                                "default": "",
                                "type": "string"
                            },
                            "type": "object"
                        },
                        {
                            "items": {
                                "type": "string"
                            },
                            "type": "array"
                        },
                        {
                            "description": "URL path (must start with / or ?",
                            "type": "string"
                        }
                    ]
                },
                {
                    "default": false,
                    "name": "wait",
                    "type": "boolean"
                }
            ],
            "returns": {
                "type": "string"
            },
            "type": "method"
        }
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#4
thank you,

with

http://192.168.2.190:8080/jsonrpc?request={"jsonrpc": "2.0","method":"Addons.ExecuteAddon","params":{"addonid":"script.audio.radiotuner","params":{"additionalProperties":"Hello"}},"id": 0}

i can send a param to argv

str(sys.argv[1])
Reply

Logout Mark Read Team Forum Stats Members Help
Parse Param to Script0