Webpage IR codes using the Device Manager
|Top Previous Next|
For this to work we first need to setup a IR Devices, device. The has a few steps.
1.Enable the IR Devices Plugin on the File->settings->plugins
2.Go to the Device Manager (View->Devices)
3.If not already there add a IR Devices Component ( Edit->Add Component, select the IR Devices plugin)
4.Click on the IR Devices component
5.Add a new Device, (Edit->Add Device) any name you like.
6.Click on that newly created device
7.Either manually add controls and learn IR codes or import from web.
Now that we have controls defined in our newly created device, click on the control you wish to trigger from your web page. In the status bar you should see the ID of this control. For example "Control 8". That means we can use the id 8 as a reference to this control. This ID is stored in a disk database and is the same even after reboots. The only time it changes is when you delete the control or device.
Create the HTML file.
As before we'll assume that you have some understanding of HTML. Create this HTML file in the httpd directory of Girder. Name it control.html
There are two parts that are interesting in there. The first is the loading of the device manager helper functions.
The second part actually presses the virtual control button. Note the first parameter to "requestControlValueChange". It has value 8. This is the id of the control. We found the value early by clicking on the control we like to control and reading it's value in the status bar.
Making it dynamic ( ADVANCED )