esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
417 stars 26 forks source link

Support for the CSE7761 (as found in the Sonoff DualR3) #1151

Closed HA-TB303 closed 2 years ago

HA-TB303 commented 3 years ago

Describe the problem you have/What new integration you would like Please add support for the CSE7761 power metering

Please describe your use case for this integration and alternatives you've tried: CSE7766 is supported, but the Sonoff DualR3 uses CSE7761

Additional context More info: https://github.com/kakopappa/CSE7761 http://www.chipsea.com/gongsixinwen/jishu--zhinengdianqiloudianbaohuzheyangshejigengka.html https://github.com/arendst/Tasmota/discussions/10793 https://community.home-assistant.io/t/the-new-sonoff-dualr3/286682 https://git.koehlerweb.org/frodovdr/Sonoff-Tasmota/commit/690df69c9184a1426033d39784aa00f15d3f476d

If I need to test anything, just give me a ping ;)

HA-TB303 commented 3 years ago

It's done in tasmota: https://github.com/arendst/Tasmota/blob/development/tasmota/xnrg_19_cse7761.ino#L24

Drew765 commented 3 years ago

Seconding support. Happy to assist with testing/logging requirements.

lednicazar commented 3 years ago

Will be great, having the DualR3 working in esphome with the power meter will be an awesome thing

alimnette commented 3 years ago

hello, i need this feature too. 👍🏼

tazginpax-ho commented 3 years ago

I would really love to get this in ESP Home rather than Tasmota

MattXcz commented 3 years ago

It would help a lot... thanks @OttoWinter

MattXcz commented 3 years ago

Is it also posible to add Sonoff DUALR3 temperature reading

Drew765 commented 3 years ago

Where is the temp sensor?

MattXcz commented 3 years ago

I dont know, but it shows CPU temperature in Tasmota...maybe it is part of CSE7761 ?

wouterbouvy commented 3 years ago

I dont know, but it shows CPU temperature in Tasmota...maybe it is part of CSE7761 ?

It's part of the ESP32 chip, but feature request to read this temperature in ESPHome have not been picked up since there are different versions of the ESP32, some without temperature sensor.

MattXcz commented 3 years ago

Ok, understood. Maybe there can be Sonoff DualD3 as dev board defined, with this feature. For me this temperature readings are important, since i plan running this in the attic...

SvbZ3r0 commented 3 years ago

I've got a spare and would like to help bring full support for the device. What can I do?

berfenger commented 3 years ago

I just published an external component to support the CSE7761 serial sensor. Here is an example: https://github.com/berfenger/esphome_components/blob/main/example_sonoff_dual_r3_v1.yaml

Let me know if it works for you because I'm planning to issue a merge request to the esphome mainline.

Drew765 commented 3 years ago

Will definitely try this out & let you know. Thanks!

eduperez commented 3 years ago

@berfenger I tried your component, the entities show on HA, but the state is stuck on "unknown" for all of them. Perhaps my device is an incompatible version; how can I know which version of the device do I own? Thanks!

berfenger commented 3 years ago

@eduperez You can check the hardware version on the back side of the PCB. It should have a text like "DUALR3-POW V1.6". V2 has a different chip and does not work with this component.

MattXcz commented 3 years ago

For me, it works perfectly :) Thank you

eduperez commented 3 years ago

@berfenger The devices are already installed, and in a hard to reach place, can't this be checked remotely?

SvbZ3r0 commented 3 years ago

I just published an external component to support the CSE7761 serial sensor. Here is an example: https://github.com/berfenger/esphome_components/blob/main/example_sonoff_dual_r3_v1.yaml

Let me know if it works for you because I'm planning to issue a merge request to the esphome mainline.

Works perfectly for me. I even cross checked the voltage readings with my multimeter, just to be sure.

I'm guessing your driver is good to go for the mainline PR.

berfenger commented 3 years ago

@berfenger The devices are already installed, and in a hard to reach place, can't this be checked remotely?

I'm afraid it cannot be checked via software. The only difference between v1.x and v2.0 is the power consumption sensor, so I would assume your devices are v2.0.

I will try to buy a device from the sonoff official store hoping they send me an updated version and implement a driver/component for the new sensor. But I can't promise anything.

Drew765 commented 3 years ago

The v2.x is merged in Tasmota already I think. You could use that for the time being maybe? I wish I could help, but I've just started learning this stuff so I can contribute in future.

skarcha commented 3 years ago

Works perfect for me as well. It's running fine for five days without problems.

Thanks!

wouterbouvy commented 3 years ago

@berfenger Are you still planning on opening a PR to mainline this in to the ESPHome core?

berfenger commented 2 years ago

@berfenger Are you still planning on opening a PR to mainline this in to the ESPHome core?

Yes. I hope I can do it in the next few days.

autox86 commented 2 years ago

@berfenger Too cool that you added this component. Together with the new current bases cover, it would provide me finally an accurate control about my cover.

Anyway, tomorrow I get 15 dual r3. If they are v2, I would love to provide you one for free, if you could take care of the new power sensor. :)

SvbZ3r0 commented 2 years ago

Thank you @berfenger

autox86 commented 2 years ago

@berfenger I received my DualR3 now in Version 1.6. So it doesn't make sense to send you one, unfortunately.

Anyhow, I am supprised, DUAL R3 does not fit in a standard wall-mount (EU), it is slightly to big... :(