Author Topic: Control Kodi On Android Device (Nvidea Shield)  (Read 3394 times)

0 Members and 1 Guest are viewing this topic.

wanderer189

  • Jr. Member
  • **
  • Posts: 9
  • Karma: 0
    • View Profile
Control Kodi On Android Device (Nvidea Shield)
« on: June 27, 2019, 12:02:23 PM »
I am totally new to VC, got it for a different project. Anyways, I installed VC and used Kodi in the setup to get an idea and learn VC and the command structure . I was very impressed how well it worked out of the box.

So far, the only thing I can't get to work is the navigation (left, right, up, down) and select. I get the "keyboard (pc only)". I am sure there is way to fix this??

Any help would be greatly appreciated.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Control Kodi On Android Device (Nvidea Shield)
« Reply #1 on: June 27, 2019, 12:39:11 PM »
Yes.  First I should mention that using voice commands for keyboard emulation is pretty cumbersome so if you have some other method I would use that. Still in a pinch sometimes it can be useful.

If you want to navigate on Kodi running on a remote system (e.g. not the same one that VC is running on) then you can't use keyboard emulation which is the default method.

Assuming that you've installed the preset configuration for Kodi 17 (and higher), your command tree should look something like the attached image.

Note that there is a group located within "Kodi Navigation and buttons" which is titled "Kodi Movement event client" and this group is greyed out which means that it has been disabled.  Right-click the groups and enable it.  You will also need to disable the group titled "Keyboard Emulation (local PC only)" so that the voice commands don't conflict with each other.  After enabling and disabling the groups in the editor you'll need to restart VC.  Alternatively you can enable and disable groups instantly in the groups window available on the main VC window but it's best to do it this way so that the setting is retained by default when you launch VC.

There is a setting in Kodi that must be enabled for these commands to work.  They use the "event client" which is a somewhat antiquated way to control Kodi but I believe it still works and is probably faster than using the JSON api.  If they don't work it's possible to create commands using the JSON api similar to the ones you will find in the group "Kodi simple actions".
Ignore the above I can see that these commands have been updated and it's just the group name that was left over from the old method.  In other words they don't use the event client any more.

Please note that I probably can't provide any more support today because I'm leaving for a trip in a few hours.  I will be available to provide limited support on and off while I am travelling over the next couple of weeks.  Nim5ter will probably also be able to help you on evenings and weekends (E.S.T).  So just saying our answers might take a bit longer than usual. :)
« Last Edit: June 27, 2019, 12:43:37 PM by jitterjames »

wanderer189

  • Jr. Member
  • **
  • Posts: 9
  • Karma: 0
    • View Profile
Re: Control Kodi On Android Device (Nvidea Shield)
« Reply #2 on: June 27, 2019, 02:26:17 PM »
Yes, I am using my own fork of Kodi 18.2. That did the trick for left, right, up, down, still have no "select" though.
« Last Edit: June 27, 2019, 02:28:24 PM by wanderer189 »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Control Kodi On Android Device (Nvidea Shield)
« Reply #3 on: June 27, 2019, 02:55:05 PM »
I think you have what you need to figure this one out on your own.  We leave it "as an exercise".  :)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Control Kodi On Android Device (Nvidea Shield)
« Reply #4 on: June 27, 2019, 03:08:15 PM »
Actually select is already part of the default configuration, and can be found in the "Kodi Simple actions" group.  Tested and working for me.

wanderer189

  • Jr. Member
  • **
  • Posts: 9
  • Karma: 0
    • View Profile
Re: Control Kodi On Android Device (Nvidea Shield)
« Reply #5 on: June 27, 2019, 05:05:15 PM »
When I browse to a location, say episodes, then issue "select" command, it shows as it's working on pc and kodi instance, but does not play or enter. Is not the select button the same as ok on a remote or enter on a keyboard???

