Skip to content
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

Add support for SDM230 ModBus #13443

Merged
merged 14 commits into from
Jan 15, 2022
Merged

Add support for SDM230 ModBus #13443

merged 14 commits into from
Jan 15, 2022

Conversation

dad401
Copy link

@dad401 dad401 commented Oct 23, 2021

This is my first PR and use of GitHub - so do not grill me ;)

changed:       CHANGELOG.md
changed:       tasmota/language/de_DE.h
changed:       tasmota/language/en_GB.h
open/todo:     update all other localization files
changed:       tasmota/my_user_config.h
changed:       tasmota/support_features.ino
changed:       tasmota/tasmota_configurations.h
changed:       tasmota/tasmota_configurations_ESP32.h
changed:       tasmota/tasmota_template.h
changed:       tasmota/tasmota_template_legacy.h
changed:       tasmota/xdrv_03_energy.ino
new file:     tasmota/xnrg_21_sdm230.ino

I added support (POC) for Eastron SDM230 ModBus (based on existing drivers SDM120 and SDM630).
As it is a lot of annoying work I did not changed all language files so far. In case this PR will be ignored.

I suggest for future versions:

  • use the same pin names for all SDM(72|120|220|230|630) drivers, e.g.: GPIO_SDMxxx_TX and GPIO_SDMxxx_RX
  • integrate all SDM drivers into one (xnrg_xx_SDM-ModBus.ino)

I am not sure why there is an extra #define for the SDM630 Import Energy. Is it to save space? I also "copied" this feature for SDM230.

Description:

Related issue (if applicable): fixes #

Checklist:

  • [X ] The pull request is done against the latest development branch
  • Only relevant files were touched
  • [X ] Only one feature/fix was added per PR and the code change compiles without warnings
  • The code change is tested and works with Tasmota core ESP8266 V.2.7.4.9 (compiles successfully, runs on Wemos D1)
  • The code change is tested and works with Tasmota core ESP32 V.1.0.7.5 (compiles successfully)
  • I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

@dad401
Copy link
Author

dad401 commented Oct 23, 2021

IMHO it should work for tasmota and tasmota32, localizations updated.
Last open issue might be some necessary changes for tasmota/berry.
Feedback from someone with hardware is appreciated - I still have to wait for a TTL-RS485 Board...

20211023-140434-screenshot

@Noschvie
Copy link
Contributor

