#BLUEHASH
← All tutorials
Beginner20 min

Turn BLUEHASH into a universal TV remote

irnvsremote

What you will build

A TV remote that captures IR codes from your existing remote and replays them. Power, volume up/down, mute — whatever buttons you want. Codes are saved to NVS flash and survive reboots.

1. Add IR Receive node

Drag an "IR receive" node onto the canvas. Set pin to 14 (the IR receiver pin). The timeout default of 15ms is fine.

pin: 14 timeout: 15

2. Add IR Send node

Drag an "IR send" node. Set pin to 4 (the IR transmitter LED). Leave protocol as NEC for now — most TVs use NEC.

3. Capture a code

Connect Button Press (OK port) → IR Receive (listen port). Connect IR Receive (received port) → NVS Store. Set the NVS key to "tv_power". Point your TV remote at the BLUEHASH IR receiver and press OK. The code is captured and saved.

4. Replay the code

Connect Button Press (Up port) → NVS Read (trigger port). Connect NVS Read (value port) → IR Send (code port). Set the NVS key to "tv_power". Press Up on BLUEHASH — it reads the saved code and fires the IR LED.

5. Add a menu for multiple codes

Replace the direct button connections with a Menu node. Add options: "Power", "Vol+", "Vol-", "Mute". Each option connects to a different NVS Read → IR Send chain with a different key.

Next steps

Completed this tutorial? Try connecting your flow to WiFi, adding MQTT, or browsing the community library for drop-in programs.

More tutorialsBrowse library