What is SmartIR?
SmartIR is a Home Assistant integration that lets you control climate devices, fans, and media players via infrared. It uses a database with thousands of predefined IR codes.Architecture
Required hardware
ED1 Rev 1.0 (recommended)
- IR Receiver: GPIO33
- IR Transmitter: GPIO32 (built-in IR LED)
- Capability: Full RX + TX
ED1 Rev 2.3
- IR Receiver: GPIO35
- IR Transmitter: Not available (requires external module)
- Capability: Receive only
Configuration
1. Install the firmware
Copyed1-smartir-bridge.yaml to your ESPHome directory and compile:
2. Configure pins for your board revision
For Rev 1.0 (edit the YAML file):3. Install SmartIR in Home Assistant
Option A: HACS (recommended)
- Install HACS
- Go to HACS > Integrations
- Search for “SmartIR” and install it
- Restart Home Assistant
Option B: Manual
4. Configure SmartIR
Add the following to yourconfiguration.yaml:
Using the bridge
Capturing IR codes
Method 1: Learn mode (on the device)
- Press the “IR Learn Mode” button in Home Assistant
- Select a slot (0-9)
- Point your remote at the ED1 and press a button
- The code is saved automatically
Method 2: Events in Home Assistant
- Open Developer Tools > Events
- Listen for the
esphome.ed1_ir_receivedevent - Press any button on your remote
- You will see the received code data
Sending IR codes
From HA services
From learned slots
Use the “IR Send Slot X” buttons to send previously saved codes.Available entities
All entity IDs are prefixed withed1_smartir_bridge_.
| Entity | Type | Description |
|---|---|---|
text.…last_ir_protocol | Text | Last detected protocol |
text.…last_ir_code | Text | Last received code |
sensor.…ir_activity_count | Sensor | Received code counter |
button.…ir_learn_mode | Button | Activate learn mode |
button.…ir_learn_stop | Button | Stop learn mode |
button.…ir_send_slot_0 | Button | Send code from slot 0 |
Available services
All service IDs are prefixed withesphome.ed1_smartir_bridge_.
| Service | Description | Parameters |
|---|---|---|
…send_ir_nec | Send NEC code | address, command |
…send_ir_lg | Send LG code | data |
…send_ir_samsung | Send Samsung code | data |
…send_ir_sony | Send Sony code | data, nbits |
…send_ir_rc5 | Send RC5 code | address, command |
…start_learn_mode | Start learn mode | slot (0-9) |
…stop_learn_mode | Stop learn mode | - |
Finding device codes
SmartIR database
Visit smartir.readthedocs.io for the full list of supported codes.Common codes
| Device | Brand | SmartIR code | Protocol |
|---|---|---|---|
| TV | LG | 1060 | NEC/LG |
| TV | Samsung | 1020, 1040 | Samsung |
| TV | Sony | 1010 | Sony |
| A/C | LG | 1060 | NEC |
| A/C | Samsung | 1200 | NEC |
Capturing custom codes
If your device is not in the database:- Use the ED1 learn mode
- Capture each button on the remote
- Note the
addressandcommandvalues - Create a JSON configuration file for SmartIR
Troubleshooting
Not receiving IR codes
- Verify that the RX pin is correctly configured
- Make sure the IR receiver is not obstructed
- Check that the remote has battery
Not sending IR codes (Rev 1.0)
- Verify that the IR transmitter is uncommented in the YAML
- Use your phone camera to check if the IR LED blinks
- Make sure the ED1 is within range of the target device