Announcement

Collapse
No announcement yet.

Kodi/XBMC Plug-in - User Guide

Collapse
This topic is closed.
X
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Kodi/XBMC Plug-in - User Guide

    INSTALLATION / CONFIGURATION

    System Requirements:
    This plugin is for HS3 or HS3PRO. It works with both Windows and Linux versions.
    It supports Kodi/XBMC versions 12 (Frodon), 13 (Gotham), 14 (Helix) , 15 (Isengard) 16 (Jarvis), 17 (Krypton), and 18 (Leia)

    Prerequisites:
    To auto discover Kodi instances, this plugin needs a Zeroconf implementation (i.e Bonjour) to run on both your HomeSeer server and Kodi machine.

    On Windows this is the Apple Bonjour service, if you have installed iTunes (or most of other Apple software), it should already be installed.
    If it isn't, you can download it from the following links:
    64bits version: https://www.dropbox.com/s/a0lhdxpbd19go4i/Bonjour64.msi
    32bits version: https://www.dropbox.com/s/dkoi00zvlhxx2cn/Bonjour.msi

    On Linux this is the Avahi daemon. If it is not already installed and running you need to install the avahi-daemon package. On a Debian like distribution the command to install the package is

    Code:
    sudo apt-get install avahi-daemon libavahi-client3


    Kodi Configuration:
    The following settings are mandatory for the plugin to work.
    Go to the Service Settings page

    In General > Zeroconf, enable "Announce services to other systems"

    Click image for larger version  Name:	settings_services_general.png Views:	420 Size:	333.3 KB ID:	1274170

    In Control > Web server, enable "Allow remote control via HTTP", Optionally you can add a username and password, but in this case you will have to set them in the plugin configuration page (see plugin configuration section below)
    In Control > Application control enable both
    "Allow remote control from applications on this system" and "Allow remote control from applications on other systems"

    Click image for larger version  Name:	settings_services_control.png Views:	1 Size:	335.6 KB ID:	1274169


    Plugin Installation:
    Download and install from the updater from the Media plug-ins section or from the Beta section if you want to install the latest Beta version. See this thread for more info and release notes.

    Plugin Configuration
    Start the plugin from the "PLUG-INS > Manage" page and start all your Kodi players. Then go to the config page "PLUG-INS > Kodi > Config". If everything is ok, you should see one line for each Kodi player the plugin has detected:

    Click image for larger version  Name:	config.png Views:	391 Size:	56.9 KB ID:	1274171


    Add username and password if needed, and then go to the devices page you should see something like the screenshot below. You will get one set of devices for each Kodi player, and for each set the root device status will tell you if the plugin has successfully connected.

    Click image for larger version  Name:	devices.png Views:	382 Size:	227.6 KB ID:	1274172


    If zeroconf is not available on your platform (like on Android), then the plugin won't be able to automatically detect your Kodi player. In this case you need to manually add the player in Config/Kodi.ini file like this:
    Code:
    [PLAYERS]
    1###name=TV Room
    1###ipaddress=192.168.1.102
    1###port=8081
    1###password=kodi
    1###username=kodi
    If you use the default port (8080) and/or if you don't use any username and password you can remove the corresponding lines.
    If you already have some instances configured in the [PLAYERS] section, increment the number at the beginning of the lines, i.e. 2### instead of 1###, etc...

    Once this is done restart the plugin, then you can use the buttons associated to the root device to connect/disconnect or you can use the Kodi actions "Plugin Connect" and "Plugin Disconnect" from events.
    Last edited by spud; January 9, 2019, 09:46 AM.

    #2
    FEATURES

    Controls
    As you can see in the screenshot above, from the Device management page you have some controls on your Kodi players: Play / Pause / Stop, Volume control, etc...
    You can also use the web interface accessible from links in Plug-ins > Kodi, to control each of your Kodi players: browse libraries select item to play, etc...
    Click image for larger version

Name:	webinterface.jpg
Views:	1
Size:	110.4 KB
ID:	1188846


    Triggers
    You can also use these Kodi devices to trigger HS events, for example if you want to turn the lights off when Kodi start playing something, and turn them on when it is paused or stopped, you can do so by creating some events like on the screenshot below:

    Click image for larger version

