The Kodi for SmartThings device type implements several base capabilities from SmartThings and implements most of the attributes and commands for these capabiltiies. Additionally, there are several commands and attributes which were custom developed for this device type which may be useful in other SmartApps or integrations.
For example, using SharpTools on Android, you might setup widgets to quickly send actions to Kodi or setup Tasker events to trigger custom events on your Kodi setup. Additionally, these custom commands are useful in the advanced version of Rule Machine which allows you to send custom commands.
The following capabilities are implemented in this device type:
Media Controller
Music Player
Switch
Polling
Refresh
-
trackDescription
- the currently playing movie/TV show name -
trackData
- the current track data in JSON format (especially useful in Tasker) -
level
- the current volume level (eg. 100) -
mute
- the current mute status (eg.muted
,unmuted
) -
status
- current playback status of the active playerPlaying
,Paused
,Stopped
-
switch
- maps from thestatus
attribute (eg. on = "Playing"; off = "Paused" or "Stopped") -
destURL
- the destination URL used to control your Kodi endpoint -
currentWindowID
- the currently active Window ID (useful for determining the current activity) -
currentActivity
- the currently active Activity (eg.Video
,Fullscreen Video
-
activities
- the available activities[
videos
,videos.movietitles
,videos.recentlyaddedmovies
,videos.tvshows
,Videos.recentlyaddedepisodes
,music
,music.genres
,music.artists
,music.albums
,music.top100
,programs.addons
] -
playerID
- the currently active Kodi player ID -
kodiVersion
- the version number for the Kodi instance (eg.20150721-2f34a0c
) -
kodiName
- the name of the Kodi instance (eg.Kodi
)
toggleMute()
- toggles between muted and unmuted (especially useful in Android widgets)mute()
unmute()
setLevel(number)
- sets the volume level (0-100
)
startActivity(string)
- starts the selected activity (choose from the availabileactivities
)inputUp()
- send the UP (↑) button pressinputDown()
- send the DOWN (↓) button pressinputLeft()
- send the LEFT (←) button pressinputRight()
- send the RIGHT (→) button pressinputInfo()
- send the INFO button press (eg. for viewing details of movies/music)inputBack()
- send the BACK button pressinputSelect()
- send the SELECT/OK button pressinputHome()
- send the HOME button pressinputContextMenu()
send the CONTEXT MENU button pressinputShowCodec()
send the SHOW CODEC button pressinputShowOSD()
send the SHOW ON SCREEN DISPLAY button pressplay()
- send the play/pause commandpause()
- send the play/pause commandstop()
- send the stop commandon()
- maps toplay()
off()
- maps topause()
nextTrack()
- send the next track commandpreviousTrack()
- send the previous track command
getActivePlayers()
- get the list of currently active playersgetVideoPlayerStatus(number)
- gets the status of a specific playergetCurrentActivity()
- get the current activity; setscurrentActivity
andcurrentWindowID
poll
- sends therefresh()
commandrefresh()
- gets the updated media playback status and forces a refresh of event subscriptions
playFile(filename)
- starts playing a file (can be a local or HTTP streamed file!)playPlaylist(playlistid)
- starts playing the specified playlist (by ID)(0: Music, 1: Video, 2: Pictures)
clearPlaylist(playlistid)
- clears the specified playlist (by ID)addToPlaylist(playlistid, filename)
- adds a file to the specified playlist(0: Music, 1: Video, 2: Pictures)
(those not covered by above sections)
playTrack(filename)
- maps toplayFile(filename)
playText()
- NOT IMPLEMENTEDsetTrack(filename)
- maps toaddToPlaylist(1, filename)
resumeTrack()
- NOT IMPLEMENTEDrestoreTrack()
- NOT IMPLEMENTED
sendNotification(title, message, [image])
- sends a notification with the desiredtitle
andmessage
Note: The optionalimage
can either be a value ofinfo
,warning
,error
, or a path to an image that Kodi can access per the standard Kodi ShowNotification implementation.executeAddon(addonid)
- executes the desired addon based on the addon id (eg.script.globalsearch
)