Author Topic: Kodi Live TV Help  (Read 6054 times)

0 Members and 1 Guest are viewing this topic.

eugekiller

  • Jr. Member
  • **
  • Posts: 35
  • Karma: 0
    • View Profile
Kodi Live TV Help
« on: January 07, 2016, 07:20:50 PM »
Ok so i get the payload of the live tv PVR.

<payload>
        <value>18</value>
        <phrase>HD Кино</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>

Ok so i am always having a problem because the service i use always moves the channels around to different server or what ever. The name of the channels are always the same. I mean always. Any way to make something that will i guess rename the phrase?

Example

if phrase HD Кино change to B two (HD Кино)

So like regenerate the livetv payload?

Maybe adding something to xsql option.xml
<genXmlParam useSubStrings="true" xmlFilename="xbmcTvChannels" queryString="select idChannel, sChannelName from channels where bIsRadio=0" dataType="TV"/>
« Last Edit: January 07, 2016, 07:35:40 PM by eugekiller »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Kodi Live TV Help
« Reply #1 on: January 07, 2016, 09:14:22 PM »
I think you just need to Generate XML whenever your TV channels change in Kodi.

eugekiller

  • Jr. Member
  • **
  • Posts: 35
  • Karma: 0
    • View Profile
Re: Kodi Live TV Help
« Reply #2 on: January 07, 2016, 11:28:52 PM »
Hi James. By the way thanks before now getting the hang of this thing. ITS FREAKING GREAT!!!!!!!!!!

Ok so i use a service provider for live tv. But each channels address always changing. But the channel names are the same. Most channels are in Russian :(. So Vox cant dual language.

So i wanted to change the channel name in the payload for live tv. But the problem is i also have to refresh the payload every time and then find the channels again and change there names.

ok so i get a web address from this provider. In that address is hundreds of channels. Each channels is directed to its own site. Some times they remove a channel if its not working which messes the whole payload up. :(
to top it all off the channel names are in Russian or half in half. So i wanted to rename certain channels when the payload gets generated.

I hope i explained it where you could understand it.
Or Any ideas or solutions one might have?

« Last Edit: January 07, 2016, 11:48:41 PM by eugekiller »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Kodi Live TV Help
« Reply #3 on: January 08, 2016, 08:27:49 AM »
Can you send us the example TV channel payload XML file before and after it has been changed because of updates to the services?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Kodi Live TV Help
« Reply #4 on: January 08, 2016, 08:29:36 AM »
You haven't told us anything about what service or addon you are using. Is it possible that you can rename channels in Kodi.
« Last Edit: January 08, 2016, 09:11:46 AM by jitterjames »

eugekiller

  • Jr. Member
  • **
  • Posts: 35
  • Karma: 0
    • View Profile
Re: Kodi Live TV Help
« Reply #5 on: January 08, 2016, 09:52:39 AM »
Ok will show you a brief explanation lol. :)

Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<!--Payload for XBMC data.-->
<PayloadsRoot>
    <payload>
        <value>1</value>
        <phrase>Pro Все</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>2</value>
        <phrase>Premier Sports</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>3</value>
        <phrase>MGM HD</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>4</value>
        <phrase>Shop 24</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>5</value>
        <phrase>Усадьба</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>6</value>
        <phrase>1+1</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>7</value>
        <phrase>43 Канал HD</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>8</value>
        <phrase>Ля-минор</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>9</value>
        <phrase>Индия</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>10</value>
        <phrase>Eska TV</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>11</value>
        <phrase>Russian Travel Guide</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>12</value>
        <phrase>Спорт 1 HD</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>

foe example this is the payload at 9am. Then by 6pm the payload can look like this

Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<!--Payload for XBMC data.-->
<PayloadsRoot>
    <payload>
        <value>1</value>
        <phrase>Pro Все</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>2</value>
        <phrase>Premier Sports</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>3</value>
        <phrase>MGM HD</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>4</value>
        <phrase>Усадьба</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>5</value>
        <phrase>1+1</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>6</value>
        <phrase>43 Канал HD</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>7</value>
        <phrase>Ля-минор</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>8</value>
        <phrase>Индия</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
     <payload>
        <value>9</value>
        <phrase>Russian Travel Guide</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>10</value>
        <phrase>Спорт 1 HD</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>11</value>
        <phrase>Shop 24</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>

This is the code i use that you gave me to control live tv.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.4-->
<commandGroup open="True" name="Kodi Live TV" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="711" name="Switch to channel {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>Player.Open</param>
        <param>"item" : {"channelid" : {1}}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Switch to, Go to, Start</phrase>
    <phrase>Channel</phrase>
    <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\xbmcTvChannels.xml</payloadFromXML>
  </command>
</commandGroup>

So i did go in to the payload and renamed the chanels saved the payload.
Example: Eska TV would name it B One (Eska TV)

Then when i say B One it would go to B One (Eska TV) and then 4 hour later when i say B One (Eska TV) it would go to Спорт 1 HD. I hope that explained it.

eugekiller

  • Jr. Member
  • **
  • Posts: 35
  • Karma: 0
    • View Profile
Re: Kodi Live TV Help
« Reply #6 on: January 08, 2016, 10:03:48 AM »
So what i was thinking if its possible.

Tell VOX reload live tv payload.
It would generate new payload of the live tv from kodi.
then it would clean the payload up and generate a new livetv payload,

so it would take
chanel5 and rename it to b6
chanle 10 and rename it to b5
chanle 60 and rename it to b4

and so on. And your script that uses the original payload redirect it to use the changed payload.
(or some how when it generates the original payload to edit the names right away.)

I dont believe i can edit them in kodi but i might but ether way i dont believe it would solve the problem since all the channel values always change.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Kodi Live TV Help
« Reply #7 on: January 08, 2016, 11:07:12 AM »
First, just generally speaking: it's important in VoxCommando to use the editor tools provided in order to edit commands and payloads.

You should not be opening  payload XML files or your command XML in a text editor in order to edit the XML, if that's what you are doing. (I don't know if you are, but it seems like you might be based on your posts.)

