Added docs for CSE7761 power sensor (#1541)

* Added docs for CSE7761 power sensor
Also added docs for Sonoff Dual R3 v1.x

* Update components/sensor/cse7761.rst

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
This commit is contained in:
Arturo Casal 2021-10-28 20:59:01 +02:00 committed by GitHub
parent fbc5808e24
commit 825cf25f5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 140 additions and 0 deletions

View File

@ -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 <uart>` 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 <config-sensor>`.
- **current_1** (*Optional*): Use the current value of the channel 1 in amperes. All options from
:ref:`Sensor <config-sensor>`.
- **current_2** (*Optional*): Use the current value of the channel 2 in amperes. All options from
:ref:`Sensor <config-sensor>`.
- **active_power_1** (*Optional*): Use the (active) power value of the channel 1 in watts. All options from
:ref:`Sensor <config-sensor>`.
- **active_power_2** (*Optional*): Use the (active) power value of the channel 2 in watts. All options from
:ref:`Sensor <config-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 <uart>` if you want
to use multiple UART buses.
See Also
--------
- :ref:`sensor-filters`
- :apiref:`cse7761/cse7761.h`
- :ghedit:`Edit`

View File

@ -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
-------------

49
images/cse7761.svg Normal file
View File

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="261.333"
height="60"
version="1.1"
id="svg8"
sodipodi:docname="cse7761.svg"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs12" />
<sodipodi:namedview
id="namedview10"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="4.1777075"
inkscape:cx="120.04191"
inkscape:cy="26.928644"
inkscape:window-width="2560"
inkscape:window-height="1349"
inkscape:window-x="0"
inkscape:window-y="30"
inkscape:window-maximized="1"
inkscape:current-layer="svg8" />
<path
d="M19.333.667H242c10.31 0 18.667 8.357 18.667 18.666V40c0 10.31-8.358 18.667-18.667 18.667H19.333C9.024 58.667.667 50.309.667 40V19.333C.667 9.024 9.024.667 19.333.667z"
id="path2" />
<path
d="M19.333.667H242c10.31 0 18.667 8.357 18.667 18.666V40c0 10.31-8.358 18.667-18.667 18.667H19.333C9.024 58.667.667 50.309.667 40V19.333C.667 9.024 9.024.667 19.333.667z"
fill="none"
stroke="#000"
stroke-width="1.333"
stroke-linecap="round"
stroke-linejoin="round"
stroke-miterlimit="10"
id="path4" />
<path
id="path866"
style="fill:#ffffff"
d="m 245.01812,13.6665 v 32.667 h -11.014 v -24.36 h -5.6 v -8.307 z M 34.51588,47.08 c -3.453333,0 -6.564333,-0.715667 -9.333,-2.147 -2.769333,-1.462 -4.947333,-3.484 -6.534,-6.066 -1.555333,-2.613333 -2.333,-5.569 -2.333,-8.867 0,-3.298 0.777667,-6.238 2.333,-8.82 1.586667,-2.613333 3.764667,-4.635667 6.534,-6.067 2.768667,-1.462 5.879667,-2.193 9.333,-2.193 3.173333,0 6.004333,0.56 8.493,1.68 2.489333,1.12 4.542667,2.737667 6.16,4.853 l -6.953,6.207 c -2.022,-2.551333 -4.402,-3.827 -7.14,-3.827 -2.302,0 -4.153,0.746667 -5.553,2.24 -1.4,1.462667 -2.1,3.438333 -2.1,5.927 0,2.488667 0.7,4.479667 2.1,5.973 1.4,1.462667 3.251,2.194 5.553,2.194 2.738,0 5.118,-1.275667 7.14,-3.827 l 6.953,6.207 c -1.617333,2.115333 -3.670667,3.733 -6.16,4.853 -2.488667,1.12 -5.319667,1.68 -8.493,1.68 z m 33.54,0 c -2.706667,0 -5.351,-0.295667 -7.933,-0.887 -2.551333,-0.622 -4.651333,-1.446333 -6.3,-2.473 l 3.546,-8.027 c 1.556,0.902667 3.298333,1.634 5.227,2.194 1.928667,0.528667 3.779667,0.793 5.553,0.793 1.524667,0 2.613667,-0.14 3.267,-0.42 0.653333,-0.311333 0.98,-0.762333 0.98,-1.353 0,-0.684667 -0.435667,-1.198 -1.307,-1.54 -0.84,-0.342667 -2.24,-0.716 -4.2,-1.12 -2.52,-0.529333 -4.62,-1.089333 -6.3,-1.68 -1.68,-0.622667 -3.142,-1.618333 -4.386,-2.987 -1.244667,-1.4 -1.867,-3.282333 -1.867,-5.647 0,-2.053333 0.575667,-3.92 1.727,-5.6 1.150667,-1.68 2.861667,-3.002 5.133,-3.966 2.302,-0.964667 5.086333,-1.447 8.353,-1.447 2.24,0 4.433333,0.249 6.58,0.747 2.178,0.466667 4.091333,1.166667 5.74,2.1 l -3.313,7.98 c -3.204667,-1.618 -6.238,-2.427 -9.1,-2.427 -2.831333,0 -4.247,0.684333 -4.247,2.053 0,0.653333 0.42,1.151333 1.26,1.494 0.84,0.310667 2.224667,0.652667 4.154,1.026 2.488667,0.466667 4.588667,1.011333 6.3,1.634 1.710667,0.590667 3.188333,1.570667 4.433,2.94 1.275333,1.368667 1.913,3.235333 1.913,5.6 0,2.053333 -0.575333,3.92 -1.726,5.6 -1.151333,1.648667 -2.878,2.970667 -5.18,3.966 -2.271333,0.964667 -5.040333,1.447 -8.307,1.447 z m 49.64,-9.053 v 8.306 h -27.16 V 13.667 h 26.553 v 8.306 h -15.726 V 25.8 h 13.813 v 7.933 h -13.813 v 4.294 z m 34.52,-24.36 v 6.766 l -10.873,25.9 h -12.04 l 10.36,-24.126 h -6.3 v 4.76 h -9.1 v -13.3 z m 34.1,0 v 6.766 l -10.873,25.9 h -12.04 l 10.36,-24.126 h -6.3 v 4.76 h -9.1 v -13.3 z m 23.32,11.526 c 1.99133,0 3.84233,0.435667 5.553,1.307 1.71133,0.871333 3.08033,2.100333 4.107,3.687 1.02667,1.586667 1.54,3.406667 1.54,5.46 0,2.270667 -0.591,4.277333 -1.773,6.02 -1.15133,1.742 -2.738,3.079667 -4.76,4.013 -2.02267,0.933333 -4.26267,1.4 -6.72,1.4 -3.14267,0 -5.896,-0.606667 -8.26,-1.82 -2.33333,-1.213333 -4.15333,-3.017667 -5.46,-5.413 -1.30667,-2.396 -1.96,-5.336 -1.96,-8.82 0,-3.733333 0.74667,-6.969 2.24,-9.707 1.524,-2.738 3.63933,-4.822333 6.346,-6.253 2.738,-1.431333 5.91133,-2.147 9.52,-2.147 1.96,0 3.82667,0.233333 5.6,0.7 1.77333,0.435333 3.28233,1.057667 4.527,1.867 l -3.967,7.7 c -1.61733,-1.151333 -3.59267,-1.727 -5.926,-1.727 -1.898,0 -3.46933,0.482333 -4.714,1.447 -1.21333,0.933333 -2.00667,2.302 -2.38,4.106 1.71133,-1.213333 3.87367,-1.82 6.487,-1.82 z m -2.8,14.28 c 0.99533,0 1.80433,-0.295333 2.427,-0.886 0.622,-0.591333 0.933,-1.400333 0.933,-2.427 0,-1.026667 -0.311,-1.835667 -0.933,-2.427 -0.62267,-0.622 -1.43167,-0.933 -2.427,-0.933 -0.99533,0 -1.80433,0.311 -2.427,0.933 -0.622,0.591333 -0.933,1.400333 -0.933,2.427 0,1.026667 0.311,1.835667 0.933,2.427 0.62267,0.590667 1.43167,0.886 2.427,0.886 z" />
</svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -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

BIN
svg2png/cse7761.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB