ich bin gerade etwas am verzweifeln...
Ich möchte die JSON-API des MediaCenters KODI ansprechen und eine einfache Benachrichtigung auf dem Bildschirm anzeigen (-> Post war da z.B.).
Dafür habe ich mir aus ein paar Examples ein auf der Shell der CCU2 funktionierendes Script zurechtgeschnitten:
Code: Alles auswählen
LD_LIBRARY_PATH=/usr/local/addons/cuxd /usr/local/addons/cuxd/curl -X POST -H "Content-Type: application/json" -d "{\"jsonrpc\":\"2.0\",\"method\":\"GUI.ShowNotification\",\"params\":{\"title\":\"add you title here\",\"message\":\"add your message here\"},\"id\":1}" http://kodi:kodi@192.168.x.101:8080/jsonrpc
Aufruf aus dem Homematic-Script:
Code: Alles auswählen
dom.GetObject('CUxD.CUX2801001:1.CMD_EXEC').State('LD_LIBRARY_PATH=/usr/local/addons/cuxd /usr/local/addons/cuxd/curl -X POST -H "Content-Type: application/json" -d "{\"jsonrpc\":\"2.0\",\"method\":\"GUI.ShowNotification\",\"params\":{\"title\":\"add you title here\",\"message\":\"add your message here\"},\"id\":1}" http://kodi:kodi@192.168.x.101:8080/jsonrpc');
Die Krux: Anscheinend frisst jetzt die CCU2 den Befehlsaufruf von Curl durch die ' nicht, ich bekomme folgenden Fehler im Editor:
Code: Alles auswählen
Error 1 at row 1 col 394 near ^/local/addons/cuxd /usr/local/addons/cuxd/curl -X POST -H "Content-Type: applica
Parse following code failed:
dom.GetObject('CUxD.CUX2801001:1.CMD_EXEC').State('LD_LIBRARY_PATH=/usr/local/addons/cuxd /usr/local/addons/cuxd/curl -X POST -H "Content-Type: application/json" -d "{\"jsonrpc\":\"2.0\",\"method\":\"GUI.ShowNotification\",\"params\":{\"title\":\"add you title here\",\"message\":\"add your message here\"},\"id\":1}" http://kodi:kodi@192.168.x.101:8080/jsonrpc');