IR code reader with ESP8266 Wemos D1 mini and ESPHome
Quick step-by-step guide on assembling an IR receiver for reading IR codes from your remotes based on Wemos D1 mini, Wemos IR shield, and using ESPHome.
Components used
- The housing from Broadling RM Pro+
- Wemos D1 mini development board
- Wemos IR shield
- USB to micro-USB cambe
Assembling
First of all, we need to make our shield work with all transmitting LEDs and the pins we need. In this example, we will use D3
for sending and D4
for receiving.
Now lets put the board into the housing with cable connected and glue it all:
Then put the shield on top:
Finally, close the housing:
Using
In ESPHome let’s create a config:
esphome:
name: ir_receiver
platform: ESP8266
board: d1_mini
wifi:
ssid: "WiFi"
password: "************"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "IR Receiver"
password: "************"
captive_portal:
# Enable logging
logger:
level: DEBUG
# Enable Home Assistant API
api:
password: "************"
ota:
password: "************"
remote_receiver:
pin:
number: D4
inverted: true
dump:
- samsung
As you can see it is set up to dump only Samsung-specific codes. You can read more about reading other codes on esphome.io. Also pay attention on logger
section. It is set to DEBUG
level.
Compile, flash, open logs and start firing into our device with your IR remote. You’ll see something like this:
[17:34:48][D][remote.samsung:055]: Received Samsung: data=0xE0E007F8
[17:34:51][D][remote.samsung:055]: Received Samsung: data=0xE0E020DF
You can now use this data with the ESPHome Remote Transmitter component to build, for example, something like this.