Page 1 of 1

Sonoff Dual-R3 V2.0 with BL0939

Posted: 07 Jan 2024, 11:40
by Micha_he
Any news/help, to get the 2-channel power measurement-chip BL0939 of the Sonoff Dual-R3 V2.0 to work with Espeasy?

IMG_20240105_234425438_HDR.jpg
IMG_20240105_234425438_HDR.jpg (732.42 KiB) Viewed 35856 times

Re: Sonoff Dual-R3 V2.0 with BL0939

Posted: 07 Jan 2024, 12:16
by TD-er
Hmm so far I only found a Chinese datasheet.
At first glance it seems like it may be a mixture of both P076_HLW8012 and P077_CSE7766

As in it does use serial (like P077), but there's also mention of CF like pins to switch between voltage/current measurements. (like P076)

I did see Google mentioning ESPHome seems to support it (not yet looked at it), but it is quite a lot of work to "convert" ESPHome code to ESPEasy code as they often leave out quite a lot and focus on using a lot of core components in the ESPHome code.
Don't get me wrong as that's a perfectly fine way of coding, but since I'm quite unfamiliar with the ESPHome code base, it may take quite a lot of work to "convert" it.

Re: Sonoff Dual-R3 V2.0 with BL0939

Posted: 07 Jan 2024, 12:19
by TD-er
Hmm on another site I found an English "datasheet" which is more like a summary of features and this one mentions it has I2C interface.

So I guess when this will be supported, it must probably have its own plugin. :(

Re: Sonoff Dual-R3 V2.0 with BL0939

Posted: 07 Jan 2024, 15:01
by Micha_he
What I've read is, that the BL0930 the i2c and the BL0939 is the UART-variant.

https://evelta.com/content/datasheets/3 ... SOP16L.pdf

But plugin 076 & 077 doesn't read anything.

Re: Sonoff Dual-R3 V2.0 with BL0939

Posted: 07 Jan 2024, 16:22
by TD-er
I would really be surprised if those would work, as P076 is absolutely not UART and P077 is using very specific way to decode any data.
Also I don't know which pins are connected to the ESP.

Re: Sonoff Dual-R3 V2.0 with BL0939

Posted: 08 Jan 2024, 10:31
by Micha_he
I will try to determine the pin configuration (BL0939 <-> ESP32) on the existing hardware.

I'm also going to give Tasmota a chance... ;)


Edit - Here is a summary of the complete pin assignment:

Code: Select all

GPIO  0 = Button1 (OnBoard)
GPIO  4 = BL0939 ZX (Zero Crossing)
GPIO 13 = WLan-Led
GPIO 14 = Relay2
GPIO 25 = BL0939 Tx
GPIO 26 = BL0939 Rx
GPIO 27 = Relay1
GPIO 32 = Switch1
GPIO 33 = Switch2

Re: Sonoff Dual-R3 V2.0 with BL0939

Posted: 19 Jan 2024, 11:04
by Micha_he
Can someone help me, to port this BL0939 tasmota plugin code to an espeasy-plugin.

I can done tests and if necessary, I could also send a DualR3 V2 by post for testing.

The Sonoff DualR3 V2 works under Tasmota, but I love the EspEasy interface and how easy it is to use the rules. ;)

Re: Sonoff Dual-R3 V2.0 with BL0939

Posted: 19 Jan 2024, 12:00
by Ath
This subject is drowning somewhere in my "things I'd like to fix in ESPEasy" list (that's an actual list, but I just did not call it my TODO list...) :lol:

Re: Sonoff Dual-R3 V2.0 with BL0939

Posted: 19 Jan 2024, 12:07
by TD-er
Maybe just create an issue for it, so it is more like an actual todo list :)