How to wire the Sonoff Dual R3 to use it in MQTT with home automation

We continue our time with the DIY home workout and usually accepted by modules Sonoff. We have already seen a guide on the Sonoff NSPanel, this popular smart touch switch has become more interesting and smart with electricity to Tasmotat. We know how to go about it Tasmoth can be driven directly into it MQTT with the home automation systemsa more interesting and valuable means of communication than theSonoff API He owns the right now, but must go to the world to control his creations.

With tools under the tasmota firmwarewe use the full capabilities of the product in the local network, especially in some cases, but we also free ourselves from this reliance on the cloud for local management, fast and very reliable, for We use the best. MQTT protocol.

Let’s see another interesting feature with this double relay module Sonoff Dual R2 therefore giving 2 relays but food inspectionall over a price range under 20 € (except notice). A more interesting module, which immediately finds its place in a home automation system that has already started Tasmoth. So let’s see how to do it easily.

List of necessary items

To make this electricity, you need to have some electrical equipment. There is no major purchase or reuse for other modules, because we have had time to find out and others to come. Then you can follow one of our previous guides and be equipped, if not, here is the list of equipment to get before starting:

Wire Jumper Wire 3 x 40 pcs Each 20 cm, Dupont Breadboard Cable 3 in 1, Male to Female, Male…

6,99 €

Have got

updated September 19, 2022 6 h 25 min

AZDelivery FT232RL Adapter, RXD/TXD Transceiver Communication Indicator, Module…

AZDelivery FT232RL Adapter, RXD/TXD Transceiver Communication Indicator, USB to TTL 3.3V 5.5V Converter Module Compatible with Arduino and Raspberry Pi with E-Book!

8,49 €

Have got

3 more at €8.49

updated September 19, 2022 6 h 25 min

Yosoo Health Gear 10 Piece 50cm Insulated Alligator Clip Lead Set, 50cm Insulated…

Yosoo Health Gear 10pcs 50cm Insulated Alligator Clip Lead Set, Wire Test Clips for Electronics, Component, Automotive Test Connection

8,94 €

Have got

updated September 19, 2022 6 h 25 min

Electric Cooker, 60W Electric Cooker Adjustable 200~450℃ with…

Iron Kit, 60W Electric Iron Adjustable Temperature 200~450℃ with ON/OFF Switch, 5PCS Electric Iron, Wire Pliers, Pliers, Tweezers(Black)

14,89 €

Have got

updated September 19, 2022 6 h 25 min

Last published on September 19, 2022 6 h 25 min

Presentation of the Sonoff Dual R3 module

The Sonoff Dual R3 relay module is an interesting and simple device that can independently control two electric lights and measure the use or control of a closed circuit breaker. For less than 20 € it is the home automation module that forces you to be interested in it, especially when you know that it can be used with the home automation system, all in MQTT and without relying on the cloud to as we wish. see here.

But if you don’t choose flash, this module is interesting. If you have a Sonoff Mini or original module for example, this Dual R2 has successfully replaced them, adding the ability to manage a new circuit with a second relay, but also for monitoring the food of two cars.

If you do not choose to modify Tasmotat as we describe here, the module is fully integrated with the power from a home automation system such as Jeedom or Home Help, you must install the plugin (Jeedom ) or integration (home help) as we explain in our guide found on the blog.

Home Assistant and Sonoff Wifi: How does it work?

Home Help and Sonoff Wifi: How does it work?

If Sonoff has been very successful with its range of Zigbee home automation technologies. 3.0. Historically, the brand has positioned itself well for home automation devices that work over wifi. Along with…


Preparing the Sonoff Dual R3 module for Tasmota electronics

Before replacing the electronics, you must remove the module, to do this, use a small screwdriver and tighten the parts shown below. There are 4 places (two on each side) in order to open the two parts of the Sonoff Dual R3 case.

Once opened, the electronic card must be extracted from the case. You just need to pull lightly on it and you’re done. Outside of its housing, you will find the necessary ports for electricity to be found under the electronic card of the module. The ports we need are 3v3, gnd, TX0 and RX0.

Then it is necessary to use electrical connection cables with a male end and a female end. 4 in number, sell them on the shelf.