These tools are also a more friendly way to view commands and payload XML files than a text editor.

The payload XML editor can be accessed in VoxCommando's File menu, or directly within the Command Tree Editor, by clicking on any payload XML that is already assigned to a command.

Second:

It's actually not such a big problem.

Use the Payload XML Editor to create a new payload XML file, where the Russian channel name is the value and its equivalent English channel name is the phrase. Save the file in your payloads folder, as "Channel_translations.xml" (see the example file that I've attached to this post).

Then replace the Kodi Live TV channel command that James provided the other day with the following:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.4-->
<commandGroup open="True" name="Kodi Live TV" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="711" name="Switch to channel {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>PayloadXML.GetValue</cmdType>
      <params>
        <param>XbmcPayloads\xbmcTvChannels.xml</param>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>Player.Open</param>
        <param>"item" : {"channelid" : {LastResult}}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Switch to, Go to, Start</phrase>
    <phrase>Channel</phrase>
    <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\Channel_translations.xml</payloadFromXML>
  </command>
</commandGroup>


Now you can regularly generate the Kodi XML for the "xbmcTvChannels.xml" so that the channel IDs are updated as needed. As long as the Russian channel names don't change, then all this revised command does is:

1. Based on the English channel name you ask for, it will look up the Russian equivalent in your Channel_translations payload XML file.

2. It will then use the Russian channel name to look up the appropriate channel ID value in the xbmcTvChannels.xml file (which you can keep updating as needed).

3. This ID value becomes the {LastResult} that is passed to the Kodi action that navigates to the appropriate channel.
« Last Edit: January 08, 2016, 12:12:24 PM by nime5ter »
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)

eugekiller

  • Jr. Member
  • **
  • Posts: 35
  • Karma: 0
    • View Profile
Re: Kodi Live TV Help
« Reply #8 on: January 08, 2016, 03:44:31 PM »
Thak You So Much worked like a charm :).

Quick question any way to generate xml payload from xbmc by voice command? and to do a hard restart?
« Last Edit: January 08, 2016, 03:51:26 PM by eugekiller »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Kodi Live TV Help
« Reply #9 on: January 08, 2016, 04:31:30 PM »
If you installed one of the standard Kodi configurations in VC, you already have a "Generate XML" voice command.

That default command may use the xJson plugin gen xml action. You should probably replace that one action in the command with the equivalent xSql plugin action.

Instead of posting questions about basic functionality on the forum, you should review all the available actions either in the wiki or in VC's action selection tree.

