No announcement yet.

Programatically change TV channels

  • Filter
  • Time
  • Show
Clear All
new posts

  • Programatically change TV channels

    Hi Spud,
    I'm trying to do some "follow me" type events with TV channels and trying to get the various Kodi instances to sync them.
    So, I can't use the channel or channel number coupled with easytrigger to set a device to another device - they're status only.

    I'm basically getting the value of an instance (media ID and media type), then using that to control another kodi instance.

    Using the following function, I can't seem to get kodi to actually play a channel:

    hs.PluginFunction("Kodi", "", "PlayerOpenMedia", new object() { 
    devref,"channel",strvalue })
    So, I'm guessing that if I do a kodi action and I have to select player, media type, channel type and channel, that can't be done with the reduced parameters in the function, right?

    Is there any other way to basically "copy" what one instance is playing to another?

  • #2
    I just had a look at this and noticed that the PlayerOpenMedia wasn't working exactly like the "Player Open Media" action. So I fixed a few things related to that in version available in the Beta section of the updater.

    Now you should be able to open a channel using the scripting function like this (in C#):

    hs.PluginFunction("Kodi", "", "PlayerOpenMedia", new object[] { "Player Name",  "channel", 333 });
    where 333 is the DB channel id that you can see if you configure the equivalent event action.

    Is there any other way to basically "copy" what one instance is playing to another?
    There is the "Switch Player" action, which do exactly that, but I think it only works with movies and tvshows


    • #3
      Awesome, updated to the latest beta and my script now works