-
Notifications
You must be signed in to change notification settings - Fork 637
Adding Custom IR Codes
Max Prokhorov edited this page Oct 23, 2021
·
3 revisions
- Open
code/espurna/ir.cpp
in your favourite text editor - Find the presets location, currently inside of the
::ir::terminal::build::preset()
function - Make a copy of any IR code set, to allow us to modify it. Update the
IR_RX_PRESET
index as well. - Use IRrecvDumpV2 or IRrecvDumpV3 to get IR Codes. You'd get something like this:
Timestamp : 002222.937
Encoding : NEC
Code : FFE01F (32 bits)
Library : v2.3.2
Raw Timing[71]:
10816, - 4494, + 674, - 572, + 674, - 572, + 672, - 572,
672, - 572, + 672, - 600, + 646, - 572, + 672, - 572,
672, - 572, + 676, - 1678, + 668, - 1680, + 666, - 1708,
644, - 1682, + 670, - 1682, + 672, - 1680, + 678, - 1682,
674, - 1682, + 676, - 1704, + 658, - 1680, + 682, - 1682,
686, - 574, + 684, - 574, + 682, - 574, + 744, - 518,
670, - 570, + 668, - 570, + 672, - 572, + 676, - 572,
676, - 1678, + 678, - 1680, + 676, - 1680, + 676, - 1680,
680, - 1682, + 746, - 40008, + 10806, - 2228, + 668
uint16_t rawData[71] = {10816, 4494, 674, 572, 674, 572, 672, 572, 672, 572, 672, 600, 646, 572, 672, 572, 672, 572, 676, 1678, 668, 1680, 666, 1708, 644, 1682, 670, 1682, 672, 1680, 678, 1682, 674, 1682, 676, 1704, 658, 1680, 682, 1682, 686, 574, 684, 574, 682, 574, 744, 518, 670, 570, 668, 570, 672, 572, 676, 572, 676, 1678, 678, 1680, 676, 1680, 676, 1680, 680, 1682, 746, >40008, 10806, 2228, 668}; // NEC FFE01F
uint32_t address = 0x0;
uint32_t command = 0x7;
uint64_t data = 0xFFE01F;
TODO: code example
The uint64_t data
value is useful to us.
- Update the code(s) from the received data
- Don't forget to change the
IR_RX_PRESET' value in the build flags or for the board of your choice in
code/espurna/hardware.h`
If you're looking for support:
- Issues: this is the most dynamic channel at the moment, you might find an answer to your question by searching open or closed issues.
- Wiki pages: might not be as up-to-date as we all would like (hey, you can also contribute in the documentation!).
- Gitter channel: you have better chances to get fast answers from project contributors or other ESPurna users. (also available with any Matrix client!)
- Issue a question: as a last resort, you can open new question issue on GitHub. Just remember: the more info you provide the more chances you'll have to get an accurate answer.
- Backup the stock firmware
- Flash a pre-built binary image
- Flash a virgin Itead Sonoff device without opening
- Flash TUYA-based device without opening
- Flash Shelly device without opening
- Using PlatformIO
- from Visual Studio Code
- Using Arduino IDE
- Build the Web Interface
- Over-the-air updates
- Two-step updates
- ESPurna OTA Manager
- NoFUSS
- Troubleshooting
- MQTT
- REST API
- Domoticz
- Home Assistant
- InfluxDB
- Prometheus metrics
- Thingspeak
- Alexa
- Google Home
- Architecture
- 3rd Party Plugins
- Coding style
- Pull Requests