v15 Selecting channel by referencing name/label instead ID
#1
I've been customising an install of Kodi and part of that has been to assign some scripts to keystroke to use in conjunction with a Flirc IR reciever and remote. I came a across an issue where I needed certain buttons (keys) to order the PVR client to select and tune a particular channel, rather than using guide menus or number entry methods:

The issue is that Kodi appears to use a hidden numbering scheme to reference the channels, rather than using the actual numbers you've set up from the backend. (This happens regardless of the settings in the TV options to import all from the backend.)

So the workaround has been to request Kodi to dump its channel information revealing the id's it uses:

Code:
{"id":"Request dump","jsonrpc":"2.0","method":"PVR.GetChannels","params":{"channelgroupid":1}}

Then I have to match up Kodi's IDs to the correct external channel name/number, and reference that in my script, eg. channel ID 177:

Code:
{"id":"Select channel","jsonrpc":"2.0","method":"Player.Open","params":{"item":{"channelid":177}}}

The problem is that I've found that sometimes, like when altering the channel list and order, or on a retune, on the backend, when Kodi imports the channels, these IDs change. This renders the previous mappings for my scripts useless, and requiring updates of every referenced channel.

Unable to find an answer in my searching, my question is, is there a command available through JSON-RPC to tell Kodi to select the channel not by the "channelid", but by the "name"/"label" instead, since these don't change?



Version: Kodi 15 Isenguard
Interface: Mimic skin
Backend: MediaPortal TV Server with MediaPortal PVR Client (latest versions)
Platform: Windows 10
Reply
#2
same problem, using tvheadend
Reply

Logout Mark Read Team Forum Stats Members Help
Selecting channel by referencing name/label instead ID0