Hello,
I have such a SDM230-Modbus device connect to a ESP32 running Tasmota 10.0.0.1
{"NAME":"ESP32-SDM230","GPIO":[0,1920,0,1952,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":1}

grafik

But sorry: how can I test this branch ?

@barbudor
Copy link
Contributor

@Noschvie If you want to test, you can clone directly from the author's fork and compile yourself: https://github.com/dad401/Tasmota

@Noschvie
Copy link
Contributor

Have compiled dad401's fork and tested with an ESP32.
Please have a look to the attached screen shot:

grafik

@ascillato2 ascillato2 changed the title added support for SDM230 ModBus (untested, due to lack of hardware - it compiles and runs on a Wemos D1) Add support for SDM230 ModBus Oct 28, 2021
@dad401
Copy link
Author

dad401 commented Oct 30, 2021

I'm a bit confused. What's the reason for closing this PR? It's not merged or do I miss something?

@arendst arendst reopened this Oct 30, 2021
@arendst
Copy link
Owner

arendst commented Oct 30, 2021

It should not have been closed. No idea what the relation was with the other PR.

@dad401
Copy link
Author

dad401 commented Nov 1, 2021

Today I got my TTL-RS485 adapter. Seems to work with my Eastron SDM230 in parallel with I2C devices, DS18x20 sensors and scripting.
There are no energy values because the smart meter is new and it's not connected in a way where it can count.
202111 1-231248-screenshot

What else has to be done for making this PR final?
I only can think of a discussion about registers which should be read out and displayed.
ATM I ignore these ones:

//  0X0158,   // SDM230_TOTAL_ENERGY_REACTIVE               [kVArh]
//  0X0182,   // SDM230_RESETTABLE_TOTAL_ENERGY_REACTIVE    [kVArh]
//  0X004C,   // SDM230_IMPORT_REACTIVE                     [kVArh]
//  0X004E,   // SDM230_EXPORT_REACTIVE                     [kVArh]
//  0X0054,   // SDM230_TOTAL_DEMAND_POWER_ACTIVE           [W]
//  0X0058,   // SDM230_IMPORT_DEMAND_POWER_ACTIVE          [W]
//  0X005A,   // SDM230_MAXIMUM_IMPORT_DEMAND_POWER_ACTIVE  [W]
//  0X005C,   // SDM230_EXPORT_DEMAND_POWER_ACTIVE          [W]
//  0X005E,   // SDM230_MAXIMUM_EXPORT_DEMAND_POWER_ACTIVE  [W]
//  0X0102,   // SDM230_TOTAL_DEMAND_CURRENT                [A]
//  0X0108,   // SDM230_MAXIMUM_TOTAL_DEMAND_CURRENT        [A]

IMHO these aren't too important and an integration can be discussed later.

First I had some trouble to get it working. I connected the RS485 adapter to GPIO1 and 3 (TX/RX) which didn't work. I managed it to get it working by using GPIO4 and 5 or GPIO12 and 13.

So I got some questions:
Are there any constraints in which GPIOs I can use?
How can I get higher precision for voltage or frequency? As far as I know, the read out of these registers give 233.12V or 50.01Hz for example.
EDIT: I got it => Adjustable using these commands: VoltRes and FreqRes

@arendst
Copy link
Owner

arendst commented Nov 2, 2021

I only can think of a discussion about registers which should be read out and displayed.

No need to think about it. You already have too many registers present. I suggest to remove Max Power and Phase Angle. They are not within the Tasmota data set currently and shouldn't be either. The issue is that gathering the registers takes too much time and is flooding the gui.

You might want to enable profiling to see how much time is spend in the driver gathering the registers.

@dad401
Copy link
Author

dad401 commented Nov 2, 2021

In my opinion these registers "must be" included for this device:

  0x0000,   // SDM230_VOLTAGE                             [V]
  0x0006,   // SDM230_CURRENT                             [A]
  0x000C,   // SDM230_POWER (Active)                      [W]
  0x0046,   // SDM230_FREQUENCY                           [Hz]
  0x001E,   // SDM230_POWER_FACTOR  *
  0X004A,   // SDM230_EXPORT_ACTIVE                       [kWh] **
  0X0048,   // SDM230_IMPORT_ACTIVE                       [kWh] **
  0X0156,   // SDM230_TOTAL_ENERGY_ACTIVE                 [kWh]

* used in all other known energy meter (SonOff Pow R2, Gosund...)
** because this is a bidirectional device, these registers must be displayed (IMHO). I was wondering why "import active" had to be included by an #define in driver SDM630.

These ones are "should be":

  0x0012,   // SDM230_POWER (Apparent) G                  [VA] ***
  0x0018,   // SDM230_POWER (Reactive)                    [VAr] ***
  0X0180,   // SDM230_RESETTABLE_TOTAL_ENERGY_ACTIVE      [kWh]
  0X0056,   // SDM230_MAXIMUM_TOTAL_DEMAND_POWER_ACTIVE   [W]
  0x0024,   // SDM230_PHASE ANGLE                         [Degree]

*** I don't need these information, but I can't rate it if they are as important as the ones for "must be".

And these ones are "nice to have":

  0X0158,   // SDM230_TOTAL_ENERGY_REACTIVE               [kVArh]
  0X0182,   // SDM230_RESETTABLE_TOTAL_ENERGY_REACTIVE    [kVArh]
  0X004C,   // SDM230_IMPORT_REACTIVE                     [kVArh]
  0X004E,   // SDM230_EXPORT_REACTIVE                     [kVArh]
  0X0054,   // SDM230_TOTAL_DEMAND_POWER_ACTIVE           [W]
  0X0058,   // SDM230_IMPORT_DEMAND_POWER_ACTIVE          [W]
  0X005A,   // SDM230_MAXIMUM_IMPORT_DEMAND_POWER_ACTIVE  [W]
  0X005C,   // SDM230_EXPORT_DEMAND_POWER_ACTIVE          [W]
  0X005E,   // SDM230_MAXIMUM_EXPORT_DEMAND_POWER_ACTIVE  [W]
  0X0102,   // SDM230_TOTAL_DEMAND_CURRENT                [A]
  0X0108,   // SDM230_MAXIMUM_TOTAL_DEMAND_CURRENT        [A]

I suggest to change the "must be" block as default and the "should be" block as optional (#define) including a warning about possible timing issues.
At the end it's an individual decision which registers someone wants to see.

I'm underway to get profiling to work and get those timings for the current source.

@dad401
Copy link
Author

dad401 commented Nov 2, 2021

I tried to enable profiling. I added #define USE_PROFILING in my user config.
The led of my Wemos D1 keeps blinking very fast after updating the new compiled firmware. Neither I can access the WebGUI nor I it connects to the network (have to reflash it with esptool).

Any hints?

@arendst
Copy link
Owner

arendst commented Nov 3, 2021

Pls retry using latest dev.

To enable profiling use these defines:

#define USE_PROFILING                            // Enable profiling
#define PROFILE_THRESHOLD            70          // Minimum duration in milliseconds to start logging
#define USE_PROFILE_DRIVER                       // Enable driver profiling
//#define USE_PROFILE_FUNCTION                     // Enable driver function profiling

@dad401
Copy link
Author

dad401 commented Nov 3, 2021

rebased my fork with your current development branch (first time ever, not sure if something went wrong, but seems to be ok) and compiled it. Now it is working!
My setting is:

  • Wemos D1
  • I2C CSS811 sensor (V2 driver)
  • 2x DS18B20 senors
  • I2C OLED 0.96 display (switches through different screens using a script)
  • RFSend tx module

Here is the output I hope you expected (removed all DMP messages):

20:22:45.865 CMD: weblog 4
20:22:45.869 RSL: RESULT = {"WebLog":4}
20:22:46.563 CFG: Saved to flash at F8, Count 48, Bytes 4096
20:22:50.245 PRF: *** xdrv FUNC_EVERY_SECOND (89 ms)
20:22:53.781 WIF: Checking connection...
20:22:55.309 PRF: *** xdrv FUNC_EVERY_SECOND (174 ms)
20:23:13.753 WIF: Checking connection...
20:23:15.247 PRF: *** xdrv FUNC_EVERY_SECOND (88 ms)
20:23:20.215 PRF: *** xdrv FUNC_EVERY_SECOND (91 ms)
20:23:23.569 NRG: EnergyTotal[0] 0.0000 kWh
20:23:25.222 PRF: *** xdrv FUNC_EVERY_SECOND (91 ms)
20:23:26.785 NRG: EnergyTotal[0] 0.0000 kWh
20:23:30.048 NRG: EnergyTotal[0] 0.0000 kWh
20:23:30.208 PRF: *** xdrv FUNC_EVERY_SECOND (89 ms)
20:23:33.296 NRG: EnergyTotal[0] 0.0000 kWh
20:23:33.794 WIF: Checking connection...
20:23:35.318 PRF: *** xdrv FUNC_EVERY_SECOND (171 ms)
20:23:36.541 NRG: EnergyTotal[0] 0.0000 kWh
20:23:39.772 NRG: EnergyTotal[0] 0.0000 kWh
20:23:40.312 CMD: weblog 3
20:23:40.314 SRC: WebConsole from 192.x.x.x
20:23:40.317 CMD: Grp 0, Cmnd 'WEBLOG', Idx 1, Len 1, Data '3'
20:23:40.321 RSL: RESULT = {"WebLog":3}
20:23:40.579 CFG: Saved to flash at F7, Count 49, Bytes 4096
20:23:43.043 NRG: EnergyTotal[0] 0.0000 kWh
20:23:46.261 NRG: EnergyTotal[0] 0.0000 kWh
20:23:49.530 NRG: EnergyTotal[0] 0.0000 kWh
20:23:52.754 NRG: EnergyTotal[0] 0.0000 kWh
20:23:55.212 PRF: *** xdrv FUNC_EVERY_SECOND (90 ms)
20:23:55.324 CMD: weblog 4
20:23:55.327 SRC: WebConsole from 192.x.xx.xx
20:23:55.329 CMD: Grp 0, Cmnd 'WEBLOG', Idx 1, Len 1, Data '4'
20:23:55.333 RSL: RESULT = {"WebLog":4}
20:23:55.585 CFG: Saved to flash at F6, Count 50, Bytes 4096
20:23:56.005 NRG: EnergyTotal[0] 0.0000 kWh
20:23:59.277 NRG: EnergyTotal[0] 0.0000 kWh
20:24:00.220 PRF: *** xdrv FUNC_EVERY_SECOND (86 ms)
20:24:02.515 NRG: EnergyTotal[0] 0.0000 kWh
20:24:05.253 PRF: *** xdrv FUNC_EVERY_SECOND (90 ms)
20:24:05.764 NRG: EnergyTotal[0] 0.0000 kWh
20:24:09.025 NRG: EnergyTotal[0] 0.0000 kWh
20:24:10.238 PRF: *** xdrv FUNC_EVERY_SECOND (89 ms)
20:24:12.279 NRG: EnergyTotal[0] 0.0000 kWh
20:24:13.778 WIF: Checking connection...
20:24:15.307 PRF: *** xdrv FUNC_EVERY_SECOND (175 ms)
20:24:15.533 NRG: EnergyTotal[0] 0.0000 kWh
20:24:18.768 NRG: EnergyTotal[0] 0.0000 kWh
20:24:22.009 NRG: EnergyTotal[0] 0.0000 kWh
20:24:25.275 NRG: EnergyTotal[0] 0.0000 kWh
20:24:28.536 NRG: EnergyTotal[0] 0.0000 kWh
20:24:31.794 NRG: EnergyTotal[0] 0.0000 kWh
20:24:33.754 WIF: Checking connection...
20:24:35.054 NRG: EnergyTotal[0] 0.0000 kWh
20:24:35.247 PRF: *** xdrv FUNC_EVERY_SECOND (85 ms)
20:24:38.265 NRG: EnergyTotal[0] 0.0000 kWh
20:24:40.213 PRF: *** xdrv FUNC_EVERY_SECOND (90 ms)
20:24:41.519 NRG: EnergyTotal[0] 0.0000 kWh
20:24:44.782 NRG: EnergyTotal[0] 0.0000 kWh
20:24:45.220 PRF: *** xdrv FUNC_EVERY_SECOND (89 ms)
20:24:48.058 NRG: EnergyTotal[0] 0.0000 kWh
20:24:50.249 PRF: *** xdrv FUNC_EVERY_SECOND (89 ms)
20:24:51.254 NRG: EnergyTotal[0] 0.0000 kWh
20:24:53.791 WIF: Checking connection...
20:24:54.548 NRG: EnergyTotal[0] 0.0000 kWh
20:24:55.313 PRF: *** xdrv FUNC_EVERY_SECOND (170 ms)

@dad401
Copy link
Author

dad401 commented Nov 3, 2021

new log after redesign using #define SDM230_MORE_REGS (3 extra modbus registers)

22:43:15.474 CMD: weblog 4
22:43:15.479 RSL: RESULT = {"WebLog":4}
22:43:17.501 NRG: EnergyTotal[0] 0.0000 kWh
22:43:20.479 NRG: EnergyTotal[0] 0.0000 kWh
22:43:23.469 NRG: EnergyTotal[0] 0.0000 kWh
22:43:25.712 WIF: Checking connection...
22:43:26.470 NRG: EnergyTotal[0] 0.0000 kWh
22:43:27.459 PRF: *** xdrv FUNC_EVERY_SECOND (85 ms)
22:43:29.518 NRG: EnergyTotal[0] 0.0000 kWh
22:43:32.456 PRF: *** xdrv FUNC_EVERY_SECOND (89 ms)
22:43:32.494 NRG: EnergyTotal[0] 0.0000 kWh
22:43:35.509 NRG: EnergyTotal[0] 0.0000 kWh
22:43:37.440 PRF: *** xdrv FUNC_EVERY_SECOND (83 ms)
22:43:38.489 NRG: EnergyTotal[0] 0.0000 kWh
22:43:41.498 NRG: EnergyTotal[0] 0.0000 kWh
22:43:42.429 PRF: *** xdrv FUNC_EVERY_SECOND (90 ms)
22:43:44.487 NRG: EnergyTotal[0] 0.0000 kWh
22:43:45.729 WIF: Checking connection...
22:43:47.502 PRF: *** xdrv FUNC_EVERY_SECOND (171 ms)
22:43:47.522 NRG: EnergyTotal[0] 0.0000 kWh
22:43:50.469 NRG: EnergyTotal[0] 0.0000 kWh
22:43:53.482 NRG: EnergyTotal[0] 0.0000 kWh
22:43:56.492 NRG: EnergyTotal[0] 0.0000 kWh
22:43:59.468 NRG: EnergyTotal[0] 0.0000 kWh
22:44:02.512 NRG: EnergyTotal[0] 0.0000 kWh
22:44:05.477 NRG: EnergyTotal[0] 0.0000 kWh
22:44:05.712 WIF: Checking connection...
22:44:07.457 PRF: *** xdrv FUNC_EVERY_SECOND (89 ms)
22:44:08.476 NRG: EnergyTotal[0] 0.0000 kWh
22:44:11.489 NRG: EnergyTotal[0] 0.0000 kWh
22:44:12.421 PRF: *** xdrv FUNC_EVERY_SECOND (86 ms)
22:44:14.476 NRG: EnergyTotal[0] 0.0000 kWh
22:44:17.413 PRF: *** xdrv FUNC_EVERY_SECOND (85 ms)
22:44:17.485 NRG: EnergyTotal[0] 0.0000 kWh
22:44:20.489 NRG: EnergyTotal[0] 0.0000 kWh
22:44:22.420 PRF: *** xdrv FUNC_EVERY_SECOND (89 ms)
22:44:23.470 NRG: EnergyTotal[0] 0.0000 kWh
22:44:25.714 WIF: Checking connection...
22:44:26.481 NRG: EnergyTotal[0] 0.0000 kWh
22:44:27.544 PRF: *** xdrv FUNC_EVERY_SECOND (176 ms)
22:44:29.471 NRG: EnergyTotal[0] 0.0000 kWh
22:44:32.485 NRG: EnergyTotal[0] 0.0000 kWh
22:44:35.466 NRG: EnergyTotal[0] 0.0000 kWh
22:44:38.506 NRG: EnergyTotal[0] 0.0000 kWh
22:44:41.469 NRG: EnergyTotal[0] 0.0000 kWh
22:44:44.496 NRG: EnergyTotal[0] 0.0000 kWh
22:44:45.738 WIF: Checking connection...
22:44:47.419 PRF: *** xdrv FUNC_EVERY_SECOND (86 ms)
22:44:47.483 NRG: EnergyTotal[0] 0.0000 kWh
22:44:50.500 NRG: EnergyTotal[0] 0.0000 kWh
22:44:52.440 PRF: *** xdrv FUNC_EVERY_SECOND (86 ms)
22:44:53.482 NRG: EnergyTotal[0] 0.0000 kWh
22:44:56.488 NRG: EnergyTotal[0] 0.0000 kWh
22:44:57.442 PRF: *** xdrv FUNC_EVERY_SECOND (89 ms)
22:44:59.511 NRG: EnergyTotal[0] 0.0000 kWh
22:45:02.405 PRF: *** xdrv FUNC_EVERY_SECOND (86 ms)
22:45:02.501 NRG: EnergyTotal[0] 0.0000 kWh
22:45:05.501 NRG: EnergyTotal[0] 0.0000 kWh
22:45:05.738 WIF: Checking connection...
22:45:07.514 PRF: *** xdrv FUNC_EVERY_SECOND (174 ms)
22:45:08.489 NRG: EnergyTotal[0] 0.0000 kWh
22:45:11.490 NRG: EnergyTotal[0] 0.0000 kWh
22:45:14.479 NRG: EnergyTotal[0] 0.0000 kWh
22:45:17.507 NRG: EnergyTotal[0] 0.0000 kWh
22:45:20.468 NRG: EnergyTotal[0] 0.0000 kWh
22:45:23.491 NRG: EnergyTotal[0] 0.0000 kWh
22:45:25.727 WIF: Checking connection...
22:45:26.487 NRG: EnergyTotal[0] 0.0000 kWh
22:45:27.439 PRF: *** xdrv FUNC_EVERY_SECOND (88 ms)
22:45:29.468 NRG: EnergyTotal[0] 0.0000 kWh
22:45:32.410 PRF: *** xdrv FUNC_EVERY_SECOND (86 ms)
22:45:32.531 NRG: EnergyTotal[0] 0.0000 kWh
22:45:35.470 NRG: EnergyTotal[0] 0.0000 kWh
22:45:37.445 PRF: *** xdrv FUNC_EVERY_SECOND (88 ms)
22:45:38.516 NRG: EnergyTotal[0] 0.0000 kWh
22:45:41.472 NRG: EnergyTotal[0] 0.0000 kWh
22:45:42.460 PRF: *** xdrv FUNC_EVERY_SECOND (85 ms)

@dad401
Copy link
Author

dad401 commented Nov 6, 2021

If you don't own a SDM230 device you can use the enclosed python script (thanks to modbus-tk)

rtuslave_sdm230.py.gz

It simulates a SDM230 slave with all registers used in this driver. For me it's working between a PI and Wemos D1 using USB-RS485 / TTL-RS485 adapters. I assume that it also works with no adapters.

@github-actions
Copy link

github-actions bot commented Dec 1, 2021

This PR has been automatically marked as stale because it hasn't any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Action - Issue left behind - Used by the BOT to call for attention label Dec 1, 2021
@github-actions
Copy link

github-actions bot commented Dec 6, 2021

This PR was automatically closed because of being stale.

@github-actions github-actions bot closed this Dec 6, 2021
@ascillato2 ascillato2 reopened this Dec 6, 2021
@ascillato2
Copy link
Collaborator

There are conflicts to be resolved before merging.

@ascillato2 ascillato2 removed the stale Action - Issue left behind - Used by the BOT to call for attention label Dec 6, 2021
@dad401
Copy link
Author

dad401 commented Dec 6, 2021

fixed it - What else has to be done to make this PR final?

@github-actions github-actions bot closed this Jan 5, 2022
@Noschvie
Copy link
Contributor

Noschvie commented Jan 7, 2022

Was there any holdup for this PR?

@@ -199,6 +199,7 @@
#define USE_MCP39F501 // Add support for MCP39F501 Energy monitor as used in Shelly 2 (+3k1 code)
#define USE_SDM72 // Add support for Eastron SDM72-Modbus energy monitor (+0k3 code)
#define USE_SDM120 // Add support for Eastron SDM120-Modbus energy monitor (+1k1 code)
#define USE_SDM230 // Add support for Eastron SDM230-Modbus energy monitor (+?? code)
Copy link
Owner

Choose a reason for hiding this comment

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

Uncomment as there is no room for additional sensors

Copy link
Author

Choose a reason for hiding this comment

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

uncommented

CHANGELOG.md Outdated
@@ -2,6 +2,9 @@
All notable changes to this project will be documented in this file.

## [Unreleased] - Development
- added support (POC) for Eastron SDM230 ModBus (based on existing drivers SDM120 and SDM630) - suggestion for future versions:
use the same pin names for all SDM(72|120|220|230|630) drivers, e.g.: GPIO_SDMxxx_TX and GPIO_SDMxxx_RX and integrate
Copy link
Owner

Choose a reason for hiding this comment

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

Remove nonsense information from changelog

Copy link
Author

Choose a reason for hiding this comment

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

fixed

@@ -176,6 +176,7 @@ enum UserSelectablePins {
GPIO_BL0942_RX, // BL0942 Serial interface
GPIO_HM330X_SET, // HM330X SET pin (sleep when low)
GPIO_HEARTBEAT, GPIO_HEARTBEAT_INV,
GPIO_SDM230_TX, GPIO_SDM230_RX, // SDM230 Serial interface
Copy link
Owner

Choose a reason for hiding this comment

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

Needs to be added at end of list

Copy link
Author

Choose a reason for hiding this comment

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

Moved to the end. By the way - what's the purpose for that?

@@ -373,7 +374,7 @@ const char kSensorNames[] PROGMEM =
D_SENSOR_BL0942_RX "|"
D_SENSOR_HM330X_SET "|"
D_SENSOR_HEARTBEAT "|" D_SENSOR_HEARTBEAT "_i|"

D_SENSOR_SDM230_TX "|" D_SENSOR_SDM230_RX "|"
Copy link
Owner

Choose a reason for hiding this comment

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

Ditto

Copy link
Author

Choose a reason for hiding this comment

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

fixed

@@ -1108,7 +1108,7 @@ void EnergyShow(bool json) {
EnergyFormatSum(value2_chr, Energy.daily, Settings->flag2.energy_resolution, json));

/*
#if defined(SDM630_IMPORT) || defined(SDM72_IMPEXP)
#if defined(SDM630_IMPORT) || defined(SDM72_IMPEXP)
Copy link
Owner

Choose a reason for hiding this comment

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

Don't touch unchanged files globbering the PR. Remove spaces at end of line.

Copy link
Author

Choose a reason for hiding this comment

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

removed space

@arendst arendst reopened this Jan 7, 2022
@github-actions github-actions bot removed the stale Action - Issue left behind - Used by the BOT to call for attention label Jan 7, 2022
@Noschvie
Copy link
Contributor

@dad401 : are you willing to complete this PR ?

Marcus added 11 commits January 15, 2022 14:14
	changed:       CHANGELOG.md
	changed:       tasmota/language/de_DE.h
	changed:       tasmota/language/en_GB.h
	open/todo:     update all other localization files
	changed:       tasmota/my_user_config.h
	changed:       tasmota/support_features.ino
	changed:       tasmota/tasmota_configurations.h
	changed:       tasmota/tasmota_configurations_ESP32.h
	changed:       tasmota/tasmota_template.h
	changed:       tasmota/tasmota_template_legacy.h
	changed:       tasmota/xdrv_03_energy.ino
	new file:     tasmota/xnrg_21_sdm230.ino

added support (POC) for Eastron SDM230 ModBus (based on existing drivers SDM120 and SDM630) - suggestion for future versions:
use the same pin names for all SDM(72|120|220|230|630) drivers, e.g.: GPIO_SDMxxx_TX and GPIO_SDMxxx_RX and integrate
all drivers into one (xnrg_xx_SDM-ModBus.ino)
missed this change. Now tasmota-sensors compiles with success!
	moved AGPIO(GPIO_SDM230_XX) to the end:       tasmota/tasmota_template_legacy.h
- fixed comment for SDM230_SPEED define in xnrg_21_sdm230.ino
synced sdm230 driver default registers to generic energy driver values
made maximum power, phase angle and resettable energy optional
@dad401
Copy link
Author

dad401 commented Jan 15, 2022

Let me know if something else has to be changed...

@arendst arendst merged commit 7a2d490 into arendst:development Jan 15, 2022
arendst added a commit that referenced this pull request Jan 15, 2022
Add support for Eastron SDM230 modBus energy meter (#13443)
@g6094199
Copy link

since this is a single phase counter, is it possible to run 3 counters in parallel over the rs485 for all phases to one tasmota unit and get it aggregated there?

@dad401
Copy link
Author

dad401 commented Apr 7, 2022

is it possible to run 3 counters in parallel over the rs485 for all phases to one tasmota unit and get it aggregated there?

I don`t think so.
Have a look at these posts:
#8445 (comment)
#2803 (comment)

Having more than one device, IMHO it`s better to go with the Smart Meter Interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants