Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
191 changes: 191 additions & 0 deletions docs/source/Plugin/P155.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
.. include:: ../Plugin/_plugin_substitutions_p15x.repl
.. _P155_page:

|P155_typename|
==================================================

|P155_shortinfo|

Plugin details
--------------

Type: |P155_type|

Port Type: |P155_porttype|

Name: |P155_name|

Status ESP32: |P155_status|

Status ESP8266: |P155_status_lb|

GitHub: |P155_github|_

Maintainer: |P155_maintainer|

Used libraries: |P155_usedlibraries|

Supported hardware
------------------

Supports all smart meters using the SML protocol (Smart Message Language)
and older meters using the D0 protocol (IEC 62056-21).

Tested devices:

* DD3 (SML meter, use model: SML)
* Holley DTZ541 (use model: DTZ541)
* Any SML-compliant meter (use model: SML-Auto)
* Older meters with optical interface (use model: D0)

Reading Head
~~~~~~~~~~~~

To connect a smart meter to the ESP, an IR reading head is required.
A compatible TTL/UART reading head is available:

.. csv-table::
:header: "Store", "Link"
:widths: 5, 40

"eBay","`TTL/UART IR Reading Head <https://www.ebay.de/itm/314015465828>`_"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could take a picture of the device you have (don't use pictures from the ebay page), as the ebay link may not remain to work forever.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I remove the link and just use a description and the image? The link was just an example; devices from other manufacturers work as well.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you have the product yourself?
So you can also include a photo of it in the docs as a picture tells more than a 1000 words :)
You can also add some schematic drawing of where wires should be connected to for example.
And to make it perfect, place it on some grid paper showing the dimensions, like mm grid paper.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok good, i tried to show what it looks like when it's installed and what the device looks like on its own. The wiring is quite simple so i think a table should be enough to understand


The reading head includes a fully assembled PCB with IR diode and phototransistor,
a ring magnet to attach to the meter, and a housing with cover.

Precautions
-----------

The plugin uses Hardware Serial2 on fixed pins:

* RX = GPIO 16
* TX = GPIO 17
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ehh this should be using a configuration to select a port.
Please search the code for ESPEasySerial, as used in plugins like P052/P053/P054 etc.
Not all ESP boards have the same pins accessible.
For example on ESP32-classic exactly these 2 pins have issues as they can also be used for PSRAM. Even on a board without PSRAM these pins will show high frequency signals every now and then.
I noticed you are using ESPEasySerial to create the UART instance, but still using hard coded values.
When using the dev.type (in the PLUGIN_ADD) to be serial, you already have the selector present on the webpage.

Then you could add something like this:

    case PLUGIN_WEBFORM_SHOW_SERIAL_PARAMS:
    {
      String options_baudrate[6];

      for (int i = 0; i < 6; ++i) {
        options_baudrate[i] = String(p085_storageValueToBaudrate(i));
      }
      const FormSelectorOptions selector(6, options_baudrate);
      selector.addFormSelector(F("Baud Rate"), P085_BAUDRATE_LABEL, P085_BAUDRATE);
      addUnit(F("baud"));
      addFormNumericBox(F("Modbus Address"), P085_DEV_ID_LABEL, P085_DEV_ID, 1, 247);
      break;
    }

to fine-tune the serial config (taken as example from P085)


The meter's serial interface operates at 9600 baud with 3.3V logic levels.
No level converter is required for 3.3V meters.

Hardware
--------

Connect the meter to the ESP32-S3 as follows:

.. code-block:: none

Smart Meter ESP32-S3
TXD --> GPIO 16 (RX2)
RXD --> GPIO 17 (TX2)
GND --> GND

.. note::

GPIO 16 and 17 are fixed as Hardware Serial2 (UART2) on the ESP32-S3.
These pins cannot be changed via the web interface.

Configuration
-------------

**Name** A unique name for the task (example: **SmartMeter**).

**Enabled** The device can be enabled or disabled.

Sensor
^^^^^^

**Model Type** Select the protocol matching your meter:

.. csv-table::
:header: "Model", "Meter", "Notes"
:widths: 8, 15, 20

"D0", "Older meters with optical interface",""
"SML", "DD3, EHZ and other SML meters",""
"DTZ541", "Holley DTZ541",""
"SML-Auto", "All SML-compliant meters", "Dynamic TL parsing, recommended"

.. note::

Changing the model reloads the page and resets the value selectors.

**Value 1-4** Select the desired measurement values from the available OBIS registers.

.. include:: DataAcquisition.repl

* **Interval**: Recommended 1s for power values, 10s for energy values.

Output
^^^^^^

Output values
"""""""""""""

The available measurement values depend on the selected model.

SML and SML-Auto share the same OBIS codes:

.. csv-table::
:header: "#", "Value Name", "OBIS", "Unit", "Description"
:widths: 2, 12, 10, 4, 20

"1", "Energy_Consumption_kWh", "1-0:1.8.0", "kWh \*", "Total import energy"
"2", "L1_W", "1-0:21.7.0", "W", "Active power L1"
"3", "L2_W", "1-0:41.7.0", "W", "Active power L2"
"4", "L3_W", "1-0:61.7.0", "W", "Active power L3"
"5", "L123_W", "1-0:16.7.0", "W", "Total active power"
"6", "Energy_FeedIn_kWh", "1-0:2.8.0", "kWh \*", "Total export energy"
"7", "L1_V", "1-0:32.7.0", "V", "Voltage L1"
"8", "L2_V", "1-0:52.7.0", "V", "Voltage L2"
"9", "L3_V", "1-0:72.7.0", "V", "Voltage L3"
"10", "L1_A", "1-0:31.7.0", "A", "Current L1"
"11", "L2_A", "1-0:51.7.0", "A", "Current L2"
"12", "L3_A", "1-0:71.7.0", "A", "Current L3"

\* SML-Auto delivers energy values in Wh. Enter ``VALUE/1000`` in the formula field to get kWh.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the formula is %value%/1000


D0:

.. csv-table::
:header: "#", "Value Name", "OBIS", "Unit", "Description"
:widths: 2, 12, 12, 4, 15

"1", "Consumption_kWh", "1-0:1.8.0\*255", "kWh", "Total import energy"
"2", "L1_W", "1-0:21.7.0\*255", "W", "Active power L1"
"3", "L2_W", "1-0:41.7.0\*255", "W", "Active power L2"
"4", "L3_W", "1-0:61.7.0\*255", "W", "Active power L3"
"5", "L123_W", "1-0:1.7.0\*255", "W", "Total active power"

DTZ541:

.. csv-table::
:header: "#", "Value Name", "OBIS", "Unit", "Description"
:widths: 2, 12, 10, 4, 15

"1", "Energy_Consumption_kWh", "1-0:1.8.0", "kWh", "Total import energy"
"2", "L123_W", "1-0:16.7.0", "W", "Total active power"
"3", "Energy_FeedIn_kWh", "1-0:2.8.0", "kWh", "Total export energy"

Indicators (recommended settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. csv-table::
:header: "Indicator", "Value Name", "Interval", "Formula", "Extra information"
:widths: 12, 10, 5, 8, 20

"Energy_Consumption_kWh", "Import_kWh", "10", "VALUE/1000", "SML-Auto only: Wh to kWh"
"Energy_FeedIn_kWh", "Export_kWh", "10", "VALUE/1000", "SML-Auto only: Wh to kWh"
"L123_W", "Power_W", "1", "", "No formula needed"
"L1_V / L2_V / L3_V", "Voltage_V", "10", "", ""

.. note::

With **SML-Auto**, energy registers deliver the raw value in Wh (scaler is read
automatically from the telegram). Enter ``VALUE/1000`` in the ESPEasy formula
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

field to get kWh. Power values (W) require no formula.

Change log
----------

.. versionadded:: 1.0
...

|added|
Initial release version.
13 changes: 13 additions & 0 deletions docs/source/Plugin/_plugin_substitutions_p15x.repl
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,19 @@
.. |P154_compileinfo| replace:: `.`
.. |P154_usedlibraries| replace:: `Adafruit BMP3XX Library`

.. |P155_name| replace:: :cyan:`SML Smartmeter`
.. |P155_type| replace:: :cyan:`Energy`
.. |P155_typename| replace:: :cyan:`Energy - SML Smartmeter`
.. |P155_porttype| replace:: `.`
.. |P155_status| replace:: :green:`NORMAL`
.. |P155_status_lb| replace:: ``
.. |P155_github| replace:: P155_Smartmeter.ino
.. _P155_github: https://github.com/letscontrolit/ESPEasy/blob/mega/src/_P155_Smartmeter.ino
.. |P155_usedby| replace:: `.`
.. |P155_shortinfo| replace:: `SML/D0 Smartmeter energy sensor`
.. |P155_maintainer| replace:: `Custom`
.. |P155_compileinfo| replace:: `.`

.. |P159_name| replace:: :cyan:`LD2410`
.. |P159_type| replace:: :cyan:`Presence`
.. |P159_typename| replace:: :cyan:`Presence - LD2410`
Expand Down
Loading