mitchell
(Mitchell Stringer)
April 4, 2019, 8:32am
1
i am trying to send the below to kodi via home assistant
{
"method": "VideoLibrary.Export",
"params": {
"options": {
"overwrite": true,
"actorthumbs": false,
"images": false
}
},
"id": 1,
"entity_id": "media_player.kodi"
}
it sends but doesn’t work and i get this in the debug console
Run API method media_player.kodi.VideoLibrary.Export({‘params’: {‘options’: {‘overwrite’: True, ‘actorthumbs’: False, ‘images’: False}}, ‘id’: 1}) error: {‘code’: -32602, ‘data’: {‘message’: ‘Too many parameters’, ‘method’: ‘VideoLibrary.Export’}, ‘message’: ‘Invalid params.’}
i guessing the formatting is off?
I can do other things like launch add-ons. But this always falls over
tom_l
April 4, 2019, 9:15am
2
Expanding the schema here: https://kodi.wiki/view/JSON-RPC_API/v9#VideoLibrary.Export
It seems you also need to specify a path to export the library to.
mitchell
(Mitchell Stringer)
April 4, 2019, 9:29am
3
There’s are two options, one is “Single file” which requires a file path, the other is “seperate files” which puts the files next to the media files, so a path name isn’t required for that, which is the one i am trying to use
https://kodi.wiki/view/Import-export_library
Edit:
The original JSON is here, but I can’t get it working in HA
curl -X POST -H 'content-type: application/json;' --data '{ "jsonrpc": "2.0", "method": "VideoLibrary.Export", "params": { "options": { "overwrite": true, "actorthumbs": false, "images": false} }, "id": 1 }' http://10.0.1.16:8083/jsonrpc
subzero79
(Subzero79)
November 11, 2019, 4:43am
4
I explained this here
opened 09:38PM - 24 Jul 19 UTC
closed 11:32AM - 15 Feb 20 UTC
integration: kodi
stale
<!-- READ THIS FIRST:
- If you need additional help with this template please r… efer to https://www.home-assistant.io/help/reporting_issues/
- Make sure you are running the latest version of Home Assistant before reporting an issue: https://github.com/home-assistant/home-assistant/releases
- Frontend issues should be submitted to the home-assistant-polymer repository: https://github.com/home-assistant/home-assistant-polymer/issues
- iOS issues should be submitted to the home-assistant-iOS repository: https://github.com/home-assistant/home-assistant-iOS/issues
- Do not report issues for integrations if you are using a custom integration: files in <config-dir>/custom_components
- This is for bugs only. Feature and enhancement requests should go in our community forum: https://community.home-assistant.io/c/feature-requests
- Provide as many details as possible. Paste logs, configuration sample and code into the backticks. Do not delete any text from this template!
-->
**Home Assistant release with the issue:** 0.94.3
<!--
- Frontend -> Developer tools -> Info
- Or use this command: hass --version
-->
**Last working Home Assistant release (if known):** 0.94.3
**Operating environment (Hass.io/Docker/Windows/etc.):** Kubernetes (Ubuntu 18.04)
<!--
Please provide details about your environment.
-->
**Component/platform:** Kodi Media Player
<!--
Please add the link to the documentation at https://www.home-assistant.io/components/ of the component/platform in question.
-->
**Description of problem:**
I'm trying to configure Home Assistant to use the Kodi CEC plugin to turn my TV on and off. Unfortunately this is not working. I believe this may be due to a change in the Kodi API from Kodi Leia whereby HTTP GET requests to the JSON RPC are no longer accepted and instead return a "Bad client permission" error.
See https://forum.kodi.tv/showthread.php?tid=324598
Testing via Postman shows that using a post request instead and putting the payload in the request body works fine.
Data retrieval functions seem to be working as Home Assistant will correctly show playing media.
**Problem-relevant `configuration.yaml` entries and (fill out even if it seems unimportant):**
```yaml
platform: kodi
name: Quorra
host: quorra
port: 80
username: kodi
password: !secret kodi_quorra_kodi_password
enable_websocket: false
turn_on_action:
service: media_player.kodi_call_method
data:
entity_id: media_player.quorra
method: Addons.ExecuteAddon
addonid: script.json-cec
params:
command: activate
turn_off_action:
- service: media_player.media_stop
data:
entity_id: media_player.quorra
- service: media_player.kodi_call_method
data:
entity_id: media_player.quorra
method: Addons.ExecuteAddon
addonid: script.json-cec
params:
command: standby
```
**Traceback (if applicable):**
```
Not sure how to retrieve this.
```
**Additional information:**
```json
{
"description": "JSON-RPC API of XBMC",
"id": "http://xbmc.org/jsonrpc/ServiceDescription.json",
...,
"version": "10.3.0"
}
```
Took me ages to figure it out why it was failing
I think is the wrong issue thread, but the problem exists. I copied the kodi component to custom components folders and added the modify statement.