Yatse API

images

You can use Android intents to send commands to your Media Center from any application via Yatse: Kodi Remote and cast.
You can also use URI to start Yatse from a web page for example or listen to some broadcast to have detailed information on what is happening on your Media Center.
Remark: Yatse includes a Tasker plugin for easier usage of the API.

Yatse register some specific URI when installed:
yatse://command/show/remote
To show the Remote
yatse://command/show/select_host
To show the Select Host Dialog
yatse://command/show/volume_slider
To show the Volume Slider
yatse://command/browse/movies
To show the Movies library part
yatse://command/browse/tvshows
To show the TV Shows library part
yatse://command/browse/music
To show the Music library part
yatse://command/browse/pictures
To show the Pictures library part
yatse://command/browse/files
To show the Files library part
yatse://command/browse/pvr_tv
To show the Pvr tv library part
yatse://command/browse/pvr_radios
To show the Pvr radios library part
yatse://command/select/media_center?ID=xx
To change the current Media Center (where xx is the ID of the media center, visible in all media center list bottom right)
yatse://command/voicecommand/start
To start the Voice Command
yatse://command/play/mediatype/value (Unlocker only)
To start playing a media of type mediatype with the name value (Sample : yatse/command/play/Movie/avatar)
yatse://command/search/mediatype/value (Unlocker only)
To search a media of type mediatype with the name value (Sample : yatse://command/search/Movie/alien)

With the unlocker you can activate the option Send Broadcasts that allow Yatse to send public broadcast to inform other application on the phone on events.

The Broadcast Intent will have it's action set to : org.leetzone.android.yatsewidget.INFO_STATUS_CHANGED

You must then check the int extra : org.leetzone.android.yatsewidget.STATUS_FLAG to know the type of event.

This int is a bit flag that can have one or more of the following bits set :

0x1 : Media changed : This flag is set when the currently playing media change
0x2 : Status changed : This flag is set when the status of Media Center change (Play / Pause / Stop / Seeking)
0x8 : Connection changed : This flag is set when the connection status to Media Center change

Depending on the flags a number of extra fields will be filled with more details (The corresponding needed flag is show between () as the type)

• (0x8) org.leetzone.android.yatsewidget.HOST_STATUS - boolean : Contain the connection status to current Media Center
• (0x8) org.leetzone.android.yatsewidget.HOST_ID - long : Contain the id of current Media Center (Yatse 4.3.0+)
• (0x8) org.leetzone.android.yatsewidget.HOST_NAME - string : Contain the name of current Media Center (Yatse 4.3.0+)
• (0x2) org.leetzone.android.yatsewidget.MEDIA_ISACTIVE - boolean : True if a player is currently active
• (0x2) org.leetzone.android.yatsewidget.MEDIA_ISPLAYING - boolean : True if the media is currently playing (not paused)
• (0x2) org.leetzone.android.yatsewidget.MEDIA_ISSEEKING - boolean : True if the media is currently seeking or fast forwarding(rewinding)
• (0x1) org.leetzone.android.yatsewidget.MEDIA_FILENAME - string : The full filename of the media
• (0x1) org.leetzone.android.yatsewidget.MEDIA_ALBUM - string : The album name of the media if present
• (0x1) org.leetzone.android.yatsewidget.MEDIA_ARTIST - string : The artist name of the media if present
• (0x1) org.leetzone.android.yatsewidget.MEDIA_SHOW_EPISODE - int : The episode number of the media if present
• (0x1) org.leetzone.android.yatsewidget.MEDIA_SHOW_SEASON - int : The season number of the media if present
• (0x1) org.leetzone.android.yatsewidget.MEDIA_SHOW_TITLE - string : The Tv Show name of the media if present
• (0x1) org.leetzone.android.yatsewidget.MEDIA_TITLE - string : The title of the media
• (0x1) org.leetzone.android.yatsewidget.MEDIA_GENRE - string : The genre of the media if present
• (0x1) org.leetzone.android.yatsewidget.MEDIA_MEDIA_TYPE - string : The media type (movie / song / episode / unknown )
• (0x1) org.leetzone.android.yatsewidget.MEDIA_PLOT - string : The plot of the media if present
• (0x1) org.leetzone.android.yatsewidget.MEDIA_RATING - double : The rating of the media if present
• (0x1) org.leetzone.android.yatsewidget.MEDIA_TRACK - int : The track number of the media if present
• (0x1) org.leetzone.android.yatsewidget.MEDIA_IMDB - string : The IMDb of the media if present
• (0x1) org.leetzone.android.yatsewidget.MEDIA_THUMBNAIL - string : The string representation of the local uri to current media thumbnail cache (Large) (file://.....). This field can be missing if no image exists or if Yatse have not yet downloaded the image

Just create a service intent with action set to:
org.leetzone.android.yatsewidget.ACTION_CUSTOM_COMMAND (Yatse 5.7+ / Unlocker only)
For action on defined Custom Commands.
org.leetzone.android.yatsewidget.ACTION_MEDIA_COMMAND
To send a direct command to your Media Center.
org.leetzone.android.yatsewidget.ACTION_APP_SHOW_HOME
To start Yatse Widget. (Will go directly to Now playing page if something is playing)
org.leetzone.android.yatsewidget.ACTION_APP_SHOW_CHOOSER
To show Yatse Widget host chooser for a quick change.
org.leetzone.android.yatsewidget.ACTION_APP_SHOW_VOLUME
To show Yatse Widget volume slider for a quick volume change.
org.leetzone.android.yatsewidget.ACTION_MEDIA_NOTIFICATION
To send a notification to your Media Center.
org.leetzone.android.yatsewidget.ACTION_MEDIA_PLAYURI (Yatse 4.x+ / Unlocker only)
To start chosen URI on your Media Center.
org.leetzone.android.yatsewidget.ACTION_MEDIA_SYNC
To start media synchronization.
org.leetzone.android.yatsewidget.ACTION_APP_SELECT_MEDIACENTER
To change current media center.
org.leetzone.android.yatsewidget.ACTION_APP_VOICECOMMAND_START
To start the Voice Commands.
org.leetzone.android.yatsewidget.ACTION_APP_VOICECOMMAND_PARSER (Unlocker only)
To start the parsing engine on a natural language sentence
org.leetzone.android.yatsewidget.ACTION_APP_SELECT_RENDERER (Yatse 6.x+ / Unlocker only)
To change Yatse current renderer / player

To pass String parameter use the Extra key: org.leetzone.android.yatsewidget.EXTRA_STRING_PARAMS
To pass Int parameter use the Extra key: org.leetzone.android.yatsewidget.EXTRA_INT_PARAMS

Send commands

• playpause
• play
• pause
• stop
• rewind
• forward
• next
• previous
• subtitles
• quit
• togglemute
• mute
• unmute
• seek
• volume
• wol
• context
• back
• display
• system
• select
• up
• down
• left
• right
• power
• cectogglestate
• aspectratio
• info
• shutdown (3.9.6+)
• suspend (3.9.6+)
• reboot (3.9.6+)
• hibernate (3.9.6+)
• home (6.0.0+)
• cecon (7.7.0+)
• cecoff (7.7.0+)
• For commands seek / volume you must also pass the Int parameter with a value between 0 and 100

Remark: WOL command also start Kodi is you have a correctly configured XBMC Starter.

Custom commands

You must use the Int parameter to pass the custom command id.
This id can be seen when clicking on the 3 dots on a Custom Command listing inside Yatse.

Change Media Center

You must use the Int parameter to pass the media center id.
This id can be seen in all media center listing inside Yatse.

Play URI

The String parameter will contain the Uri.
It can contains Media Center specific Uri like: "plugins://....."

Change Renderer (Unlocker)

The int parameter must contain the Renderer type:
• 1: Default Media Center
• 2: Local Device
• 3: Remote Media Center
• 4: UPnP Player
• 5: Airplay Player
• 6: Chromecast Player

For Renderer type 3 to 6 the String parameter contains the necessary information select the Renderer
• 3: String param contain the host id
• 4: String param contain the UDN
• 5: String param contains the Airplay key
• 6: String param contains the Chromecast Id

Send Notification

If you want to send a message containing a title and a message use the | separator.
For example : "Title|Message".

Parse voice command (Unlocker)

The String parameter that will contain the sentence.
Yatse will then try to parse the sentence and start the correct action.
For example : "I want to listen to some lounge music.".

Start synchronisation

The String parameter that will contain the part you want to sync.
Sync commands are queued so you can send multiple ones they will be treated in order.
• Movie
• MovieSet
• Album
• Artist
• AudioGenre
• Song
• MusicVideo
• Show
• Episode
• ALL