And also review all the commands in your command tree.

That's generally the best way to get familiar with the many things you can do in VC.

Forum support is really for questions that go beyond the basic information already covered thoroughly in the tutorials and the wiki.
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)

eugekiller

  • Jr. Member
  • **
  • Posts: 35
  • Karma: 0
    • View Profile
Re: Kodi Live TV Help
« Reply #10 on: January 08, 2016, 05:08:33 PM »
Thank you Again.

I was afraid to mess with it since i didnt know what it did exactly. But i got it Thank you again and i am sorry for beeing a pain.

eugekiller

  • Jr. Member
  • **
  • Posts: 35
  • Karma: 0
    • View Profile
Re: Kodi Live TV Help
« Reply #11 on: January 09, 2016, 11:46:25 AM »
One more question anyway i can add switch to next channel?

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Kodi Live TV Help
« Reply #12 on: January 09, 2016, 12:29:57 PM »
What does "next channel" mean in this context?

Kodi's channels are loaded based on the ID they are assigned in the TV database. These don't necessarily relate to their order in the "real" TV world.

As you noted yesterday, the channels change their IDs regularly in the service you use.

There might be another column in the TV database that corresponds to the real-word channel number, and possibly that could be used instead of the channel ID to pick a channel. But as I don't get TV here, I have no way to figure out what the right column label would be.

Maybe other users here can look into it.

For now though:

I can't test these, but you could play around with displaying the TV guide and channel list views in Kodi, and then navigate to different channels on that list using the standard navigation commands "go up"/"go down" & "select" etc.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.4-->
<commandGroup open="True" name="Kodi Live TV guide" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="115" name="Show T V Guide" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>GUI.ActivateWindow</param>
        <param>"window" : "tvguide"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Show TV Guide</phrase>
  </command>
  <command id="117" name="List TV channels" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>GUI.ActivateWindow</param>
        <param>"window" : "tvchannels"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>List TV channels</phrase>
  </command>
</commandGroup>

I used the list of Kodi window names here: http://kodi.wiki/view/Window_IDs, to create the two commands.

I'm not sure exactly what the difference is between a TV Guide and a TV Channel list, but you can experiment with these and other window names identified on that web page.
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)

eugekiller

  • Jr. Member
  • **
  • Posts: 35
  • Karma: 0
    • View Profile
Re: Kodi Live TV Help
« Reply #13 on: January 09, 2016, 02:15:51 PM »
Ok so this is what i have

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.0.9-->
<command id="711" name="Switch to channel {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>PayloadXML.GetValue</cmdType>
    <params>
      <param>XbmcPayloads\xbmcTvChannels.xml</param>
      <param>{1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Player.Open</param>
      <param>"item" : {"channelid" : {LastResult}}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Switch to, Go to, Start</phrase>
  <phrase>Channel</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\Channel_translations.xml</payloadFromXML>
</command>

The payload that it uses doesnt have value so looks like this.

Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>

<!--A VoxCommando Payload file-->

-<PayloadsRoot>


-<payload>

<value>Первый канал HD</value>

<phrase>B One</phrase>

</payload>


-<payload>

<value>Первый канал (Европа)</value>

<phrase>B Two</phrase>

</payload>


-<payload>

<value>Первый канал</value>

<phrase>B Three</phrase>

</payload>


-<payload>

<value>Первый канал (+6)</value>

<phrase>B Four</phrase>

</payload>

so it would have to jump from payload to payload since there is no values is that possible?

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Kodi Live TV Help
« Reply #14 on: January 09, 2016, 02:56:11 PM »
Do you care what channel you go to, when you ask for the "next channel," or do you just want to be able to switch TV channels?

If you don't care about the channel order, but just want to change channels (browse channels), then I think this will work.

I can't really test it.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.4-->
<command id="753" name="Next channel" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>PayloadXML.GetRandomP</cmdType>
    <params>
      <param>XbmcPayloads\xbmcTvChannels.xml</param>
      <param>2</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="True">
    <ifType>(A)==(B)</ifType>
    <ifParams>{Match.1}&amp;&amp;{var.channel}</ifParams>
    <then>
      <action>
        <cmdType>OSD.ShowText</cmdType>
        <params>
          <param>Switching to channel: {Match.1}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>PayloadXML.GetValue</cmdType>
        <params>
          <param>XbmcPayloads\xbmcTvChannels.xml</param>
          <param>{Match.1}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>XJson.Raw</cmdType>
        <params>
          <param>Player.Open</param>
          <param>"item" : {"channelid" : {LastResult}}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>channel</param>
          <param>{Match.1}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>OSD.ShowText</cmdType>
        <params>
          <param>Switching to channel: {Match.2}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>PayloadXML.GetValue</cmdType>
        <params>
          <param>XbmcPayloads\xbmcTvChannels.xml</param>
          <param>{Match.2}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>XJson.Raw</cmdType>
        <params>
          <param>Player.Open</param>
          <param>"item" : {"channelid" : {LastResult}}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>channel</param>
          <param>{Match.2}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <phrase>Next channel</phrase>
</command>
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)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Kodi Live TV Help
« Reply #15 on: January 09, 2016, 03:26:01 PM »
Or you can try "channel up" and "channel down" :

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.4-->
<command id="931" name="Channel {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Based on keymap actions for Kodi found here: http://kodi.wiki/view/Keymap#Commands">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Input.ExecuteAction</param>
      <param>"action":"channel{1}"</param>
    </params>
    <cmdRepeat>{1}</cmdRepeat>
  </action>
  <phrase>Channel</phrase>
  <payloadList>up,down</payloadList>