Name:	lightsonoff.jpg
Views:	1
Size:	122.9 KB
ID:	1170255

    The plugin also creates a new Trigger category called "Kodi Trigger" which allow HS to trigger some events based on some Kodi events. Here is the current list of available Kodi triggers:
    • System On Low Battery
    • System On Quit
    • System On Restart
    • System On Sleep
    • System On Wake
    • Addon Trigger

    The Addon Trigger is particularly interesting because it allows you to trigger some HS events from any Kodi Addon or script, you just have to call JSONRPC.NotifyAll(sender, message) from the script or addon. For an example read this thread


    Actions
    The plugin creates a new Action category called "Kodi Action" which allow HS to trigger some specific Kodi actions. You can either apply these actions to all your Kodi players or to a specific one.

    For example on the screenshot below a GUI notification is sent to all Kodi players.
    Click image for larger version

Name:	xbmcactions.jpg
Views:	1
Size:	69.3 KB
ID:	1170256

    Here is the current list of available Kodi actions:
    • GUI Show Notification
    • GUI Activate Window
    • Audio Library Scan
    • Audio Library Export
    • Video Library Scan
    • Video Library Export
    • Input Back
    • Input Context Menu
    • Input Down
    • Input Execute Action
    • Input Home
    • Input Info
    • Input Left
    • Input Right
    • Input Select
    • Input Send Text
    • Input Show Codec
    • Input Show OSD
    • Input Up
    • Player Open Media
    • Switch Player
    • Player Enable Party Mode
    • Player Disable Party Mode
    • Application Quit
    • System Eject Optical Drive
    • System Hibernate
    • System Reboot
    • System Shutdown
    • System Suspend
    • Execute Addon
    • Enable Addon
    • Disable Addon
    • Plugin Connect
    • Plugin Disconnect
    • Profile Load

    Click here to see another example that use the "Enable Addon" action to display a security camera overlay in Kodi

    You can also use the device controls to do some event actions. For example if you want to stop a Kodi player, select "Control a device" as the action category, then select your Kodi status device, and then select stop.
    Last edited by spud; May 29, 2018, 09:40 AM.

    Comment


      #3
      SCRIPTING

      here is the current list of functions available from scripts:
      • void InputSendText(string player, string text)
      • void GUIShowNotification(string player, string title, string message, int displaytime = 5000, string imageUrl = null)
      • int GetCurrentMediaID(string player)
      • string GetCurrentMediaType(string player)
      • string[] GetCurrentGenre(string player)
      • int GetCurrentTime(string player)
      • int GetTotalTime(string player)
      • string GetCurrentStereoscopicMode(string player)
      • double GetCurrentAspectRatio(string player)
      • void PlayerOpenMedia(string player, string mediaType, int mediaID)

      And here is for example how to call GetCurrentTime and GetTotalTime from a C# script, to get the elapsed time and total time of a show/movie in seconds.

      public object Main(object[] Parms)
      {
      int currentTime = (int) hs.PluginFunction("Kodi", "", "GetCurrentTime", new object[] { "Kodi (spud2)" });
      int totalTime = (int) hs.PluginFunction("Kodi", "", "GetTotalTime", new object[] { "Kodi (spud2)" });

      hs.WriteLog("Kodi Script", "Current Time in secs = " + currentTime);
      hs.WriteLog("Kodi Script", "Total Time in secs = " + totalTime);
      return 0;
      }
      Last edited by spud; June 1, 2017, 04:46 PM.

      Comment


        #4
        SPEAK PROXY

        This plugin can act as a Speak Proxy, so that Speak actions can be automatically send as GUI notifications to Kodi players.

        To enable this feature go to the config page and set "Send Speak Actions as Kodi GUI Notifications" to yes.

        If you have another plugin already acting as a speak proxy you may want to set "Forward Speak Actions to HS Speakers"to No, otherwise you may hear twice the notification on HS speakers

        In your Speak action, you can target specific Kodi players by using Kodi:<kodi_player_name> as the name of your speaker.
        You can also use standard replacement variables like shown on the screenshot below:

        Click image for larger version

Name:	speakproxy.jpg
Views:	2
Size:	30.6 KB
ID:	1178212

        Click image for larger version

Name:	speakproxyresult.jpg
Views:	1
Size:	166.3 KB
ID:	1178213
        Last edited by spud; February 7, 2017, 04:02 PM.

        Comment

        Working...
        X