This is a quick tutorial on how to create a new Infrared (IR) device for homey. Which unfortunately is not as simple as it should be due to bugs in the tools section of homey.
This tutorial is for people who are comfortable creating homey apps, or capable to follow the instructions provided by athom.
In most cases you should always attempt to find your IR device using the generic built in approach. (Add device → Homey → IR → Search for your device).
However if your device is not available, it is still possible to create an application with the IR codes you require.
Step 1 - Figure out the IR codes
You may be lucky and the codes you require are publicly available, however if they are not, you will require an IR receiver to capture the codes. Older Homey Pro devices have an IR receiver inbuilt into them. (HP16, HP18, HP19). The Homey Pro 2023 (HP23) does not have an IR receiver.
To capture the codes, I used a HP18.
- Turn of the spectrum LED on the device, old anecdotal evidence mentioned this can help.
- Goto the RF signals (not IR) tools section (Homey Developer Tools)
- Change the record method to Infrared, hit record - point single quick click the remote at the homey device.
- You will now have the IR code output of the button press.
Step 2 - Convert the signal.
Note that the Emulate IR code in the tools, doesn’t actually work meaning we have to jump through a bunch of additional hoops in order to test that we recorded the right signal.
The Prontohex testing option on the tools page does work, however in order to use it we have to convert the code we now have to the right format.
- Download IrScrutinizer (2.4.0) and installed it (IrScrutinizer – AppImages)
- Goto the export tab, and select Pronto Hex.
- Copy the IR code we created in Step 1 to your clipboard.
- With in IrScrutinizer on the Scrutinize tab, press the “Paste & Scr” button.
- Hit the export button.
- Open the file the code was exported to.
Step 3 - Test the signal.
- Goto the homey tools area, this time with in the IR page. (Homey Developer Tools)
- Paste the Hex codes you exported, and hit the Send key.
- Your device should now action the command as if it received it from the remote.
Step 4 - Create the app.
- Create the app as per the recommendations by Athom. (Getting Started - Homey Apps SDK)
- Add a new IR driver as per the recommendations by Athom (Infrared - Homey Apps SDK)
- Ignore the section titled “signal definition” and instead create a signal file which uses the protohex format defined on the page.
{
"type": "prontohex",
"cmds": {
"POWER": "0000 0073 0000 000D 0020 0020 0040 0020 0020 0020 0020 0020 0020 0020 0020 0020 0020 0040 0020 0020 0020 0020 0020 0020 0020 0020 0020 0020 0020 0CA4",
"MIST": "0000 0073 0000 000C 0020 0020 0040 0020 0020 0020 0020 0020 0020 0020 0020 0020 0020 0040 0020 0020 0020 0020 0020 0020 0040 0040 0020 0CA4"
}
}
- Match up the pronothex commands with your capabilities with in the device.js
class MyDevice extends RFDevice {
static CAPABILITIES = {
'button.power' : 'POWER',
"button.mist": 'MIST',
}
}
Step 5 - Publish the app
- Follow the requirements to create a working app, and publish Publishing - Homey Apps SDK