Another option is to use specific alligator clips as mentioned in the list of tools, with this method you don’t have to do the sales if you are not comfortable with iron ore not supplied.

Note that if you use the alligator clip style, you will see dirt on the left side of the board.

Wired with FDTI

Now that we have made the connection on the Sonoff Dual side, we need to connect the other ends of the cables to the FDTI module.

Again, nothing too complicated, just follow the guide below:

Sonoff Dual R3 FDTI
3V3 VDC
DND GND
RX0 TX
TX0 X-ray

Check, the voltage and connection of the module must be carried out only to the FDTI, it must not be connected to the 230V.

Finally, the FDTI module has two modes of operation for VCC (5V and 3.3V), the voltage must be generated at 3.3V, then make sure that the jumper is correctly installed on the module by as shown below.

The connection is made, you can connect the USB cable of the FDTI module to the PC, then the blue light of the Sonoff Dual R3 will start, before flashing, you need to change the module to the GPIO mode. Fortunately, Sonoff has designed everything, you just need to press and hold the button with a screwdriver. The LED turns solid blue, the module is ready for power-up under Tasmota.

Flash under ESP Flasher in two clicks

  1. Download the necessary files to flash under Tasmota:
  • Esp-flasher program
  • tasmota32.bin firmware

2. Start the ESP-Flasher program, select the communication port created by the FDTI, then point to the downloaded firmware before starting the flash with the button. Flash ESP

3. After a few seconds, the lines roll and get 100%, the Sonoff Dual R3 module is illuminated under Tasmota, we can separate the module and finish the wires before connecting case and reconnect 230V.

Sonoff Dual R3 Setup

When connected to the home’s wireless network, the module under the Tasmota firmware relaunches a Wi-Fi hotspot tasmota -xxxxx-xxxxx, open your Wi-Fi connection to find the network and connect to it .

A new page should immediately open on your PC inviting you to select the Wi-FI network to which you want to connect your Sonoff relay module under Tasmota. Show the Wi-Fi network and password and then confirm.

The Sonoff Dual R3 will reboot and show the next page. Now that you are connected to the module, it is directly connected to your local network.

Now enter the menu Arrangement attach the first configuration, the Template of the module. You may have seen it on the main page of the module under Tasmota, we do not have the position of the relays, nor the user information. To do this, we need to install the template module. Under Configuration, go to Settings Set the example.

And so on configureOther.

Then copy the code from the following equation:

{"NAME":"Sonoff Dual R3","GPIO":[32,0,0,0,0,0,0,0,0,576,225,0,0,0,0,0,0,0,0,0,0,7296,7328,224,0,0,0,0,160,161,0,0,0,0,0,0],"FLAG":0,"BASE":1}

Then paste this code in the model field of the Tasmota menu before verifying without changing anything else.

The module restarts and you return to the home page, you have all the information you need for the module to work properly!

Fill in the configuration with the information needed to work with MQTT. As in the screen below, show the IP address of your MQTT broker, then the indicators if you have them. Give a name to the theme of the module and change the full theme as shown to make it easier to organize your Sonoff modules under the same theme.

With a small key of the MQTT explorer you see your module shown immediately after saving the configuration, we are done with the configuration of the module, it is ready to communicate with the Home Assistant or Jeedom home automation.

To control the module, it is necessary to use the MQTT cmnd channel as in the example below to control relay 1.

Use with Jeedom home automation

To use this module with Jeedom home automation, several solutions are possible. Normally, I use the ZigbeeLinker plugin which has the advantage of doing the commands for you. But you can do it manually with Jmqtt. For example, work orders on relay 1 of the module.

Use with Home Assistant home automation

On the Home help page, there is a direct Tasmota connection, you need to use secure access through an account on your MQTT.

When the MQTT configuration is done on the module, it immediately goes up to the Tasmota connection. ON/OFF functions on both relays add to your dashboard.

But all the user experience is because it is a reminder, the Sonoff Dual R3 allows you to control two electric motors, but also monitor the use of both motors.

The end

The Sonoff DUAL R3 module is truly a home automation module. The electricity under Tasmota turns it into two MQTT relays that can measure the use of both circuits, for only 19 €.

Leave a Comment