This causes error:
2018-07-27 09:13:25 ERROR (MainThread) [homeassistant.components.media_player.kodi] Run API method media_player.kodi.Player.Open({‘data’: OrderedDict([(‘item’, None), (‘data’, ‘file:special://profile/playlists/video/cam1.m3u’)]), ‘entity’: ‘media_player.kodi’}) error: {‘code’: -32602, ‘data’: {‘method’: ‘Player.Open’, ‘message’: ‘Too many parameters’}, ‘message’: ‘Invalid params.’}
Tested this on the commandline and worked.
curl -s --header "Content-Type: application/json" --data-binary '{"jsonrpc":"2.0","id":"1","method":"Player.Open","params":{"item":{"file":"special://profile/playlists/video/cam1.m3u"} }}, "id": 1}' http://192.168.1.50:8080/jsonrpc
I did not test her (oh hi mark), but shell_command should work with extra quotes arround the curl command (EDIT: and escaping the quotes…)
shell_command:
cam1_on_kodi: "curl -s --header \"Content-Type: application/json\" --data-binary '{\"jsonrpc\":\"2.0\",\"id\":\"1\",\"method\":\"Player.Open\",\"params\":{\"item\":{\"file\":\"special://profile/playlists/video/cam1.m3u\"} }}, \"id\": 1}' http://192.168.1.50:8080/jsonrpc"
Sorry what extra quotes you mean?
Now it shows error:
2018-07-28 18:22:32 ERROR (Thread-2) [homeassistant.util.yaml] while parsing a block mapping
in “/home/homeassistant/.homeassistant/configuration.yaml”, line 29, column 3
expected , but found ‘’
in “/home/homeassistant/.homeassistant/configuration.yaml”, line 29, column 36
2018-07-28 18:22:32 ERROR (MainThread) [homeassistant.bootstrap] Error loading /home/homeassistant/.homeassistant/configuration.yaml: while parsing a block mapping
in “/home/homeassistant/.homeassistant/configuration.yaml”, line 29, column 3
expected , but found ‘’
in “/home/homeassistant/.homeassistant/configuration.yaml”, line 29, column 36
Forgot to escape the quotes…
shell_command:
cam1_on_kodi: "curl -s --header \"Content-Type: application/json\" --data-binary '{\"jsonrpc\":\"2.0\",\"id\":\"1\",\"method\":\"Player.Open\",\"params\":{\"item\":{\"file\":\"special://profile/playlists/video/cam1.m3u\"} }}, \"id\": 1}' http://192.168.1.50:8080/jsonrpc"
This is amazing! Anyone know how to make the TV turn off after X seconds ?
is this code still working for the newest kodi version?