Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

after 2023.5.1 there are no more data readings for sonoff R3 pow origin #4529

Open
calas80 opened this issue May 22, 2023 · 18 comments
Open

Comments

@calas80
Copy link

calas80 commented May 22, 2023

The problem

I have been using this code for a long time and it has always worked. After the update, I no longer receive current, voltage and power data.

Which version of ESPHome has the issue?

2023.5.1

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2023.5.3

What platform are you using?

ESP32

Board

Sonoff POW ORIGIN (R3)

Component causing the issue

No response

Example YAML snippet

uart:
  rx_pin: GPIO16
  baud_rate: 4800

################################################
#        Sensor
#########################
sensor:
  - platform: uptime
    name: "${esp_devicename} Uptime"

  - platform: cse7766
    update_interval: 5s
    current:
      name: "${esp_devicename} Corrente"
    voltage:
      name: "${esp_devicename} Voltaggio"
    power:
      name: "${esp_devicename} Power"
      id: power
    energy:
      name: "${esp_devicename} Energy"
      id: energy
      icon: mdi:chart-line

Anything in the logs that might be useful for us?

No response

Additional information

No response

@branda92
Copy link

branda92 commented May 23, 2023

I too have the usual problem, which continues to be present even with 2023.5.3

@itssimon
Copy link

Same problem here with a Sonoff POW Elite

@ModuCZ
Copy link

ModuCZ commented May 28, 2023

Same here

All of my Sonoff POW Origin (esp32) stopped working after update. Platform cse7766 doesn't provide any readings.
Suprisingly Sonoff POW R2 (old version of ORIGIN) is still working (althought it's cse7766 too).

ESPHome 2023.5.3

@ModuCZ
Copy link

ModuCZ commented May 28, 2023

ESPHome 2023.5.4 didn't fix this issue for me.

@ModuCZ
Copy link

ModuCZ commented May 28, 2023

This issue is present since ESPHome 2023.5.0 - tested by downgrading .

Temporarily fixed by downgrading to ESPHome 2023.4.4 and updating all of my devices without code change.

@mspiridakis
Copy link

mspiridakis commented Jun 3, 2023

Same here with sonoff powr320d (Esphome 2023.5.5).
The issue is related to ESP32. I have multiple sonoff POWR2 (CSE7766 Power Sensor) that work like a charm with version 2023.5.5

@CarlosGS
Copy link
Contributor

CarlosGS commented Jun 3, 2023

Edit: The issue seems to be related to newer Sonoff POW (Elite, powr320d) with ESP32.

@CarlosGS
Copy link
Contributor

CarlosGS commented Jun 3, 2023

The only related change I can see is esphome/esphome#4762

Maybe the problem is that the UART is not being referenced with an ID, and that PR caused it to fall back to the standard UART port (?)

Can you try assigning a specific ID to the uart? like this:

uart:
  rx_pin: GPIO16
  baud_rate: 4800
  id: pm_uart # Assign ID to UART for power meter

################################################
#        Sensor
#########################
sensor:
  - platform: uptime
    name: "${esp_devicename} Uptime"

  - platform: cse7766
    uart_id: pm_uart # Select power meter's UART
    update_interval: 5s
    current:
      name: "${esp_devicename} Corrente"
    voltage:
      name: "${esp_devicename} Voltaggio"
    power:
      name: "${esp_devicename} Power"
      id: power
    energy:
      name: "${esp_devicename} Energy"
      id: energy
      icon: mdi:chart-line

Also, since the change only was implemented for Arduino, you can try using esp-idf platform and see if the issue is present.
I don't have a newer Pow R3 (ESP32) so can't help much more.

@mspiridakis
Copy link

mspiridakis commented Jun 3, 2023

Thanx for the time and help @CarlosGS.
First suggestion was a good bet, but unfortunately it didn't work.
The second one needs a lot of changes in my yaml file since I have a lot of bells and whistles there.
I tried debugging the uart, there are bytes coming through that resemble the output of cse7766 but the sensor isn't picking it up.

UPDATE: I tried the esp-idf platform both with the uart_id and without it. It didn't work. So there must be something else.

UPDATE #2 : Found a workaround! For some reason that is beyond my level of knowledge, esphome must communicate through UART1 not UART0. The only way to do this according to the mentioned change esphome/esphome#4762 is to define a "dummy" uart and a proper one like so:

logger:
  level: DEBUG
  baud_rate: 0

uart:
  - rx_pin: GPIO3
    baud_rate: 4800
    id: dummy_uart  # Will end up being assigned UART0
  - rx_pin: GPIO16
    baud_rate: 4800
    id: active_uart  # Will end up being assigned UART1

sensor:
  - platform: cse7766
    uart_id: active_uart # Select power meter's UART

And now it works! (but it is messy). It has to be a simpler way to be able to access the desired UART without this.
Lets hope it gets fixed soon.

It must also be said that voltage is not correct when the relay is off. It shows ~ 14 - 17 V when it should show ~235V.
I suspect though that this is not esphome's fault.

@calas80
Copy link
Author

calas80 commented Jun 5, 2023

anyone have any news? it is really disastrous not to receive the data

@mspiridakis
Copy link

anyone have any news? it is really disastrous not to receive the data

Try to use the workaround above. In the meantime lets hope @spectrumjade will have a look at it again.

@calas80
Copy link
Author

calas80 commented Jun 6, 2023

I didn't see your previous reply. Thank you

@mspiridakis
Copy link

mspiridakis commented Jun 6, 2023

Just found out that it also works with a simpler manner commenting out the "baud_rate" line, without using ids, so:

logger:
  level: DEBUG
  #  baud_rate: 0

uart:
  - rx_pin: GPIO16
    baud_rate: 4800

sensor:
  - platform: cse7766
    ...
    ...
    ...

@ModuCZ
Copy link

ModuCZ commented Jul 10, 2023

Issue still present in ESPHome 2023.6.5.

I'm giving up. Updating code on all my devices with #baud_rate: 0 as this fixed issue. Thank you mspiridakis!

@jongdesteven
Copy link

jongdesteven commented Aug 10, 2023

I believe it has to do with following PR esphome/esphome#4762

As it uses another UART when the logger is disabled on the first UART

@paulignari
Copy link

My new POWR320D was working with Tasmota but with ESPHome 2023.8.2 it wasn't able to read and display any power-related value (A, V, W, ecc.).

After a lot of tries I found that Tasmota configure the UART at 4800 baud 8E1, while ESPHOME use 4800 baud 8N1.

After setting

uart:
  rx_pin: GPIO16
  baud_rate: 4800
  data_bits: 8
  parity: EVEN
  stop_bits: 1

the values are read from CSE7766, despite this warning:

[E][uart:029]: Invalid parity: Integration requested parity NONE but you have EVEN!

I hope this ca be useful.

@jongdesteven
Copy link

I see the datasheet also describes the even parity bit. So this should be correct.

@paulalexandrow
Copy link

I can confirm this also happens on the Athom v3 EU Plug (ESP32 C3 based), where @mspiridakis's fix using a dummy uart works (thanks!).
However, the other suggested method to enable logging does not. Strangely, in that case the logger and the custom uart are still assigned to UART0, which obviously results in an error.
Just leaving this comment so others might find this for Athom C3 hardware also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants