No announcement yet.

Description - MeiKu (Roku Monitor and Control)

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

    Description - MeiKu (Roku Monitor and Control)

    The MeiKu plug-in allows you to monitor and control Roku streaming devices in HomeSeer. MeiKu uses uPnP to discover Roku's in your house and gives you the option create different types of devices to either monitor and/or control the Roku.


    • Monitor which app is currently open on your Rokus
    • Send remote control commands to your Roku
    • See the status of the headphones on your device (requires support on your Roku)
    • Launch any app installed on your Roku
    • Send a string of characters and/or commands to your roku.

    Meiku gives you the option to control and/or monitor your Roku Devices. There are currently 5 basic devices the plug-in creates:
    1. Main Root Device
      • This is the main root device. This device current provides no functionality, but is reserved for future functionality.
    2. Player root device and power status
      • This is the main root device for a Roku and is always created. This Device is used to show the power/online state of the Roku and also whether or not the screensaver is active.
    3. Installed Apps/App Control
      • This device is used to show the the currently open App and gives you the option to open any app currently installed.
      • This is an optional device. You must check the "Create Applications/Current App Device" checkmark in the MeiKu General options to have this device created for your Rokus.
    4. Remote Control
      • This device allows you to send commands to the Roku as if it were from the Remote. Depending on the device and the features that are available, this may include extra controls such as "Find Remote".
      • This is an option device. You must Check the "Create Control Device" checkbox in the MeiKu General options to have this device created for your Rokus.
    5. Headphones Status
      • This devices allws you to see the status of the Headphones. If your device supports remotes that headphones plug into. This device will tell you if the headphones are plugged in or not.
      • Thisis an optional device. You must check the "Create Headphones Device" checkbox in the MeiKu General options to have this device created for your Rokus.

    There are a few options that can be changed to alter the behavior of the plug-in.
    • Create Applications/Current App Device - This checkbox tells the plug-in to create a device to monitor the currently open app and allow you to launch apps from HomeSeer.
    • Create Control Device - This checkbox tells the plug-in to create a device for each of your Rokus that allows you to send remote control commands to the Roku.
    • Create Headphones Device - This checkbox tells the plug-in to create a device for each of your Rokus that lets you see if the headphones are plugged into the remote or not.
    • Discovery Interval - This tells the plug-in how often to check for new Roku Devices. This is defaulted to 0 (disabled), but if you want to check for new Rokus on a regular interval, you can change this value. This value will also self heal Rokus that have change IP addresses so that the plug-in gets the new IP address.
    • Discovery Timeout - This tells the plug-in how long you want to look for Rokus each time a discovery is run. In my tests I have found 5 seconds to be adequate, but this can be increased if all your Rokus are not found. It is not advisable to set this larger than say 1 minute.
    • Device Polling - This tells the plug-in how often you want it to check each Roku for changes in the currently open App and other settings. This can be set to 0 (zero) seconds to disable it.
    • Device App Polling - This tells the plug-in how often you want to check each Roku for changes in the installed apps on your Rokus. the default is once per day (24 hours). You can set this to 0 (zero) to disable it.
    • Delete Uninstalled Apps - Checking this will tell the plug-in to delete the app from the Apps device status pairs if it is no longer on the Roku when the Apps are updated from the Roku (using Device app polling). Beware that this might cause events to not work if you are checking for a specific app or setting the app in an event.

    • Discover Rokus - Pressing this button will manually look for new Rokus. This can also be used if your Roku's IP address has changed and you want to update it in the plug-in.
    • Device List - This is the list of Roku's the plug-in knows about. Each Roku has a set of options for each one:
      • Create Devices? - Checking this will tell the plug-in to create devices for this Roku. If you uncheck this box, the plug-in will not delete the devices in HomeSeer. That is left up to the user to do. If the devices are left, they will not be updated during polling of devices is this box is unchecked.
      • Update Apps - Pressing this button will do a manual poll of the device for new installed apps and uninstall any that are missing if the "Delete Uninstall Apps" checkbox is checked in the General options.

    There are currently 2 options for logging for the plug-in.
    • Enable Debug Logging - Enabling this option will create a log file in \logs\MeiKu.log in the HomeSeer install directory. This should only be turned on for sending debug information to the Developer upon request.
    • HomeSeer logging Level - This sets the level of logging that goes to the HomeSeer logs. For most cases, Error or Off should be adequate.
    Attached Files
    Last edited by sirmeili; July 29, 2017, 08:58 PM.
    MeiAutomtion Home

    This is now available in the updater and in the HomeSeer store here:
    MeiAutomtion Home


      Sending Text to a Roku

      As of version, you can send a string of text to your Roku. This was included as a request by a user.

      You can send any ASCII character to a Roku as well as a list of commands. In addition, some special tags are included as well.

      Commands keys you can send. Some are on your remote, but there are some that are not available on any physical remote. For instance, Enter is for completing keyboard entry fields, such as search fields (it is not the same as Select). Search is useful for short-cutting directly to search screens.

      When adding a command to your string, you enclose it in square brackets ([]). For Example: [Enter]
      • Home
      • Rev
      • Fwd
      • Play
      • Select
      • Left
      • Right
      • Down
      • Up
      • Back
      • InstantReplay
      • Info
      • Backspace
      • Search
      • Enter

      Special Tags
      Special tags are commands you can put in your string to affect the processing of the text. Special Tags will be added as time goes on and/or as users request them.

      Special tags are used by putting them in curly brackets ({}). If a special tag has a value, it is added after the tag, but inside the brackets, separated by a colon (. For instance: {wait:500}.

      You can also add more than 1 special tag per set, but separating them by a semi-colon (. for instance: {openapp:Hulu;wait:5000}. This tells the plugin to open Hulu, then wait 5 seconds. In cases where you have more than 1 special tag in a set of brackets, they are executed in the order they are entered.
      • wait - This special tag tells the plugin to wait for a set period of time before continuing on with sending the string.

        For Example: "{openapp:Hulu;wait:5000}[Info][Select]{wait:500}test 2" will do the following:

        Open Hulu, wait 5 seconds. Then click the Info button, then click select (which at the time of writing this was "Search"), then waits 500ms and sends in "test 2".
      • openapp - This special tag allows you to open an app by it's name (as it is in the App Devices status pairs). For instance: "{openapp:Netflix}" will open the Netflix app.

        This may not be all that useful beucase you can always open the app via the "Control a Device" action built into homeseer to set it, but was included in case anyone needed it.

      Replacement Variables
      Replacement variables will be added so that you can send device values and strings to your Roku.

      Special notice:
      Just a quick note to clear up any potential confusion. Sending text to your Roku can not be used for notifications. Roku currently does not have a notification API.

      What this is used for is for automating long sequences of commands to your Roku which might include filling in text boxes, such as for a search.
      Last edited by sirmeili; July 29, 2017, 10:31 PM.
      MeiAutomtion Home


        Basic Roku TV Support!

        Basic support for Roku TVs has been added. Any Roku TVs should be detected on plugin start and the commands added to the Command Device (image attached).

        The following commands have been added:
        • Volume Up
        • Volume Down
        • Mute
        • Channel Up
        • Channel Down
        • Power off
        • Input (Tuner)
        • Input (HDMI1)
        • Input (HDMI2)
        • Input (HDMI3)
        • Input (AV1)

        In addition, beta support for turning a Roku TV on is included, but not in the command device.

        To Test the Power on and Power Toggle features, you can find the buttons on the settings page next to any devices that are detected as Roku TVs. This is experimental and meant to be used to help fine tune the process for turning on a Roku TV from a powered off state (which is not officially supported by Roku).
        Attached Files
        Last edited by sirmeili; November 13, 2017, 10:15 PM.
        MeiAutomtion Home


          Scripting Functions

          As of you can can send string of text to a Roku via scripting.

          The script function is called SendStringToRokuDevice. The method takes 2 arguments:
          1. An Integer that is the HomeSeer Reference to the root device of the Roku you want to send the text to
          2. The string of text you want to send

          The method returns a boolean value of whether or not the plugin was successful in sending the message.

          Here is a sample script that sends the play command to a Roku:

          Sub Main(parm as object)
          dim success as Boolean = hs.PluginFunction("MeiKu","","SendStringToRokuDevice",{278,"[play]"})
          hs.WriteLog("MeiKu Test",success)
          End Sub
          Please see the post above on what you can include in the text including the special commands. All are supported via the script as well.
          MeiAutomtion Home