CSE7766 Power Sensor

The cse7766 sensor platform allows you to use your CSE7766 voltage/current and power sensors (datasheet) sensors with ESPHome. This sensor is commonly found in Sonoff POW R2. CSE7759B is similar to CSE7766 and works with this component.

Note

SAFETY HAZARD: Some devices such as Sonoff POWs/Shelly/etc, have the digital GND connected directly to mains voltage so the GPIOs become LIVE during normal operation. Our advice is to mark these boards to prevent any use of the dangerous digital pins.

As the communication with the CSE7766 done using UART, you need to have an UART bus in your configuration with the rx_pin connected to the CSE7766. Additionally, you need to set the baud rate to 4800 and parity to EVEN. The device sends multiple updates per second, so you will probably want some sort of averaging or throttle filter on the sensors.

# Example configuration entry
substitutions:
  update_interval: 60s

# Disable logging over USB
logger:
  baud_rate: 0

uart:
  rx_pin: RX
  baud_rate: 4800
  parity: EVEN

sensor:
  - platform: cse7766
    voltage:
      name: "Sonoff Pow R2 Voltage"
      filters:
        - throttle_average: ${update_interval}
    current:
      name: "Sonoff Pow R2 Current"
      filters:
        - throttle_average: ${update_interval}
    power:
      name: "Sonoff Pow R2 Power"
      filters:
        - throttle_average: ${update_interval}
    energy:
      name: "Sonoff Pow R2 Energy"
      filters:
        - throttle: ${update_interval}
    apparent_power:
      name: "Sonoff Pow R2 Apparent Power"
      filters:
        - throttle_average: ${update_interval}
    reactive_power:
      name: "Sonoff Pow R2 Reactive Power"
      filters:
        - throttle_average: ${update_interval}
    power_factor:
      name: "Sonoff Pow R2 Power Factor"
      filters:
        - throttle_average: ${update_interval}

Note

The configuration above should work for Sonoff POWs (R2).

Configuration variables:

  • voltage (Optional): Use the voltage value of the sensor in V (RMS). All options from Sensor.

  • current (Optional): Use the current value of the sensor in amperes. All options from Sensor.

  • power (Optional): Use the (active) power value of the sensor in watts. All options from Sensor.

  • energy (Optional): Use the total (active) energy value of the sensor in Wh. All options from Sensor.

  • apparent_power (Optional): Use the apparent power value of the sensor in VA. All options from Sensor.

  • reactive_power (Optional): Use the reactive power value of the sensor in VAR. All options from Sensor.

  • power_factor (Optional): Use the power factor value of the sensor. All options from Sensor.

  • uart_id (Optional, ID): Manually specify the ID of the UART Component if you want to use multiple UART buses.

See Also