To play the highlighted item, I have to issue the play pause, is this normal?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Control Kodi On Android Device (Nvidea Shield)
« Reply #6 on: June 27, 2019, 06:49:44 PM »
I think it's the same. I tested earlier with select to navigate down sub-menus but not to play something. I'm not able to test this now so maybe someone else can chime in...

I tested using Kodi running on another Windows system in my LAN.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Control Kodi On Android Device (Nvidea Shield)
« Reply #7 on: June 27, 2019, 09:27:14 PM »
The "Select" command in the Kodi Simple actions group in VC is sending the enter key code to Kodi's event client.

For me, if I navigate to TV episodes for a particular show season and say "Select" Kodi is properly playing the episode. My scenario is the same as James' -- talking to Kodi on a different Windows machine on my LAN.

If it's not working reliably for you, you could try editing that XJson.Btn.KB action in your "Select" command to send the return key code instead of enter.

I just tested return in my setup and it works as well.

Here are the codes that are being used: https://github.com/xbmc/xbmc/blob/master/system/keymaps/keyboard.xml
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: Control Kodi On Android Device (Nvidea Shield)
« Reply #8 on: June 29, 2019, 04:36:05 PM »
When I updated to Kodi 18.0 I had to change the select and back command (I must have forgotten to post them a while back), I use these commands for kodi on windows and android.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.4.5-->
<commandGroup open="True" name="Kodi 18 updated commands" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="807" name="Select" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>Input.ExecuteAction</param>
        <param>"action":"select"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
  </command>
  <command id="808" name="Back" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>Input.ExecuteAction</param>
        <param>"action":"back"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
  </command>
</commandGroup>

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Control Kodi On Android Device (Nvidea Shield)
« Reply #9 on: June 29, 2019, 04:59:01 PM »
Thanks PeglegTV. I've been hoping you'd notice this thread. I was going to suggest he try PMing you, as our resident Kodi aficionado.

It's true, we're still on Kodi 17 in-house.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: Control Kodi On Android Device (Nvidea Shield)
« Reply #10 on: June 29, 2019, 05:24:55 PM »
No problem, at some point I'll need to post the new method needed for loading playlist as Kodi changed how they are handled in Kodi 18

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Control Kodi On Android Device (Nvidea Shield)
« Reply #11 on: June 29, 2019, 05:32:54 PM »
How customized is your Kodi-VC command set relative to our out of the box configuration?

Just wondering if we need to run through the entire default command set to test them all, now. The impetus to upgrade Kodi and do all that is a tad less than it used to be around here.  ::)
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: Control Kodi On Android Device (Nvidea Shield)
« Reply #12 on: June 29, 2019, 05:59:24 PM »
as far as I can remember I have three commands that needed changed for Kodi 18 the two I posted for Select and Back, and then the new method for handling playlist with Kodi 18

this is where I found the fix for loading playlist in kodi 18 (and possibly moving forward)
https://forum.kodi.tv/showthread.php?tid=315249&pid=2694920#pid2694920
from what I gathered this has to be done as the new video player has "broken" the json api, but I'm not 100% sure on that


add / replace the playlist name for payload one
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.4.5-->
<command id="976" name="Play Playlist (Kodi 18)" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Playlist.Clear</param>
      <param>"playlistid": 1</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw/</cmdType>
    <params>
      <param>Playlist.Add</param>
      <param>"playlistid": 1, "item": {"recursive":true, "directory":"special://profile/playlists/video/{1}.xsp"}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>player.open</param>
      <param>"item":{"playlistid":1,"position":0}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
</command>

at some point (if I can find the time ;)) I can go through the stock kodi build for VC and the commands that I have and send you guys an updated list. as I'm sure that I have some commands and actions that are not included in the main build and I might have a few that aren't posted in the forum either

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Control Kodi On Android Device (Nvidea Shield)
« Reply #13 on: June 29, 2019, 06:05:53 PM »
This is very helpful, thanks again.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)