</command>

These are based on Kodi's PVR keymap actions: http://kodi.wiki/view/Keymap#Commands

If these work, you could explore the list and try creating other commands using other keymap actions for PVR or TV navigation, based on this example.
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)

eugekiller

  • Jr. Member
  • **
  • Posts: 35
  • Karma: 0
    • View Profile
Re: Kodi Live TV Help
« Reply #16 on: January 09, 2016, 05:37:13 PM »
Is there a way to get the current channel that on?

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Kodi Live TV Help
« Reply #17 on: January 10, 2016, 11:13:46 AM »
Apart from all of the various things I explained and suggested that you can experiment with above, you can also browse the 5-page thread that already exists about controlling XBMC/Kodi Live TV to see if any commands meet your needs.

http://voxcommando.com/forum/index.php?topic=1074.0
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)

eugekiller

  • Jr. Member
  • **
  • Posts: 35
  • Karma: 0
    • View Profile
Re: Kodi Live TV Help
« Reply #18 on: January 10, 2016, 12:18:56 PM »
I have been on that page its mostly tv guide info.. Not tv guide with my channels so those commands dont really work i did use some from those areas.

But no where in there have i seen for TTS to say what channel you are on. The tv guide part just tells what show which it gets the info from a web site. As you remember my channels are in Russian and all mixed the hell up. And using not the original payload but a translation of the original payload.

All i want is for it to tell me what channel i am on. And maybe show through the vox addon the channel name also.
The next channel code that you gave me before also dont work cause i am not using the original payload but the translation one so no values there.

This is what i got so far for my Live TV

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.0.9-->
<commandGroup open="True" name="Kodi Live TV" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="711" name="Switch to channel short cut {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>PayloadXML.GetValue</cmdType>
      <params>
        <param>XbmcPayloads\xbmcTvChannels.xml</param>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>Player.Open</param>
        <param>"item" : {"channelid" : {LastResult}}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Switch to, Go to, Start</phrase>
    <phrase>Channel</phrase>
    <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\Channel_translations.xml</payloadFromXML>
  </command>
  <command id="122" name="List TV channels" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>GUI.ActivateWindow</param>
        <param>"window" : "tvchannels"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>List TV channels</phrase>
  </command>
  <command id="769" name="Next channel" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>PayloadXML.GetRandomP</cmdType>
      <params>
        <param>XbmcPayloads\xbmcTvChannels.xml</param>
        <param>2</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="True">
      <ifType>(A)==(B)</ifType>
      <ifParams>{Match.1}&amp;&amp;{var.channel}</ifParams>
      <then>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <params>
            <param>Switching to channel: {Match.1}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>PayloadXML.GetValue</cmdType>
          <params>
            <param>XbmcPayloads\xbmcTvChannels.xml</param>
            <param>{Match.1}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>XJson.Raw</cmdType>
          <params>
            <param>Player.Open</param>
            <param>"item" : {"channelid" : {LastResult}}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.SetVar</cmdType>
          <params>
            <param>channel</param>
            <param>{Match.1}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <params>
            <param>Switching to channel: {Match.2}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>PayloadXML.GetValue</cmdType>
          <params>
            <param>XbmcPayloads\xbmcTvChannels.xml</param>
            <param>{Match.2}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>XJson.Raw</cmdType>
          <params>
            <param>Player.Open</param>
            <param>"item" : {"channelid" : {LastResult}}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.SetVar</cmdType>
          <params>
            <param>channel</param>
            <param>{Match.2}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>Next channel</phrase>
  </command>
