Kodi über Miniserver steuern

Mit diesem How-To möchte ich erklären wie ihr Kodi über den Miniserver steuert.

Dies kann als Mediensteuerung verwendet werden, um bei Anruf Kodi in Pause zu versetzen, ein Addon starten um beispielsweise die Türkamera anzeigen zu lassen und vieles mehr.

Quelle Loxone

Kodi vorbereiten

Zuerst muss der Webserver in Kodi aktiviert werden.

  1. Kodi Einstellungen öffnen

  2. Dienste → Steuerung

  3. "Steuerung über HTTP erlauben" aktivieren

  4. Port einstellen



Miniserver einrichten

Nun muss ein virtueller HTTP-Ausgang erstellt werden:

  1. IP-Adresse und Port angeben; Adresse: http://IP-Adresse-Kodi:Port
    Beispiel:

  2. "Virtueller Ausgang Befehl" erstellen
    Befehl bei Ein: /jsonrpc
    HTTP-Erweiterung bei Ein: Content-Type: application/json
    HTTP-Post Befehl bei Ein: <Befehl aus Tabelle>
    HTTP-Methode bei Ein: POST



Beispiel-Befehle

Funktion

Befehl

Funktion

Befehl

Addon starten

{"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"addonid":"AddonName(Ordnername)"},"id":1}

z.B.: script.securitycam

Meldung an Kodi

{"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"Dein Titel","message":"Deine Meldung","displaytime":Zeit in Millisekunden},"id":1}

Play/Pause

{"jsonrpc": "2.0", "method": "Player.PlayPause", "params": { "playerid": 0 }, "id": 1} 

Play

{"jsonrpc":"2.0","method":"Player.PlayPause","params":{"playerid":0,"play":true},"id":1}

Pause

{"jsonrpc":"2.0","method":"Player.PlayPause","params":{"playerid":0,"play":false},"id":1} 

Stop

{"jsonrpc": "2.0", "method": "Player.Stop", "params": { "playerid": 0 }, "id": 1} 

Next

{"jsonrpc": "2.0", "method": "Player.GoTo", "params": { "playerid": 0, "to": "next" }, "id": 1}

Previous

{"jsonrpc": "2.0", "method": "Player.GoTo", "params": { "playerid": 0, "to": "previous" }, "id": 1} 

Forward 2x

{"jsonrpc":"2.0","method":"Player.SetSpeed","params":{"playerid":0,"speed":2 },"id":1}

Forward 4x

{"jsonrpc":"2.0","method":"Player.SetSpeed","params":{"playerid":0,"speed":4 },"id":1}

Rewind 2x

{"jsonrpc":"2.0","method":"Player.SetSpeed","params":{"playerid":0,"speed":-2 },"id":1}

Rewind 4x

{"jsonrpc":"2.0","method":"Player.SetSpeed","params":{"playerid":0,"speed":-4 },"id":1}

Jump forward

{"jsonrpc": "2.0", "method": "Player.Seek", "params": { "playerid": 0, "value": "smallforward" }, "id": 1}

Jump backward

{"jsonrpc": "2.0", "method": "Player.Seek", "params": { "playerid": 0, "value": "smallbackward" }, "id": 1}

Repeat one

{"jsonrpc": "2.0", "method": "Player.SetRepeat", "params": { "playerid": 0, "repeat": "one" }, "id": 1}

Repeat all

{"jsonrpc": "2.0", "method": "Player.SetRepeat", "params": { "playerid": 0, "repeat": "all" }, "id": 1}

Repeat off

{"jsonrpc": "2.0", "method": "Player.SetRepeat", "params": { "playerid": 0, "repeat": "off" }, "id": 1}

Shuffle on

{"jsonrpc":"2.0","method":"Player.SetShuffle","params":{"playerid":0,"shuffle":true},"id":1}

Shuffle off

{"jsonrpc":"2.0","method":"Player.SetShuffle","params":{"playerid":0,"shuffle":false},"id":1}

Home

{"jsonrpc": "2.0", "method": "Input.Home", "id": 1}

Links

{"jsonrpc": "2.0", "method": "Input.Left", "id": 1} 

Rechts

{"jsonrpc": "2.0", "method": "Input.Right", "id": 1}

Auf

{"jsonrpc": "2.0", "method": "Input.Up", "id": 1}

Ab

{"jsonrpc": "2.0", "method": "Input.Down", "id": 1}

Zurück

{"jsonrpc": "2.0", "method": "Input.Back", "id": 1}

Select

{"jsonrpc": "2.0", "method": "Input.Select", "id": 1}

Lauter

{ "jsonrpc": "2.0", "method": "Application.SetVolume", "params": { "volume": "increment" }, "id": 1 }

Leiser

{ "jsonrpc": "2.0", "method": "Application.SetVolume", "params": { "volume": "decrement" }, "id": 1 }

Lautstarke X

{ "jsonrpc": "2.0", "method": "Application.SetVolume", "params": { "volume": "Wert von 0-100" }, "id": 1 }

Get Playlist

{"jsonrpc": "2.0", "method": "Playlist.GetItems", "params": { "properties": ["title", "album", "artist", "duration"], "playlistid": 0 }, "id": 1} 

Get Albums

{"jsonrpc":"2.0","method":"AudioLibrary.GetAlbums","params":{"properties":["playcount","artist","genre"],"limits":{"end":10,"start":0},"sort":{"order":"ascending","method":"album","ignorearticle":true}},"id":"libAlbums"}

Codec Info

{"jsonrpc": "2.0", "method": "Input.ShowCodec", "id": 1}

Context Menu

{"jsonrpc": "2.0", "method": "Input.ContextMenu", "id": 1}

Info

{"jsonrpc": "2.0", "method": "Input.info", "id": 1}

Show OSD

{"jsonrpc": "2.0", "method": "Input.showOSD", "id": 1}

Navigate Songs

{"jsonrpc":"2.0","method":"GUI.ActivateWindow","params":{"window":"music","parameters":["musicdb://4/"]},"id":1}

Reboot

{"jsonrpc":"2.0","method":"System.Reboot","id":1}

Shutdown

{"jsonrpc":"2.0","method":"System.Shutdown","id":1}



Navigate Albums

{ "jsonrpc": "2.0", "method": "GUI.ActivateWindow", "params": { "window": "music", "parameters": [ "musicdb://3/" ] }, "id": 1 }

TV Sender starten *1

{"jsonrpc":"2.0","id":1,"method":"Player.Open","params":{"item":{"channelid":CHANNEL-ID}}

Navigiere zu Filme

{"jsonrpc":"2.0","method":"GUI.ActivateWindow","id":1,"params":{"window":"videos","parameters":["MovieTitles"]}}

Navigiere zu Serien

{"jsonrpc":"2.0","method":"GUI.ActivateWindow","id":1,"params":{"window":"videos","parameters":["TvShowTitles"]}}

Navigiere zu Einstellungen

{"jsonrpc":"2.0","method":"GUI.ActivateWindow","id":1,"params":{"window":"settings"}}

GUI Navigation *2

{"jsonrpc":"2.0","method":"GUI.ActivateWindow","id":1,"params":{"window":"Seitenname"}}

JSON-RPC API - Kodi Wiki

(Nicht alle Befehle wurden von mir getestet)





Mit folgenden Befehl können die "Channel-IDs" ausgelesen werden (im Browser öffnen):
http://<deine-kodi-ip>:8080/jsonrpc?request={"jsonrpc":"2.0","method": "PVR.GetChannels","params": {"channelgroupid": "alltv"},"id": 1}



Weitere GUI Navigationen
{"jsonrpc":"2.0","method":"GUI.ActivateWindow","id":1,"params":{"window":"<<<<Seitenname>>>>"}}
Seitennamen:
 "home", "programs", "pictures", "filemanager", "settings", "music", "videos", "tvchannels", "tvrecordings", "tvguide", "tvtimers", "tvsearch", "radiochannels", "radiorecordings", "radioguide", "radiotimers", "radiosearch", "gamecontrollers", "pvrguideinfo", "pvrrecordinginfo", "pvrradiordsinfo", "pvrtimersetting", "pvrgroupmanager", "pvrchannelmanager", "pvrguidesearch", "pvrchannelscan", "pvrupdateprogress", "pvrosdchannels", "pvrosdguide", "pvrosdteletext", "systeminfo", "testpattern", "screencalibration", "systemsettings", "servicesettings", "pvrsettings", "playersettings", "mediasettings", "interfacesettings", "appearancesettings", "videoplaylist", "loginscreen", "profiles", "skinsettings", "addonbrowser", "yesnodialog", "progressdialog", "virtualkeyboard", "volumebar", "submenu", "favourites", "contextmenu", "notification", "numericinput", "gamepadinput", "shutdownmenu", "playercontrols", "playerprocessinfo", "seekbar", "musicosd", "addonsettings", "visualisationpresetlist", "osdcmssettings", "osdvideosettings", "osdaudiosettings", "audiodspmanager", "osdaudiodspsettings", "videobookmarks", "filebrowser", "networksetup", "mediasource", "profilesettings", "locksettings", "contentsettings", "songinformation", "smartplaylisteditor", "smartplaylistrule", "busydialog", "pictureinfo", "accesspoints", "fullscreeninfo", "sliderdialog", "addoninformation", "subtitlesearch", "musicplaylist", "musicplaylisteditor", "teletext", "selectdialog", "musicinformation", "okdialog", "movieinformation", "textviewer", "fullscreenvideo", "fullscreenlivetv", "fullscreenradio", "visualisation", "slideshow", "weather", "screensaver", "videoosd", "videomenu", "videotimeseek", "startwindow", "startup", "peripheralsettings", "extendedprogressdialog", "mediafilter", "addon", "eventlog", "tvtimerrules", "radiotimerrules"



Quelle





Vorlagen

Anleitung

Vorlagen folgen...





Kamerabild in Kodi anzeigen

Wer Kodi zum fernsehen verwendet, dem könnte das Addon „Security Cam Overlay Addon“ gefallen. Der Stream muss allerdings Einzelbilder zur Verfügung stellen.
Das Addon blendet ein Bild rechts unten ein, egal ob ein Film läuft oder man sich nur im Hauptmenü befindet.
Dies bietet z.B. DoorPi mit MJPG-Streamer: http://doorpi:9000/?action=snapshot

  1. In Kodi das Addon per zip installieren - Security Cam Overlay Addon

  2. Addon in Kodi einrichten
    - Image Url - z.B. http://doorpi:9000/?action=snapshot
    - Username/Password für die oben verwendete URL angeben

  3. HTTP Befehl vom Miniserver auslösen (wie in "Miniserver einrichten" bereits beschrieben):
    Virtueller Ausgang mit Kodi-IP und Port vom Webinterface (z.b. http://osmc:8080)
    Befehl Ein: /jsonrpc
    HTTP-Erweiterung bei EIN: Content-Type: application/json
    HTTP-Post-Befehl bei EIN: {"jsonrpc":"2.0","method":"Addons.ExecuteAddon","p arams":{"addonid":"script.securitycam"},"id":1}
    HTTP-Methode bei EIN: POST





    Alternative "remastered Version" gibt es hier:
    Remastered Version
    Diese kann wohl mit rtsp Streams umgehen und bis zu 4 Kameras anzeigen, ist jedoch von mir ungetestet.



Dies ist ein Wiki, die Seite darf gerne ergänzt oder bei Fehlern ausgebessert werden.

Verwandte Artikel

Aus XMBC / Kodi den Miniserver steuern