Use Pearl's wireless universal remote with MQTT

Devices that can only be controlled by infrared are a hurdle for smart homes. The remedy is provided by a WLAN-compatible universal remote control, such as Pearl, which contains an ESP8266.

Pearl's auvisio remote control only works through the cloud and does not provide an API for integration with its own services. Fortunately, you can simply replace the firmware of the box and then gets an MQTT connection, on which you can switch to your heart's content (short test of in c't 19/2019).

Pearl, like many smart home hardware vendors, has bought products from OEM vendor Tuya. Fortunately for hobbyists, the key element of the Tuya smart home universe is the ESP8266. But you do not necessarily have to solder.

Hardware and construction of Tuya infrared boxes are always the same. Unsurprisingly, resourceful developers have already incorporated the sending and receiving of infrared commands into Sonot-Tasmota's alternative IoT firmware.

There are two ways to flash the firmware. The firmware of the box still contains the already well-known security holes that led to the c't featured Tuya-hack. If you follow the instructions for converting Tuya devices, you will have a box afterwards Sonoff-Tasmota 6.5.0. Then read on in the section "Setup".

Alternatively, you can free the box with an ESP programmer from Tuya's firmware. The manufacturer of the box on the board has kindly attached nice big and labeled soldering pads. First, open the case by levering the bottom up with a flat-head screwdriver. On the board you will immediately see the labeled solder pads. Ignore the pair of RX and TX contacts between capacitor and LED ring.

Connect 3V3 and GND accordingly with 3.3 Volt voltage and ground. The data lines TX and RX must be cross-married to the corresponding pins on the programmer. In order for the ESP to change to programming mode, build a bridge between IO0 and ground. The easiest way is with a crocodile clip. After flashing, the bridge must go away again, as the ESP does not start with it.

Then download the current Sonoff Tasmota version down. Then connect the programmer to your PC. With the Esptool the desired firmware lands on the box: write_flash -fs 1MB -fm dout 0x0 sonoff.bin

If you have successfully flashed the ESP, it restarts and you would have to see a new WLAN that starts with sonoff. Connect and call the address in the browser. Enter the access data for your WLAN on the start page. After a restart, you should find the box in the device list of your wireless router. Open the web interface of the box in the browser. Click on "Configuration" and "Configure Module". For "Module Type" select "YTF IR Bridge (62)"And click on" Save ". After restarting the device, enter your MQTT server and any other settings.

Unfortunately, Sonoff-Tasmota does not provide infrared code management, so you have to figure out the codes yourself. In the menu "Console" and via MQTT the box outputs the infrared data. Write down the protocol, the bits and the hexadecimal value behind Data. Only the last one should change depending on the button. If the box does not output any messages via IR signals, it may help to reset the settings and set up the box again.

If you have noted which code belongs to which key, you can also send it out via MQTT. Send a payload to the topic according to the following pattern cmnd/sonoff/IRSend:

{"protocol": "NEC", "bits": 32, "data": 0x20DF10EF}

Replace protocol, number of bits and the hex value with values ​​suitable for your device. The box should then send the command to your device.

Anyone who is unhappy with Sonoff-Tasmota can also do the project ESP8266 HTTP IR blaster use. It was specially developed for the operation of IR transmitters on the ESP and can also store infrared codes. For this the program brings with it a web interface. It can also be paired with Amazon Alexa. For own code there is the library IRremoteESP8266,


This post is from c't 19/2019.

. (tagsToTranslate) IR Remote Control (t) Pearl Auvisio Universal Remote Control (t)