-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add P155_Smartmeter #5542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: mega
Are you sure you want to change the base?
Add P155_Smartmeter #5542
Changes from 1 commit
c84c15e
e270aa1
fff00c8
a2dd1e6
8d6afa5
72f69a3
6a1bd86
84eb398
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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>`_" | ||
|
|
||
| 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 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ehh this should be using a configuration to select a port. 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. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the formula is |
||
|
|
||
| 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 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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