Hi ejr1283,
you have pieces of code like the one below in the tv example. You can add as many as you wish by copying this code and create a new command name. Instead of "Control.On" you can add yours, for example "Control.Channel.1". You will need to create a new variable holding the infra red command. The example below is using tvRemoteOn variable which is defined at the top of the program.
All the commands can be accessed by a web service and the comments in the code show how it can be accessed. So for the example below you can access it with
http://<hg_address>/api/HomeAutomation.TV/<module_number>/Control.On
If your new command will be Control.Channel.1, it will be accessed by
http://<hg_address>/api/HomeAutomation.TV/<module_number>/Control.Channel.1
// eg. http://<hg_address>/api/HomeAutomation.TV/<module_number>/Control.On
case "Control.On":
Program.RaiseEvent(tvModule, "Status.Level", "1", "TV");
// Send command to Global Cache device to send the required IR code.
globalCacheModule.Command("Control.Send").Set(tvRemoteOn);
break;
Via these web service you can control all your commands from devices such as mobile.
Unfortunately, if you want an interface on homegenie with multiple buttons, I didn't checked on how to do that, so I am not able to help. but for sure it can be done and others will help out.
A neater example of creating a single command for changing all the channels is the following which support parameters. This is an HDMI matrix device command example which has 2 input channels and 4 output channels:
Here is an array with 2 elements representing the input and output channel, defined at the top of the program.
// Define the Global Cache sendir HDMI output/input channel command here. Example hdmiRemoteChannel[1,2] represents HDMI output 1 and HDMI Input 2.
hdmiRemoteChannel[1,1] = "sendir,1:1,1,37650,1,1,341,170,21,22,2....etc";
hdmiRemoteChannel[1,2] = "sendir,1:1,1,37537,1,1,341,170,21,22,2....etc";
hdmiRemoteChannel[2,1] = "sendir,1:1,1,37650,1,1,341,170,21,22,2... etc";
And here is the command to change the channels accepting 2 parameters, the input channel and the output one. In your case you will need only 1 parameter if you want to change tv channels, and this piece of code will need to be modified.
// eg. http://<hg_address>/api/HomeAutomation.HDMImatrix/<module_number>/Control.Remote/<hdmi output channel>,<hdmi input channel>
case "Control.Remote":
string[] values = parameter.Split(',');
int hdmiOutput = int.Parse(values[0]);
int hdmiInput = int.Parse(values[1]);
if ((hdmiOutput == 1 || hdmiOutput == 2) && (hdmiInput >= 1 && hdmiInput <= 4))
{
globalCacheModule.Command("Control.Send").Set(hdmiRemoteChannel[hdmiOutput, hdmiInput]);
Program.Parameter("HDMImatrix.Output" + hdmiOutput.ToString()).Value = hdmiInput.ToString(); // Sets the selected HDMI output to the selected HDMI input number .
Program.RaiseEvent(hdmiMatrixModule, "Status.Level", Program.Parameter("HDMImatrix.Output1").Value + Program.Parameter("HDMImatrix.Output2").Value, "HDMImatrix");
}
break;