diff --git a/components/sensor/cse7761.rst b/components/sensor/cse7761.rst new file mode 100644 index 000000000..999047aa8 --- /dev/null +++ b/components/sensor/cse7761.rst @@ -0,0 +1,74 @@ +CSE7761 Power Sensor +==================== + +.. seo:: + :description: Instructions for setting up CSE7761 power sensors for the Sonoff Dual R3 v1.x + :image: cse7761.png + :keywords: cse7761, Sonoff Dual R3 + +The ``cse7761`` sensor platform allows you to use your CSE7761 voltage/current and power sensors +with ESPHome. This sensor is commonly found in Sonoff Dual R3 v1.x. + +.. 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 CSE7761 done using UART, you need +to have an :ref:`UART bus ` in your configuration with the ``tx_pin`` and ``rx_pin`` connected to the CSE7761. +Additionally, you need to set the baud rate to 38400 and parity to ``EVEN``. + +.. code-block:: yaml + + # Example configuration entry + # Disable logging over serial + logger: + baud_rate: 0 + + uart: + tx_pin: GPIO25 + rx_pin: GPIO26 + baud_rate: 38400 + parity: EVEN + + sensor: + - platform: cse7761 + voltage: + name: 'CSE7761 Voltage' + current_1: + name: 'CSE7761 Current 1' + current_2: + name: 'CSE7761 Current 2' + active_power_1: + name: 'CSE7761 Active Power 1' + active_power_2: + name: 'CSE7761 Active Power 2' + update_interval: 5s + +.. note:: + + The configuration above should work for Sonoff Dual R3 v1.x. + +Configuration variables: +------------------------ + +- **voltage** (*Optional*): Use the voltage value of the sensor in V (RMS). + All options from :ref:`Sensor `. +- **current_1** (*Optional*): Use the current value of the channel 1 in amperes. All options from + :ref:`Sensor `. +- **current_2** (*Optional*): Use the current value of the channel 2 in amperes. All options from + :ref:`Sensor `. +- **active_power_1** (*Optional*): Use the (active) power value of the channel 1 in watts. All options from + :ref:`Sensor `. +- **active_power_2** (*Optional*): Use the (active) power value of the channel 2 in watts. All options from + :ref:`Sensor `. +- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the + sensor. Defaults to ``60s``. +- **uart_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the :ref:`UART Component ` if you want + to use multiple UART buses. + +See Also +-------- + +- :ref:`sensor-filters` +- :apiref:`cse7761/cse7761.h` +- :ghedit:`Edit` diff --git a/devices/sonoff.rst b/devices/sonoff.rst index 0c4004c49..9bb2eca46 100644 --- a/devices/sonoff.rst +++ b/devices/sonoff.rst @@ -102,6 +102,22 @@ Sonoff Dual R2 v1.4 GPIO10, Button on the case, GPIO13, Blue LED (inverted) +Sonoff Dual R3 v1.x +------------------- + +.. pintable:: + + GPIO27, Relay #1, + GPIO14, Relay #2, + GPIO0, Button, + GPIO13, Blue LED (inverted), + GPIO32, SW Input #1 (inverted), + GPIO33, SW Input #2 (inverted), + GPIO25, UART TX pin (for power sensor) + GPIO26, UART RX pin (for power sensor) + +See :doc:`/components/sensor/cse7761` for measuring power. + Sonoff Pow R1 ------------- diff --git a/images/cse7761.svg b/images/cse7761.svg new file mode 100644 index 000000000..697d4d0fb --- /dev/null +++ b/images/cse7761.svg @@ -0,0 +1,49 @@ + + + + + + + + diff --git a/index.rst b/index.rst index 330bff03b..73e8f2908 100644 --- a/index.rst +++ b/index.rst @@ -238,6 +238,7 @@ Electricity ADE7953, components/sensor/ade7953, ade7953.svg, Power ATM90E32, components/sensor/atm90e32, atm90e32.jpg, Voltage & Current & Power CS5460A, components/sensor/cs5460a, cs5460a.png, Voltage & Current & Power + CSE7761, components/sensor/cse7761, cse7761.svg, Voltage & Current & Power CSE7766, components/sensor/cse7766, cse7766.svg, Voltage & Current & Power CT Clamp, components/sensor/ct_clamp, ct_clamp.jpg, AC current Daly BMS, components/sensor/daly_bms, daly_bms.png, Voltage & Current & Power diff --git a/svg2png/cse7761.png b/svg2png/cse7761.png new file mode 100644 index 000000000..60190d126 Binary files /dev/null and b/svg2png/cse7761.png differ