Skip to content
Chris Vavruska edited this page Aug 3, 2017 · 2 revisions

Kodi4Smartie

kodi4smartie1.png

Kodi4Smartie is a DLL plugin for LCD Smartie(http://lcdsmartie.sourceforge.net/) which listens for notification from Kodi and displays information on a 2 line LCD character display. While the default line width is 20 character there is no reason it can't be configured for a short or longer width.

Installation

1) Download the zip file containing the Kodi4Smartie DLL and associated files.
2) Extract the files

kodi4smartie2.png

3) Copy the kodi4smartie.dll and the kodi4smartie.cfg to the LCD Smartie program plugins folder.
4) Copy the cpprest120_2_6.dll to the LCD Smartie program folder.

Kodi4Smartie requires the microsoft vc++2015 x86 runtime. Available [here](https://www.microsoft.com/en-us/download/details.aspx?id=48145)

The DLL provides the following LCD Smartie functions:

Function 1: Is meant to be displayed on line 1 of an LCD display. It shows title information as well as other navigation information (FF, rew, Volume)

Function 2: Is meant to be displayed on line 2 of an LCD display. Upon initial playing of a title Kodi4Smartie shows various lines of information about the title. It then shows current progress in a title.

Function 3: Lets you know if Kodi is running. It can be used for custom actions inside LCD Smartie.

Function 4: Displays the current version of the Kodi4Smartie DLL. Not really useful unless you are unsure which version of the DLL you are running.

Function 5: Displays custom information from kodi.

usage: $dll(Kodi4smartie,5,method,item#sub-item)


Example 1: $dll(kodi4smartie,5,Player.GetPlayers,#type)

In this example we are calling the Player.GetPlayers method. This method returns PlayerId and type. We want the value associated with type.


Example 2:$dll(kodi4smartie,5,Player.GetProperties,totaltime#minutes)

In this example we calling the Player.GetProperties method to get the totaltime item. The item returns hours,minutes,second and milisecond. We are looking for the the minutes.

Function 6: Display the current icon (from function 1). Can be useful for forming your own screens.
    usage : $dll(Kodi4smartie,6,,)


Function 7: Display Label - If kodi is not running then it will display the "knf_str" string.
    usage : $dll(Kodi4smartie,7,method,item)
    Example  1:
        $dll(kodi4smartie,7,XBMC.GetInfoLabels,System.CurrentWindow)
        
        This example will show the page or menu you are on (Home/Movies/Music/etc) 
    Example 2:
        $dll(kodi4smartie,7,XBMC.GetInfoLabels,System.CurrentControl)

        This example will show the current control/sub menu item.

Function 8: Duplicate of function 7 except it displays nothing instead of the "knf_str" string.

Function 9: Display kodi state
    Returns an integer of the current state: kodi_not_running(0),none(1), play(2), stop(3), pause(4), ff(5), rew(6), mute(7),idle(11 -- see idle_timer)

Function 10: Reset idle timer

Function 11: Get connected state 
    This function is better at detecting Kodi than function 3 since function 3 will return true before you can communicate with Kodi.

Configuring LCD Smartie

In the lcd Smartie setup window for line 1 & 2 enter the following:

$dll(Kodi4smartie,1,,)
$dll(Kodi4smartie,2,,)

Configure the following for both lines:

Enable "Don't scroll this line"
Disable "Continue on next line"
Disable "Center Text"

kodi4smartie3.png

 

Advanced Setup

If you want to switch between screens you can use the following lcd smartie configurations to get you started:

Refresh interval 1000. screen 1-3:Enabled & Sticky

screen 1
line1: $dll(kodi4smartie,8,XBMC.GetInfoLabels,System.CurrentWindow)IDLE
line2: SCREEN

screen 2
line 1:$dll(kodi4smartie,7,XBMC.GetInfoLabels,System.CurrentWindow)
line 2:$dll(kodi4smartie,7,XBMC.GetInfoLabels,System.CurrentControl)

Screen 3
line 1:$dll(kodi4smartie,1,,)
line 2:$dll(kodi4smartie,2,,)$dll(kodi4smartie,10,,)

Action 1: $dll(kodi4smartie,9,,) = 1 gotoscreen(2)
Action 1: $dll(kodi4smartie,9,,) = 2 gotoscreen(3)
Action 1: $dll(kodi4smartie,9,,) = 11 gotoscreen(1)

Notifications

Kodi4Smartie listens for the following notifications from Kodi

Player.OnPlay
Player.OnPause
Player.OnStop
Player.OnSpeedChanged
Application.OnVolumeChanged

When the dll receives notifications it will display different information based on which notification is received and which player you are using (movie, song, picture, tv).

Configuration

While I have tried to make Kodi4Smartie somewhat configurable it is also based on what I wanted to see on each screen.

See the Kodi4Smartie.cfg file for information about configuring kodi4smartie.

 

Change log

Here a list of things I remember fixing or changing since V1.0

. Fix a use_bars to allow the bars to be disabled. This was functionally broke in 1.x
. Added functions 5-11
. Fix problem with looking for config in the wrong location
. Provide better error handling as well as fix a deadlock issue when kodi would exit mid request
. Remove Host from the configuration. Kodi4Smartie must be running on the same machine as Kodi. This may return in a 2.1 release as I think I have a need for it return.

 

Special Thanks

Special thanks go out to Johannes Tveden Nielsen for pushing me along to add the new functionality. Without his push and testing function 5-11 would not have been added.

Source Code

The source code is open source under GPLv3. We will gladly accept any modification as long as they fit into the project. Source code can be found at kodi4smartie.codeplex.com

Bugs?

I primarily use Kodi for viewing movies. While there is support for in the DLL for displaying information about TV, Music and Pictures I have done little testing in this area.

If you find any bugs please let me know. Please include any steps needed to reproduce the issue.