</commandGroup>

I have figured out a lot for now with your and james's help. But still missing the next channel previous chanel. And what channel is this.  The list tv channels doesnt list the tv channels from my translation but the 477 channels from kodi.
« Last Edit: January 10, 2016, 12:24:09 PM by eugekiller »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Kodi Live TV Help
« Reply #19 on: January 10, 2016, 12:59:32 PM »
To be clear: Your commands still use the original XbmcTvChannels.xml payload XML file.

If you look at the command itself, you can see that within the command it's still using the XbmcTvChannels.xml file. The other file is just for you, not for Kodi.

There is, I'm sure, a way to get information about the channel you are watching. But as I said before, I don't have live TV so I have no way to figure this out.

I gave you links to 2 different Kodi pages that list a large number of different commands you can use with Kodi. It's Kodi that determines what you can ask for, and what kind of information is returned, not VoxCommando.

I suggested that you go look at the keymaps web page and see if any of the listed actions would be of use to you. Did you try that?

For example, one of them is the "info" key. The Kodi web page describes it as:
Quote
Show the information about the currently highlighted item, or currently playing item.

Maybe that "Info" will show you the channel number and channel name -- I have no idea.

If it doesn't, then you can go ask on the Kodi forums what kind of querying you would need to do to find a channel number -- if it's so important to have the channel number. Or whatever information it is that you want.
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)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Kodi Live TV Help
« Reply #20 on: January 10, 2016, 01:03:06 PM »
The next channel code that you gave me before also dont work cause i am not using the original payload but the translation one so no values there.

I have figured out a lot for now with your and james's help. But still missing the next channel previous chanel. And what channel is this.  The list tv channels doesnt list the tv channels from my translation but the 477 channels from kodi.

As I keep saying, you *are* still using the original payload, if you're using the commands I gave you.

What about the "channel up" "channel down" key map command that I provided yesterday? Does that work? If it does not work, that has nothing to do with the fact that you have an extra payload XML file that translates the channel names. That command doesn't even use those payload XML files.

So, if the channel up / channel down command doesn't work, you should look in your history window or log to see what kind of error message is generated (if any), and let us know what errors you are receiving. That's the only way we can help.
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)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Kodi Live TV Help
« Reply #21 on: January 10, 2016, 03:40:50 PM »
Or you can try "channel up" and "channel down" :

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.4-->
<command id="931" name="Channel {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Based on keymap actions for Kodi found here: http://kodi.wiki/view/Keymap#Commands">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Input.ExecuteAction</param>
      <param>"action":"channel{1}"</param>
    </params>
    <cmdRepeat>{1}</cmdRepeat>
  </action>
  <phrase>Channel</phrase>
  <payloadList>up,down</payloadList>
</command>

These are based on Kodi's PVR keymap actions: http://kodi.wiki/view/Keymap#Commands

If these work, you could explore the list and try creating other commands using other keymap actions for PVR or TV navigation, based on this example.

These commands work perfectly.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Kodi Live TV Help
« Reply #22 on: January 12, 2016, 10:07:21 AM »
All i want is for it to tell me what channel i am on.

You should be able to get the current channel name using the same method that is used to ask what song is playing, what movie you are watching etc.

This should work:

It also shows the channel ID although I'm not sure what use that would be.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.5-->
<command id="544" name="What channel is this" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Player.GetItem</param>
      <param>"playerid":1</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.ParseTokens</cmdType>
    <params>
      <param>You are watching {item.label}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>{LastResult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.ParseTokens</cmdType>
    <params>
      <param>You are watching {item.label} (ID: {item.id})</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>{LastResult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>What channel is this</phrase>
</command>