Next PVR and Node JS as an executable to change channel in Kodi
#1
My STB can be operated via a Node JS script to do things such as change channels, record, access menus etc. My service provider unfortunately will not allow the viewing card to be used with a cam or anything. I am therefore stuck with using a Hauppauge Colossus 2. I am using NextPVR as my PVR backend.

With there being an option available in NextPVR to change channel using an executable, I am wondering if it is possible to point this to my Node JS script in some way. I am an experienced developer, but new to solving this particular sort of problem, so forgive me if I am asking stupid questions.

Thanks
Reply
#2
In the channel settings for the Colossus 2 there should be a set of options for Channel Changer.  In there you'll see a path to an executable and a place for arguments.  I wrote a custom channel changer for a specific IR blaster I use with my HDPVR because the standard one will only send channel numbers and I needed to send other keys too.  So if you write something that can be executed and takes channel numbers as arguments, you can have NPVR use it as a channel changer.

Because I wrote mine in python, mine looks like this:

Executable: C:\Program Files\Python36\pythonw.exe
Arugments: C:\CustomApps\iguana-blaster\execute.py -c {channel}

Hope that helps get you started.
Reply
#3
(2018-05-18, 18:42)pkscout Wrote: In the channel settings for the Colossus 2 there should be a set of options for Channel Changer.  In there you'll see a path to an executable and a place for arguments.  I wrote a custom channel changer for a specific IR blaster I use with my HDPVR because the standard one will only send channel numbers and I needed to send other keys too.  So if you write something that can be executed and takes channel numbers as arguments, you can have NPVR use it as a channel changer.

Because I wrote mine in python, mine looks like this:

Executable: C:\Program Files\Python36\pythonw.exe
Arugments: C:\CustomApps\iguana-blaster\execute.py -c {channel}

Hope that helps get you started.
Hi, thanks for replying. So are you able to pass commands other than channel numbers using your script? Ive got a sky Q box and you can do a lot more than just inputting channel numbers with it.
Reply
#4
My example code would look like this for a channel change:
Quote:ar SkyRemote = require('sky-remote');

// var remoteControl = new SkyRemote('192.168.1.157', SkyRemote.SKY_Q);
var remoteControl = new SkyRemote('192.168.1.157');

// Simple - just send a command
// remoteControl.press('channelup');

// Nice - send commands with a callback
remoteControl.press(['4', '0', '1', 'select'], function(err) {
    if (err) {
        console.log("Woah! Something went wrong. Cry time.");
    } else {
        console.log("I just pressed the Channel Up command.");
    };
});
Reply
#5
(2018-05-20, 16:02)gdogg371 Wrote:
(2018-05-18, 18:42)pkscout Wrote: In the channel settings for the Colossus 2 there should be a set of options for Channel Changer.  In there you'll see a path to an executable and a place for arguments.  I wrote a custom channel changer for a specific IR blaster I use with my HDPVR because the standard one will only send channel numbers and I needed to send other keys too.  So if you write something that can be executed and takes channel numbers as arguments, you can have NPVR use it as a channel changer.

Because I wrote mine in python, mine looks like this:

Executable: C:\Program Files\Python36\pythonw.exe
Arugments: C:\CustomApps\iguana-blaster\execute.py -c {channel}

Hope that helps get you started.
Hi, thanks for replying. So are you able to pass commands other than channel numbers using your script? Ive got a sky Q box and you can do a lot more than just inputting channel numbers with it. 
 You can pass whatever arguments you want to your script, but the only dynamic ones that NextPVR will pass are either the entire channel number (via {channel}) or each individual channel digit (via {channel_d1}, {channel_d2}, {channel_d3}, {channel_d4}).  See:

https://forums.nextpvr.com/showthread.ph...-Arguments

So if you want to send something unique for each channel, you'd have to have a different set of hard coded arguments for each channel.  So it's possible, but it would be kind of a pain if you have lots of channels.
Reply
#6
Thanks again. Is it possible you could either link me to your script or somewhere that has example scripts?
Reply
#7
(2018-05-20, 20:20)gdogg371 Wrote: Thanks again. Is it possible you could either link me to your script or somewhere that has example scripts?
 Try this:

https://github.com/pkscout/iguana-blaster

It's in Python, but at least you'll get a sense of what it's doing.
Reply

Logout Mark Read Team Forum Stats Members Help
Next PVR and Node JS as an executable to change channel in Kodi0