The new Sonoff DualR3

Got this working today, just power metering is still an issue.

Working:

  • Both relay’s
  • Both switches
  • Button
  • Status LED

Not working:

The actual power metering chip on the DualR3 is the CSE7761 which is not supported by esphome yet.

The config below and more information on our website:
The new Sonoff DualR3 is here! - espthings.io

If anyone knows how to get the power metering working, please leave a comment here or on the website!

Thanks :slight_smile:

esphome yaml:

substitutions:
  devicename: sonoff_dualr3
  long_devicename: Sonoff DualR3

esphome:
  name: $devicename
  platform: ESP32
  board: esp32dev

wifi:
  ssid: !secret esphome_wifi_ssid
  password: !secret esphome_wifi_password
  power_save_mode: light
  ap:
    ssid: $devicename
    password: !secret esphome_ap_password

captive_portal:
  
api:
  password: !secret esphome_api_password

ota:
  password: !secret esphome_ota_password

web_server:
  port: 80

logger:
  baud_rate: 0

# remove # below to enable ble tracking
#esp32_ble_tracker:

uart:
  rx_pin: RX
  baud_rate: 4800

sensor:
  - platform: wifi_signal
    name: "WiFi Signal $long_devicename"
    update_interval: 60s
  - platform: cse7766  #The actual chip on the DualR3 is a CSE7761, no driver available yet!
    update_interval: 5s
    current:
      name: "$long_devicename Current"
    voltage:
      name: "$long_devicename Voltage"
    power:
      name: "$long_devicename Power"
      id: power
      on_value_range:
        - above: 1.0
          then:
            - logger.log: "$long_devicename Power above 1.0A"
        - below: 1.0
          then:
            - logger.log: "$long_devicename Power below 1.0A"

output:
  - platform: gpio
    pin: GPIO27
    id: relay1
  - platform: gpio
    pin: GPIO14
    id: relay2

switch:
  - platform: output
    name: "$long_devicename - relay 1"
    output: relay1
    id: sw1
  - platform: output
    name: "$long_devicename - relay 2"
    output: relay2
    id: sw2

status_led:
  pin:
    number: GPIO13
    inverted: yes

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
      inverted: True
    name: "$long_devicename button"
    on_press:
      - logger.log: "$long_devicename button"
      - switch.toggle: sw1
  - platform: gpio
    pin:
      number: GPIO32
      mode: INPUT_PULLUP
      inverted: True
    name: "$long_devicename switch 1"
    on_press:
      - logger.log: "$long_devicename switch 1"
      - switch.toggle: sw1
  - platform: gpio
    pin:
      number: GPIO33
      mode: INPUT_PULLUP
      inverted: True
    name: "$long_devicename switch 2"
    on_press:
      - logger.log: "$long_devicename switch 2"
      - switch.toggle: sw2
4 Likes

There is an API available now:
http://developers.sonoff.tech/sonoff-diy-mode-api-protocol.html

That’s great news for people who rather not solder wires to their devices (like me) :wink:

There is also this : https://github.com/AlexxIT/SonoffLAN

Nah, all my devices are in esphome, so the Dual must be no exeption :sunglasses:

1 Like

This device is a ESP32 and having BT as well used I guess only at first pairing.
I did some tests with a momentary switch with the ewelink application. It works good.
This is what I need because all my house switches are momentary. Some of them have a “pilot light” in 230v on it. Now, I’m trying SonoffLAN with or without the need of external cloud.
What is the advantage of esphome VS tasmota VS official firmware with DIY method ?

Well with the original firmware you are limited to whatever functionality that offers. Using esphome you can config it however you want, even use bluetooth.

Does it still have the two sets of headers inside like the R2? They were invaluable for my latest project

It’s all in the article: The new Sonoff DualR3 is here! - espthings.io

Some more informations from this post on tasmota: https://github.com/arendst/Tasmota/discussions/10793

More info on this cool little switch - https://youtu.be/VT6bY-iSveI

Great video!

Let’s hope esphome will support the CSE7761 rather sooner then later :slight_smile:

Not as many hoops for iBeacon on the Esphome side so definitely!

Any updates regarding the power measurement?

1 Like

It works great with tasmota

Hello all,

The new SonOFF DualR3 is using BL0939 cip, and for the moment this is not supported.

https://datasheet-pdf.com/PDF/BL0939-Datasheet-ShanghaiBelling-555458

Tasmota supports this cip, and probably support in ESPHome will be added.

Dons anyone have any news regarding this cip.

I have a couple of these and they use the CSE7761platform for power measurement in Esphome. Are you saying current ones have a different chip ?

Yes, there is a request for bl0930 support

And also here:

Oh right thanks I’ll bear it in mind if I get any more.

hello I think the CSE7761 sensor is now available in Esphome, have you integrated it into the firmware? I also have all Esphome and I should get a sonoff dual r3 to use it on led bars. my intent is to remove a relay and put in its place an irlz44n MOSFET to be able to dim the bar in DC 12v, and the on-board relay that remains to disconnect the power supply automatically when everything is off.