Update: github repo changed.

This is a SmartApp which allows you to control Kodi, where HTTP control has been enabled.

Controlling Kodi through SmartThings has the additional benefit that you are also be to trigger events in SmartThings based on events in Kodi, or visa versa. Such as ‘Someone is at the door, pause playback’, or ‘Kodi is playing, dim the living room lights’.

Install the ‘Kodi Manager’ SmartApp from your mobile device, specify your Kodi IP and Kodi login details.

This will then create a device for that kodi device.

In order to accomplish this the app exposes URL endpoints including a security token for each event type and provides them to the user in a easy to copy/paste format (no more messing with REST endpoint examples and php files). Those endpoints need to be called by Kodi when the events occur. For this we use the xbmc.callbacks2 plugin

You will need to install http://kodi.wiki/view/Add-on:Kodi_Callbacks into Kodi

https://github.com/KenV99/script.service.kodi.callbacks

Updates

No longer polls kodi directly. receives updated from a kodi plugin

Known Issues

Instructions

Add the Kodi device type to SmartThings

For UK go to: https://graph-eu01-euwest1.api.smartthings.com35 For US go to: https://graph.api.smartthings.com17 Click ‘My Device Handlers’ Click ‘New Device Handler’ in the top right Click the ‘From Code’ tab Paste in the code from: https://github.com/Toliver182/SmartThings-KodiControl-Callback/blob/master/devicetypes/toliver182/kodi-client.src/kodi-client.groovy Click ‘Create’ Click ‘Publish -> For Me’

Add the ‘Kodi Manager’ SmartApp to SmartThings

For UK go to: https://graph-eu01-euwest1.api.smartthings.com35 For US go to: https://graph.api.smartthings.com17 Click ‘My SmartApps’ Click the ‘From Code’ tab Paste in the code from: https://github.com/Toliver182/SmartThings-KodiControl-Callback/blob/master/smartapps/toliver182/kodi-manager-callbacks.src/kodi-manager-callbacks.groovy Click ‘Create’

Install the Kodi Manager SmartApp

Goto your mobile device and open SmartThings Got the Marketplace tab at the bottom Tap SmartApps’ Scroll to the bottom and tap My Apps’ Tap ‘Kodi Manager’ Fill in the details that have been requested and click ‘Done’ Go back to ‘Things’ and you will see your Kodi device there Go to app settings and enable OAuth Click ‘Publish -> For Me’ Install the device Select desired switches to control along with desired light levels for each event type (value of 101 will restore to last known level) Optionally name this instance of the app,assign icon, and modes to operate in Scroll down and click the View URLs link On following page the app should display 4 URLs, one for each event type. Copy these down and click done. Install the xbmc.callbacks2 plugin for Kodi/XBMC Open the settings for the callbacks2 plugin to the playback menu Set events to the corresponding URL you copied from the app

If you are having any problems, please uninstall the SmartApp, goto the IDE (where you installed the devicetype and SmartApp code) and click the ‘Logs’ button. Reinstall the SmartApp via your mobile phone and post the logs here for me. Please ensure you check the logs for your username and password before posting!

Massive credit to @iBeech as this is heavily based on his Plex Manager

Also massive credit to @thildemar for hit callback controls.

Let me know if you have any issues.