2018-10-17 21:00:30 +02:00
CSE7766 Power Sensor
====================
2018-11-14 22:12:27 +01:00
.. seo ::
:description: Instructions for setting up CSE7766 power sensors for the Sonoff Pow R2
2021-11-16 03:19:33 +01:00
:image: cse7766.svg
2021-05-10 00:01:02 +02:00
:keywords: cse7766, cse7759b, Sonoff Pow R2
2018-11-14 22:12:27 +01:00
2018-10-17 21:00:30 +02:00
The `` cse7766 `` sensor platform allows you to use your CSE7766 voltage/current and power sensors
2022-10-18 21:03:26 +02:00
(`datasheet <https://itead.cc/wp-content/uploads/2022/05/CSE7766.pdf> `__ ) sensors with
2021-05-10 00:01:02 +02:00
ESPHome. This sensor is commonly found in Sonoff POW R2. CSE7759B is similar to CSE7766
2024-05-07 07:16:56 +02:00
and works with this component.
2018-10-17 21:00:30 +02:00
2021-05-17 17:05:55 +02:00
.. 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.
2018-10-17 21:00:30 +02:00
As the communication with the CSE7766 done using UART, you need
to have an :ref: `UART bus <uart>` in your configuration with the `` rx_pin `` connected to the CSE7766.
2024-01-15 01:05:50 +01:00
Additionally, you need to set the baud rate to 4800. The device sends multiple updates per second, so you
will probably want some sort of averaging or throttle filter on the sensors.
2018-10-17 21:00:30 +02:00
2018-11-19 18:32:16 +01:00
.. code-block :: yaml
2018-10-17 21:00:30 +02:00
# Example configuration entry
2024-02-28 22:12:06 +01:00
substitutions:
update_interval: 60s
2018-10-17 21:00:30 +02:00
# Disable logging over USB
logger:
baud_rate: 0
uart:
rx_pin: RX
2018-10-27 13:19:51 +02:00
baud_rate: 4800
2018-10-17 21:00:30 +02:00
sensor:
- platform: cse7766
current:
name: "Sonoff Pow R2 Current"
2024-01-15 01:05:50 +01:00
filters:
2024-02-28 22:12:06 +01:00
- throttle_average: ${update_interval}
2018-10-17 21:00:30 +02:00
voltage:
name: "Sonoff Pow R2 Voltage"
2024-01-15 01:05:50 +01:00
filters:
2024-02-28 22:12:06 +01:00
- throttle_average: ${update_interval}
2018-10-17 21:00:30 +02:00
power:
name: "Sonoff Pow R2 Power"
2024-02-28 22:12:06 +01:00
filters:
- throttle_average: ${update_interval}
2021-11-30 16:08:06 +01:00
energy:
name: "Sonoff Pow R2 Energy"
2024-02-28 22:12:06 +01:00
filters:
- throttle: ${update_interval}
apparent_power:
name: "Sonoff Pow R2 Apparent Power"
filters:
- throttle_average: ${update_interval}
power_factor:
name: "Sonoff Pow R2 Power Factor"
filters:
- throttle_average: ${update_interval}
2018-10-17 21:00:30 +02:00
.. note ::
The configuration above should work for Sonoff POWs (R2).
Configuration variables:
------------------------
- **current** (*Optional* ): Use the current value of the sensor in amperes. All options from
2019-02-17 12:28:17 +01:00
:ref: `Sensor <config-sensor>` .
2018-10-17 21:00:30 +02:00
- **power** (*Optional* ): Use the (active) power value of the sensor in watts. All options from
2019-02-17 12:28:17 +01:00
:ref: `Sensor <config-sensor>` .
2018-10-17 21:00:30 +02:00
- **voltage** (*Optional* ): Use the voltage value of the sensor in V (RMS).
2019-02-17 12:28:17 +01:00
All options from :ref: `Sensor <config-sensor>` .
2021-11-30 16:08:06 +01:00
- **energy** (*Optional* ): Use the total energy value of the sensor in Wh.
All options from :ref: `Sensor <config-sensor>` .
2024-02-28 22:12:06 +01:00
- **apparent_power** (*Optional* ): Use the apparent power value of the sensor in volt amps.
All options from :ref: `Sensor <config-sensor>` .
- **power_factor** (*Optional* ): Use the power factor value of the sensor.
All options from :ref: `Sensor <config-sensor>` .
2018-10-17 21:00:30 +02:00
- **uart_id** (*Optional* , :ref: `config-id` ): Manually specify the ID of the :ref: `UART Component <uart>` if you want
to use multiple UART buses.
See Also
--------
- :ref: `sensor-filters`
2019-05-12 22:44:59 +02:00
- :apiref: `cse7766/cse7766.h`
2019-02-07 13:54:45 +01:00
- :ghedit: `Edit`